aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/qib/qib_init.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2010-10-19 11:24:36 -0400
committerRoland Dreier <rolandd@cisco.com>2011-01-17 00:16:31 -0500
commitf06267104dd9112f11586830d22501d0e26245ea (patch)
tree8f7c364abc84a5f69269974eaa2b955b24d8f421 /drivers/infiniband/hw/qib/qib_init.c
parent948579cd8c6ea7c8c98c52b79f4470952e182ebd (diff)
RDMA: Update workqueue usage
* ib_wq is added, which is used as the common workqueue for infiniband instead of the system workqueue. All system workqueue usages including flush_scheduled_work() callers are converted to use and flush ib_wq. * cancel_delayed_work() + flush_scheduled_work() converted to cancel_delayed_work_sync(). * qib_wq is removed and ib_wq is used instead. This is to prepare for deprecation of flush_scheduled_work(). Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/qib/qib_init.c')
-rw-r--r--drivers/infiniband/hw/qib/qib_init.c26
1 files changed, 4 insertions, 22 deletions
diff --git a/drivers/infiniband/hw/qib/qib_init.c b/drivers/infiniband/hw/qib/qib_init.c
index 304bd803854..ffefb78b894 100644
--- a/drivers/infiniband/hw/qib/qib_init.c
+++ b/drivers/infiniband/hw/qib/qib_init.c
@@ -80,7 +80,6 @@ unsigned qib_wc_pat = 1; /* default (1) is to use PAT, not MTRR */
80module_param_named(wc_pat, qib_wc_pat, uint, S_IRUGO); 80module_param_named(wc_pat, qib_wc_pat, uint, S_IRUGO);
81MODULE_PARM_DESC(wc_pat, "enable write-combining via PAT mechanism"); 81MODULE_PARM_DESC(wc_pat, "enable write-combining via PAT mechanism");
82 82
83struct workqueue_struct *qib_wq;
84struct workqueue_struct *qib_cq_wq; 83struct workqueue_struct *qib_cq_wq;
85 84
86static void verify_interrupt(unsigned long); 85static void verify_interrupt(unsigned long);
@@ -1044,24 +1043,10 @@ static int __init qlogic_ib_init(void)
1044 if (ret) 1043 if (ret)
1045 goto bail; 1044 goto bail;
1046 1045
1047 /*
1048 * We create our own workqueue mainly because we want to be
1049 * able to flush it when devices are being removed. We can't
1050 * use schedule_work()/flush_scheduled_work() because both
1051 * unregister_netdev() and linkwatch_event take the rtnl lock,
1052 * so flush_scheduled_work() can deadlock during device
1053 * removal.
1054 */
1055 qib_wq = create_workqueue("qib");
1056 if (!qib_wq) {
1057 ret = -ENOMEM;
1058 goto bail_dev;
1059 }
1060
1061 qib_cq_wq = create_singlethread_workqueue("qib_cq"); 1046 qib_cq_wq = create_singlethread_workqueue("qib_cq");
1062 if (!qib_cq_wq) { 1047 if (!qib_cq_wq) {
1063 ret = -ENOMEM; 1048 ret = -ENOMEM;
1064 goto bail_wq; 1049 goto bail_dev;
1065 } 1050 }
1066 1051
1067 /* 1052 /*
@@ -1091,8 +1076,6 @@ bail_unit:
1091 idr_destroy(&qib_unit_table); 1076 idr_destroy(&qib_unit_table);
1092bail_cq_wq: 1077bail_cq_wq:
1093 destroy_workqueue(qib_cq_wq); 1078 destroy_workqueue(qib_cq_wq);
1094bail_wq:
1095 destroy_workqueue(qib_wq);
1096bail_dev: 1079bail_dev:
1097 qib_dev_cleanup(); 1080 qib_dev_cleanup();
1098bail: 1081bail:
@@ -1116,7 +1099,6 @@ static void __exit qlogic_ib_cleanup(void)
1116 1099
1117 pci_unregister_driver(&qib_driver); 1100 pci_unregister_driver(&qib_driver);
1118 1101
1119 destroy_workqueue(qib_wq);
1120 destroy_workqueue(qib_cq_wq); 1102 destroy_workqueue(qib_cq_wq);
1121 1103
1122 qib_cpulist_count = 0; 1104 qib_cpulist_count = 0;
@@ -1289,7 +1271,7 @@ static int __devinit qib_init_one(struct pci_dev *pdev,
1289 1271
1290 if (qib_mini_init || initfail || ret) { 1272 if (qib_mini_init || initfail || ret) {
1291 qib_stop_timers(dd); 1273 qib_stop_timers(dd);
1292 flush_scheduled_work(); 1274 flush_workqueue(ib_wq);
1293 for (pidx = 0; pidx < dd->num_pports; ++pidx) 1275 for (pidx = 0; pidx < dd->num_pports; ++pidx)
1294 dd->f_quiet_serdes(dd->pport + pidx); 1276 dd->f_quiet_serdes(dd->pport + pidx);
1295 if (qib_mini_init) 1277 if (qib_mini_init)
@@ -1338,8 +1320,8 @@ static void __devexit qib_remove_one(struct pci_dev *pdev)
1338 1320
1339 qib_stop_timers(dd); 1321 qib_stop_timers(dd);
1340 1322
1341 /* wait until all of our (qsfp) schedule_work() calls complete */ 1323 /* wait until all of our (qsfp) queue_work() calls complete */
1342 flush_scheduled_work(); 1324 flush_workqueue(ib_wq);
1343 1325
1344 ret = qibfs_remove(dd); 1326 ret = qibfs_remove(dd);
1345 if (ret) 1327 if (ret)