From a0883290f6ce63e36eb0a9a0197716b2810d5b49 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 31 Mar 2008 02:22:18 +0300 Subject: [PATCH] --- yaml --- r: 90879 b: refs/heads/master c: b1555130c7d7e1d4cc5b7784cd090668db244fc5 h: refs/heads/master i: 90877: 363c1665c9730ae17ccc66b9455555519797b709 90875: 31a8e335390f394fac7f246cf0e4149f8e9b9d7a 90871: cfcf1f22f781e0e09e09cf9286c720028a99b5ad 90863: 3716ca642b52983d63adb90d8ba62718df01bfb2 90847: 0b332888a41de772af93440881753c8ed992e988 90815: fe95b0e5918b8ea53833ebe10453c77b52d68df4 90751: c54b5a1d0bf6e1e1b55b33ae0e6cae2360b37c31 90623: f004633da80074e02db9f6a0ac6dd7900b2d3774 v: v3 --- [refs] | 2 +- trunk/drivers/net/netxen/netxen_nic.h | 17 ----------------- trunk/drivers/net/netxen/netxen_nic_main.c | 19 ++++++++++++++++++- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/[refs] b/[refs] index 60fb94729067..f048e8202420 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3caa4af834df519fda0f1ea6af4a5c7abfec98c7 +refs/heads/master: b1555130c7d7e1d4cc5b7784cd090668db244fc5 diff --git a/trunk/drivers/net/netxen/netxen_nic.h b/trunk/drivers/net/netxen/netxen_nic.h index 7f20a03623a0..181ac0277744 100644 --- a/trunk/drivers/net/netxen/netxen_nic.h +++ b/trunk/drivers/net/netxen/netxen_nic.h @@ -95,23 +95,6 @@ #define ADDR_IN_WINDOW1(off) \ ((off > NETXEN_CRB_PCIX_HOST2) && (off < NETXEN_CRB_MAX)) ? 1 : 0 -/* - * 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. - */ - -#define SCHEDULE_WORK(tp) queue_work(netxen_workq, tp) -#define FLUSH_SCHEDULED_WORK() flush_workqueue(netxen_workq) -extern struct workqueue_struct *netxen_workq; /* * normalize a 64MB crb address to 32MB PCI window diff --git a/trunk/drivers/net/netxen/netxen_nic_main.c b/trunk/drivers/net/netxen/netxen_nic_main.c index a8fb439a4d03..7144c255ce54 100644 --- a/trunk/drivers/net/netxen/netxen_nic_main.c +++ b/trunk/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,