]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit - drivers/net/phy/phy.c
[PATCH] 2.6.18: sb1250-mac: Phylib IRQ handling fixes
authorMaciej W. Rozycki <macro@linux-mips.org>
Tue, 3 Oct 2006 15:18:35 +0000 (16:18 +0100)
committerJeff Garzik <jeff@garzik.org>
Sat, 2 Dec 2006 05:11:55 +0000 (00:11 -0500)
commit3c3070d713d798f7f9e7ee3614e49b47655d14d8
tree232d881df29f8a14b73b08bf862739089b194e65
parent13df29f69749a61b5209d52b71fcbf7300e5d6fb
[PATCH] 2.6.18: sb1250-mac: Phylib IRQ handling fixes

 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: Maciej W. Rozycki <macro@linux-mips.org>
patch-mips-2.6.18-20060920-phy-irq-16
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/phy/phy.c