• Maciej W. Rozycki's avatar
    PHYLIB: fix an interrupt loop potential when halting · 6daf6531
    Maciej W. Rozycki authored
    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: default avatarMaciej W. Rozycki <macro@linux-mips.org>
    Cc: Andy Fleming <afleming@freescale.com>
    Cc: Jeff Garzik <jgarzik@pobox.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
    6daf6531
phy.c 23.1 KB