]> git.itanic.dy.fi Git - linux-stable/commit
net: phy: mxl-gpy: add MDINT workaround
authorMichael Walle <michael@walle.cc>
Mon, 5 Dec 2022 20:04:53 +0000 (21:04 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 8 Dec 2022 04:04:11 +0000 (20:04 -0800)
commit5f4d487d01ff5349da38f7a09ca36bf6aa2e29fb
tree000b2585a67a3d86c12b7858d9fec9e30b0e923a
parent65e349f766a6f63d9f8679697fce8cfba1cce672
net: phy: mxl-gpy: add MDINT workaround

At least the GPY215B and GPY215C has a bug where it is still driving the
interrupt line (MDINT) even after the interrupt status register is read
and its bits are cleared. This will cause an interrupt storm.

Although the MDINT is multiplexed with a GPIO pin and theoretically we
could switch the pinmux to GPIO input mode, this isn't possible because
the access to this register will stall exactly as long as the interrupt
line is asserted. We exploit this very fact and just read a random
internal register in our interrupt handler. This way, it will be delayed
until the external interrupt line is released and an interrupt storm is
avoided.

The internal register access via the mailbox was deduced by looking at
the downstream PHY API because the datasheet doesn't mention any of
this.

Fixes: 7d901a1e878a ("net: phy: add Maxlinear GPY115/21x/24x driver")
Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20221205200453.3447866-1-michael@walle.cc
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/mxl-gpy.c