• Maciej W. Rozycki's avatar
    [PATCH] 2.6.18: sb1250-mac: Phylib IRQ handling fixes · 3c3070d7
    Maciej W. Rozycki authored
     This patch fixes a couple of problems discovered with interrupt handling
    in the phylib core, namely:
    
    1. The driver uses timer and workqueue calls, but does not include
       <linux/timer.h> nor <linux/workqueue.h>.
    
    2. The driver uses schedule_work() for handling interrupts, but does not
       make sure any pending work scheduled thus has been completed before
       driver's structures get freed from memory.  This is especially
       important as interrupts may keep arriving if the line is shared with
       another PHY.
    
       The solution is to ignore phy_interrupt() calls if the reported device
       has already been halted and calling flush_scheduled_work() from
       phy_stop_interrupts() (but guarded with current_is_keventd() in case
       the function has been called through keventd from the MAC device's
       close call to avoid a deadlock on the netlink lock).
    Signed-off-by: default avatarMaciej W. Rozycki <macro@linux-mips.org>
    
    patch-mips-2.6.18-20060920-phy-irq-16
    Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
    3c3070d7
phy.c 19.6 KB