diff options
author | Somnath Kotur <somnath.kotur@emulex.com> | 2010-10-25 19:01:03 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-10-27 14:37:30 -0400 |
commit | f203af7088cad0845ee128bb736bd372158c3e22 (patch) | |
tree | 23e8c8a9ef0ee10e9a06df0029b25f95bdffca6f /drivers/net/benet/be_main.c | |
parent | 853dc2e03ddd0c49885ed55c48755d2b1073122a (diff) |
be2net: Schedule/Destroy worker thread in probe()/remove() rather than open()/close()
When async mcc compls are rcvd on an i/f that is down (and so interrupts are disabled)
they just lie unprocessed in the compl queue.The compl queue can eventually get filled
up and cause the BE to lock up.The fix is to use be_worker to reap mcc compls when the
i/f is down.be_worker is now launched in be_probe() and canceled in be_remove().
Signed-off-by: Somnath Kotur <somnath.kotur@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/benet/be_main.c')
-rw-r--r-- | drivers/net/benet/be_main.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c index 6b80a06eb3a7..c36cd2ffbadc 100644 --- a/drivers/net/benet/be_main.c +++ b/drivers/net/benet/be_main.c | |||
@@ -1802,6 +1802,20 @@ static void be_worker(struct work_struct *work) | |||
1802 | struct be_rx_obj *rxo; | 1802 | struct be_rx_obj *rxo; |
1803 | int i; | 1803 | int i; |
1804 | 1804 | ||
1805 | /* when interrupts are not yet enabled, just reap any pending | ||
1806 | * mcc completions */ | ||
1807 | if (!netif_running(adapter->netdev)) { | ||
1808 | int mcc_compl, status = 0; | ||
1809 | |||
1810 | mcc_compl = be_process_mcc(adapter, &status); | ||
1811 | |||
1812 | if (mcc_compl) { | ||
1813 | struct be_mcc_obj *mcc_obj = &adapter->mcc_obj; | ||
1814 | be_cq_notify(adapter, mcc_obj->cq.id, false, mcc_compl); | ||
1815 | } | ||
1816 | goto reschedule; | ||
1817 | } | ||
1818 | |||
1805 | if (!adapter->stats_ioctl_sent) | 1819 | if (!adapter->stats_ioctl_sent) |
1806 | be_cmd_get_stats(adapter, &adapter->stats_cmd); | 1820 | be_cmd_get_stats(adapter, &adapter->stats_cmd); |
1807 | 1821 | ||
@@ -1820,6 +1834,7 @@ static void be_worker(struct work_struct *work) | |||
1820 | if (!adapter->ue_detected) | 1834 | if (!adapter->ue_detected) |
1821 | be_detect_dump_ue(adapter); | 1835 | be_detect_dump_ue(adapter); |
1822 | 1836 | ||
1837 | reschedule: | ||
1823 | schedule_delayed_work(&adapter->work, msecs_to_jiffies(1000)); | 1838 | schedule_delayed_work(&adapter->work, msecs_to_jiffies(1000)); |
1824 | } | 1839 | } |
1825 | 1840 | ||
@@ -2015,8 +2030,6 @@ static int be_close(struct net_device *netdev) | |||
2015 | struct be_eq_obj *tx_eq = &adapter->tx_eq; | 2030 | struct be_eq_obj *tx_eq = &adapter->tx_eq; |
2016 | int vec, i; | 2031 | int vec, i; |
2017 | 2032 | ||
2018 | cancel_delayed_work_sync(&adapter->work); | ||
2019 | |||
2020 | be_async_mcc_disable(adapter); | 2033 | be_async_mcc_disable(adapter); |
2021 | 2034 | ||
2022 | netif_stop_queue(netdev); | 2035 | netif_stop_queue(netdev); |
@@ -2081,8 +2094,6 @@ static int be_open(struct net_device *netdev) | |||
2081 | /* Now that interrupts are on we can process async mcc */ | 2094 | /* Now that interrupts are on we can process async mcc */ |
2082 | be_async_mcc_enable(adapter); | 2095 | be_async_mcc_enable(adapter); |
2083 | 2096 | ||
2084 | schedule_delayed_work(&adapter->work, msecs_to_jiffies(100)); | ||
2085 | |||
2086 | status = be_cmd_link_status_query(adapter, &link_up, &mac_speed, | 2097 | status = be_cmd_link_status_query(adapter, &link_up, &mac_speed, |
2087 | &link_speed); | 2098 | &link_speed); |
2088 | if (status) | 2099 | if (status) |
@@ -2707,6 +2718,8 @@ static void __devexit be_remove(struct pci_dev *pdev) | |||
2707 | if (!adapter) | 2718 | if (!adapter) |
2708 | return; | 2719 | return; |
2709 | 2720 | ||
2721 | cancel_delayed_work_sync(&adapter->work); | ||
2722 | |||
2710 | unregister_netdev(adapter->netdev); | 2723 | unregister_netdev(adapter->netdev); |
2711 | 2724 | ||
2712 | be_clear(adapter); | 2725 | be_clear(adapter); |
@@ -2863,6 +2876,7 @@ static int __devinit be_probe(struct pci_dev *pdev, | |||
2863 | netif_carrier_off(netdev); | 2876 | netif_carrier_off(netdev); |
2864 | 2877 | ||
2865 | dev_info(&pdev->dev, "%s port %d\n", nic_name(pdev), adapter->port_num); | 2878 | dev_info(&pdev->dev, "%s port %d\n", nic_name(pdev), adapter->port_num); |
2879 | schedule_delayed_work(&adapter->work, msecs_to_jiffies(100)); | ||
2866 | return 0; | 2880 | return 0; |
2867 | 2881 | ||
2868 | unsetup: | 2882 | unsetup: |