]> git.baikalelectronics.ru Git - kernel.git/commit
mdio: aspeed: Fix "Link is Down" issue
authorDylan Hung <dylan_hung@aspeedtech.com>
Thu, 25 Nov 2021 02:44:32 +0000 (10:44 +0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 25 Nov 2021 15:44:42 +0000 (07:44 -0800)
commitc937e742552717d8bcab2c0666e462d42ee1b8d8
treee47ef638c9b706e94f3badd262eca41cc131baf3
parent40cb22488710051ae833481ea61cfde119cd9e34
mdio: aspeed: Fix "Link is Down" issue

The issue happened randomly in runtime.  The message "Link is Down" is
popped but soon it recovered to "Link is Up".

The "Link is Down" results from the incorrect read data for reading the
PHY register via MDIO bus.  The correct sequence for reading the data
shall be:
1. fire the command
2. wait for command done (this step was missing)
3. wait for data idle
4. read data from data register

Cc: stable@vger.kernel.org
Fixes: 31d56b3f9077 ("net: phy: Add mdio-aspeed")
Reviewed-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Dylan Hung <dylan_hung@aspeedtech.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://lore.kernel.org/r/20211125024432.15809-1-dylan_hung@aspeedtech.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/mdio/mdio-aspeed.c