Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6daf65310374d24d888201b7a6eba90b44008b7b
Commit:     6daf65310374d24d888201b7a6eba90b44008b7b
Parent:     0ac49527318bc388a881152d60f49d7951606024
Author:     Maciej W. Rozycki <[EMAIL PROTECTED]>
AuthorDate: Fri Sep 28 22:42:15 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Oct 10 16:53:55 2007 -0700

    PHYLIB: fix an interrupt loop potential when halting
    
    Ensure the PHY_HALTED state is not entered with the IRQ asserted as it
    could lead to an interrupt loop.
    
    There is a small window in phy_stop(), where the state of the PHY machine
    indicates it has been halted, but its interrupt output might still be
    unmasked.  If an interrupt goes active right at this moment it will loop as
    the phy_interrupt() handler exits immediately with IRQ_NONE if the halted
    state is seen.  It is unsafe to extend the phydev spinlock to cover
    phy_interrupt().  It is safe to swap the order of the actions though as all
    the competing places to unmask the interrupt output of the PHY, which are
    phy_change() and phy_timer() are already covered with the lock as is the
    sequence in question.
    
    Signed-off-by: Maciej W. Rozycki <[EMAIL PROTECTED]>
    Cc: Andy Fleming <[EMAIL PROTECTED]>
    Cc: Jeff Garzik <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/net/phy/phy.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 5a314ed..9bc1177 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -737,8 +737,6 @@ void phy_stop(struct phy_device *phydev)
        if (PHY_HALTED == phydev->state)
                goto out_unlock;
 
-       phydev->state = PHY_HALTED;
-
        if (phydev->irq != PHY_POLL) {
                /* Disable PHY Interrupts */
                phy_config_interrupt(phydev, PHY_INTERRUPT_DISABLED);
@@ -747,6 +745,8 @@ void phy_stop(struct phy_device *phydev)
                phy_clear_interrupt(phydev);
        }
 
+       phydev->state = PHY_HALTED;
+
 out_unlock:
        spin_unlock_bh(&phydev->lock);
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to