diff options
author | Adrian Bunk <bunk@kernel.org> | 2008-03-31 02:22:18 +0300 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-04-16 20:41:42 -0400 |
commit | b1555130c7d7e1d4cc5b7784cd090668db244fc5 (patch) | |
tree | 578ed3823d4f59739574a59856a2d92cf8834978 /drivers/net/netxen/netxen_nic_main.c | |
parent | 3caa4af834df519fda0f1ea6af4a5c7abfec98c7 (diff) | |
download | op-kernel-dev-b1555130c7d7e1d4cc5b7784cd090668db244fc5.zip op-kernel-dev-b1555130c7d7e1d4cc5b7784cd090668db244fc5.tar.gz |
make netxen_workq static
netxen_workq can now become static.
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/netxen/netxen_nic_main.c')
-rw-r--r-- | drivers/net/netxen/netxen_nic_main.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index a8fb439..7144c25 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c @@ -86,7 +86,24 @@ static struct pci_device_id netxen_pci_tbl[] __devinitdata = { MODULE_DEVICE_TABLE(pci, netxen_pci_tbl); -struct workqueue_struct *netxen_workq; +/* + * In netxen_nic_down(), we must wait for any pending callback requests into + * netxen_watchdog_task() to complete; eg otherwise the watchdog_timer could be + * reenabled right after it is deleted in netxen_nic_down(). + * FLUSH_SCHEDULED_WORK() does this synchronization. + * + * Normally, schedule_work()/flush_scheduled_work() could have worked, but + * netxen_nic_close() is invoked with kernel rtnl lock held. netif_carrier_off() + * call in netxen_nic_close() triggers a schedule_work(&linkwatch_work), and a + * subsequent call to flush_scheduled_work() in netxen_nic_down() would cause + * linkwatch_event() to be executed which also attempts to acquire the rtnl + * lock thus causing a deadlock. + */ + +static struct workqueue_struct *netxen_workq; +#define SCHEDULE_WORK(tp) queue_work(netxen_workq, tp) +#define FLUSH_SCHEDULED_WORK() flush_workqueue(netxen_workq) + static void netxen_watchdog(unsigned long); static void netxen_nic_update_cmd_producer(struct netxen_adapter *adapter, |