File tree Expand file tree Collapse file tree 3 files changed +31
-6
lines changed
drivers/infiniband/hw/hfi1 Expand file tree Collapse file tree 3 files changed +31
-6
lines changed Original file line number Diff line number Diff line change @@ -830,6 +830,25 @@ static int create_workqueues(struct hfi1_devdata *dd)
830
830
return - ENOMEM ;
831
831
}
832
832
833
+ /**
834
+ * destroy_workqueues - destroy per port workqueues
835
+ * @dd: the hfi1_ib device
836
+ */
837
+ static void destroy_workqueues (struct hfi1_devdata * dd )
838
+ {
839
+ int pidx ;
840
+ struct hfi1_pportdata * ppd ;
841
+
842
+ for (pidx = 0 ; pidx < dd -> num_pports ; ++ pidx ) {
843
+ ppd = dd -> pport + pidx ;
844
+
845
+ if (ppd -> hfi1_wq ) {
846
+ destroy_workqueue (ppd -> hfi1_wq );
847
+ ppd -> hfi1_wq = NULL ;
848
+ }
849
+ }
850
+ }
851
+
833
852
/**
834
853
* enable_general_intr() - Enable the IRQs that will be handled by the
835
854
* general interrupt handler.
@@ -1104,11 +1123,10 @@ static void shutdown_device(struct hfi1_devdata *dd)
1104
1123
*/
1105
1124
hfi1_quiet_serdes (ppd );
1106
1125
1107
- if (ppd -> hfi1_wq ) {
1108
- destroy_workqueue (ppd -> hfi1_wq );
1109
- ppd -> hfi1_wq = NULL ;
1110
- }
1126
+ if (ppd -> hfi1_wq )
1127
+ flush_workqueue (ppd -> hfi1_wq );
1111
1128
if (ppd -> link_wq ) {
1129
+ flush_workqueue (ppd -> link_wq );
1112
1130
destroy_workqueue (ppd -> link_wq );
1113
1131
ppd -> link_wq = NULL ;
1114
1132
}
@@ -1756,6 +1774,7 @@ static void remove_one(struct pci_dev *pdev)
1756
1774
* clear dma engines, etc.
1757
1775
*/
1758
1776
shutdown_device (dd );
1777
+ destroy_workqueues (dd );
1759
1778
1760
1779
stop_timers (dd );
1761
1780
Original file line number Diff line number Diff line change @@ -367,7 +367,10 @@ bool _hfi1_schedule_send(struct rvt_qp *qp)
367
367
struct hfi1_ibport * ibp =
368
368
to_iport (qp -> ibqp .device , qp -> port_num );
369
369
struct hfi1_pportdata * ppd = ppd_from_ibp (ibp );
370
- struct hfi1_devdata * dd = dd_from_ibdev (qp -> ibqp .device );
370
+ struct hfi1_devdata * dd = ppd -> dd ;
371
+
372
+ if (dd -> flags & HFI1_SHUTDOWN )
373
+ return true;
371
374
372
375
return iowait_schedule (& priv -> s_iowait , ppd -> hfi1_wq ,
373
376
priv -> s_sde ?
Original file line number Diff line number Diff line change @@ -5406,7 +5406,10 @@ static bool _hfi1_schedule_tid_send(struct rvt_qp *qp)
5406
5406
struct hfi1_ibport * ibp =
5407
5407
to_iport (qp -> ibqp .device , qp -> port_num );
5408
5408
struct hfi1_pportdata * ppd = ppd_from_ibp (ibp );
5409
- struct hfi1_devdata * dd = dd_from_ibdev (qp -> ibqp .device );
5409
+ struct hfi1_devdata * dd = ppd -> dd ;
5410
+
5411
+ if ((dd -> flags & HFI1_SHUTDOWN ))
5412
+ return true;
5410
5413
5411
5414
return iowait_tid_schedule (& priv -> s_iowait , ppd -> hfi1_wq ,
5412
5415
priv -> s_sde ?
You can’t perform that action at this time.
0 commit comments