]> www.infradead.org Git - users/jedix/linux-maple.git/commit
net: phy: aquantia: poll status register
authorAryan Srivastava <aryan.srivastava@alliedtelesis.co.nz>
Thu, 10 Oct 2024 00:49:34 +0000 (13:49 +1300)
committerJakub Kicinski <kuba@kernel.org>
Fri, 11 Oct 2024 15:43:47 +0000 (08:43 -0700)
commit7e5b547cac7a56515b2838b496923e52ec4eeddd
tree6bebf41afca7435f38cf645049dbf15d9f2dd2fd
parent8401a108a63302a5a198c7075d857895ca624851
net: phy: aquantia: poll status register

The system interface connection status register is not immediately
correct upon line side link up. This results in the status being read as
OFF and then transitioning to the correct host side link mode with a
short delay. This causes the phylink framework passing the OFF status
down to all MAC config drivers, resulting in the host side link being
misconfigured, which in turn can lead to link flapping or complete
packet loss in some cases.

Mitigate this by periodically polling the register until it not showing
the OFF state. This will be done every 1ms for 10ms, using the same
poll/timeout as the processor intensive operation reads.

If the phy is still expressing the OFF state after the timeout, then set
the link to false and pass the NA interface mode onto the phylink
framework.

Signed-off-by: Aryan Srivastava <aryan.srivastava@alliedtelesis.co.nz>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20241010004935.1774601-1-aryan.srivastava@alliedtelesis.co.nz
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/aquantia/aquantia_main.c