OSDN Git Service

net: socionext: Add dummy PHY register read in phy_write()
authorMasahisa Kojima <masahisa.kojima@linaro.org>
Tue, 23 Oct 2018 11:24:27 +0000 (20:24 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jan 2020 13:50:00 +0000 (14:50 +0100)
commit38cd31f38159bc6c72051eae026c0def2cac2410
tree23d7931b432e76c03204ea29c8936fde8f2cd014
parent5d070b430a9a7f50e26dcc9a952eb1b38467f8be
net: socionext: Add dummy PHY register read in phy_write()

[ Upstream commit a3241a91de6429051a211b5ce04d6946157caec7 ]

There is a compatibility issue between RTL8211E implemented
in Developerbox and netsec ethernet controller IP.

Our MDIO controller stops MDC clock right after the write
access, but RTL8211E expects MDC clock must be kept toggling
for several clock cycle with MDIO high before entering
the IDLE state. Without keeping clock after write access,
write access is not correctly handled and register is not
updated.

To meet this requirement, netsec driver needs to issue dummy
read(e.g. read PHYID1(offset 0x2) register) right after write
access, to keep MDC clock.

We think this compatibility issue is a problem specific to
our MDIO controller and RTL8211E.

Fixes: 533dd11a12f6 ("net: socionext: Add Synquacer NetSec driver")
Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Signed-off-by: Yoshitoyo Osaki <osaki.yoshitoyo@socionext.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/socionext/netsec.c