ath79: ar8216: make switch register access atomic
authorChuanhong Guo <gch981213@gmail.com>
Mon, 21 Sep 2020 06:57:44 +0000 (14:57 +0800)
committerChuanhong Guo <gch981213@gmail.com>
Sun, 11 Oct 2020 03:57:55 +0000 (11:57 +0800)
commitb21bea7b1b92abefad53bcfe509b7e44dd488c79
tree36a305d5024f7a01173f90bfad1f6aa3b969c8ee
parent891022918d55b565b49b7ecafc4ebf8a66461a13
ath79: ar8216: make switch register access atomic

reg accesses on integrated ar8229 sometimes fails. As a result, phy read
got incorrect port status and wan link goes down and up mysteriously.
After comparing ar8216 with the old driver, these local_irq_save/restore
calls are the only meaningful differences I could find and it does fix
the issue.
The same changes were added in svn r26856 by Gabor Juhos:
ar71xx: ag71xx: make switch register access atomic

As I can't find the underlying problem either, this hack is broght
back to fix the unstable link issue.
This hack is only suitable for ath79 mdio and may easily break the
driver on other platform. Limit it to ath79-only as a target patch.

Fixes: FS#2216
Fixes: FS#3226
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
(cherry picked from commit 86fdc8abed5992a74078b000b5ff9da723b6f46b)
target/linux/ath79/patches-4.14/930-ar8216-make-reg-access-atomic.patch [new file with mode: 0644]