net: phy: avoid clearing PHY interrupts twice in irq handler
authorHeiner Kallweit <hkallweit1@gmail.com>
Sun, 1 Mar 2020 20:36:09 +0000 (21:36 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Mar 2020 06:17:46 +0000 (07:17 +0100)
commit4d365c7b4747379bc489c126727431994c908796
tree62de09f9d583371990e580ca31aca17a8bcea86c
parent7030138e3c6d778f1ecb30af70127ada2492f5a7
net: phy: avoid clearing PHY interrupts twice in irq handler

[ Upstream commit 249bc9744e165abe74ae326f43e9d70bad54c3b7 ]

On all PHY drivers that implement did_interrupt() reading the interrupt
status bits clears them. This means we may loose an interrupt that
is triggered between calling did_interrupt() and phy_clear_interrupt().
As part of the fix make it a requirement that did_interrupt() clears
the interrupt.

The Fixes tag refers to the first commit where the patch applies
cleanly.

Fixes: 49644e68f472 ("net: phy: add callback for custom interrupt handler to struct phy_driver")
Reported-by: Michael Walle <michael@walle.cc>
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/phy/phy.c
include/linux/phy.h