From fa7cfb1b9b63a614494dbb6ef65493c16567c669 Mon Sep 17 00:00:00 2001 From: Anatolij Gustschin Date: Tue, 7 Apr 2009 02:01:42 +0000 Subject: [PATCH] --- yaml --- r: 143434 b: refs/heads/master c: a8729eb302a5b5da8b0b4d29582c42648a2e0f12 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/net/phy/phy.c | 9 +++++++++ trunk/include/linux/phy.h | 6 ++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 159483530ada..707e40356202 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 140bc92903287cff4545e358c1651e4b7312cbd3 +refs/heads/master: a8729eb302a5b5da8b0b4d29582c42648a2e0f12 diff --git a/trunk/drivers/net/phy/phy.c b/trunk/drivers/net/phy/phy.c index 3ff1f425f1bb..e3b8932d7d74 100644 --- a/trunk/drivers/net/phy/phy.c +++ b/trunk/drivers/net/phy/phy.c @@ -655,6 +655,10 @@ static void phy_change(struct work_struct *work) struct phy_device *phydev = container_of(work, struct phy_device, phy_queue); + if (phydev->drv->did_interrupt && + !phydev->drv->did_interrupt(phydev)) + goto ignore; + err = phy_disable_interrupts(phydev); if (err) @@ -681,6 +685,11 @@ static void phy_change(struct work_struct *work) return; +ignore: + atomic_dec(&phydev->irq_disable); + enable_irq(phydev->irq); + return; + irq_enable_err: disable_irq(phydev->irq); atomic_inc(&phydev->irq_disable); diff --git a/trunk/include/linux/phy.h b/trunk/include/linux/phy.h index 32cf14a4b034..97e40cb6b588 100644 --- a/trunk/include/linux/phy.h +++ b/trunk/include/linux/phy.h @@ -388,6 +388,12 @@ struct phy_driver { /* Enables or disables interrupts */ int (*config_intr)(struct phy_device *phydev); + /* + * Checks if the PHY generated an interrupt. + * For multi-PHY devices with shared PHY interrupt pin + */ + int (*did_interrupt)(struct phy_device *phydev); + /* Clears up any memory if needed */ void (*remove)(struct phy_device *phydev);