diff options
-rw-r--r-- | drivers/net/phy/phy.c | 9 | ||||
-rw-r--r-- | include/linux/phy.h | 6 |
2 files changed, 15 insertions, 0 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 3ff1f425f1bb..e3b8932d7d74 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c | |||
@@ -655,6 +655,10 @@ static void phy_change(struct work_struct *work) | |||
655 | struct phy_device *phydev = | 655 | struct phy_device *phydev = |
656 | container_of(work, struct phy_device, phy_queue); | 656 | container_of(work, struct phy_device, phy_queue); |
657 | 657 | ||
658 | if (phydev->drv->did_interrupt && | ||
659 | !phydev->drv->did_interrupt(phydev)) | ||
660 | goto ignore; | ||
661 | |||
658 | err = phy_disable_interrupts(phydev); | 662 | err = phy_disable_interrupts(phydev); |
659 | 663 | ||
660 | if (err) | 664 | if (err) |
@@ -681,6 +685,11 @@ static void phy_change(struct work_struct *work) | |||
681 | 685 | ||
682 | return; | 686 | return; |
683 | 687 | ||
688 | ignore: | ||
689 | atomic_dec(&phydev->irq_disable); | ||
690 | enable_irq(phydev->irq); | ||
691 | return; | ||
692 | |||
684 | irq_enable_err: | 693 | irq_enable_err: |
685 | disable_irq(phydev->irq); | 694 | disable_irq(phydev->irq); |
686 | atomic_inc(&phydev->irq_disable); | 695 | atomic_inc(&phydev->irq_disable); |
diff --git a/include/linux/phy.h b/include/linux/phy.h index 32cf14a4b034..97e40cb6b588 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h | |||
@@ -388,6 +388,12 @@ struct phy_driver { | |||
388 | /* Enables or disables interrupts */ | 388 | /* Enables or disables interrupts */ |
389 | int (*config_intr)(struct phy_device *phydev); | 389 | int (*config_intr)(struct phy_device *phydev); |
390 | 390 | ||
391 | /* | ||
392 | * Checks if the PHY generated an interrupt. | ||
393 | * For multi-PHY devices with shared PHY interrupt pin | ||
394 | */ | ||
395 | int (*did_interrupt)(struct phy_device *phydev); | ||
396 | |||
391 | /* Clears up any memory if needed */ | 397 | /* Clears up any memory if needed */ |
392 | void (*remove)(struct phy_device *phydev); | 398 | void (*remove)(struct phy_device *phydev); |
393 | 399 | ||