@@ -235,9 +235,25 @@ static void pm8001_init_tasklet(struct pm8001_hba_info *pm8001_ha)
235
235
(unsigned long )& (pm8001_ha -> irq_vector [i ]));
236
236
}
237
237
238
+ static void pm8001_kill_tasklet (struct pm8001_hba_info * pm8001_ha )
239
+ {
240
+ int i ;
241
+
242
+ /* For non-msix and msix interrupts */
243
+ if ((!pm8001_ha -> pdev -> msix_cap || !pci_msi_enabled ()) ||
244
+ (pm8001_ha -> chip_id == chip_8001 )) {
245
+ tasklet_kill (& pm8001_ha -> tasklet [0 ]);
246
+ return ;
247
+ }
248
+
249
+ for (i = 0 ; i < PM8001_MAX_MSIX_VEC ; i ++ )
250
+ tasklet_kill (& pm8001_ha -> tasklet [i ]);
251
+ }
252
+
238
253
#else
239
254
240
255
static void pm8001_init_tasklet (struct pm8001_hba_info * pm8001_ha ) {}
256
+ static void pm8001_kill_tasklet (struct pm8001_hba_info * pm8001_ha ) {}
241
257
242
258
#endif
243
259
@@ -1283,7 +1299,7 @@ static void pm8001_pci_remove(struct pci_dev *pdev)
1283
1299
{
1284
1300
struct sas_ha_struct * sha = pci_get_drvdata (pdev );
1285
1301
struct pm8001_hba_info * pm8001_ha = sha -> lldd_ha ;
1286
- int i , j ;
1302
+ int i ;
1287
1303
1288
1304
sas_unregister_ha (sha );
1289
1305
sas_remove_host (pm8001_ha -> shost );
@@ -1292,16 +1308,7 @@ static void pm8001_pci_remove(struct pci_dev *pdev)
1292
1308
PM8001_CHIP_DISP -> chip_soft_rst (pm8001_ha );
1293
1309
1294
1310
pm8001_free_irq (pm8001_ha );
1295
-
1296
- #ifdef PM8001_USE_TASKLET
1297
- /* For non-msix and msix interrupts */
1298
- if ((!pdev -> msix_cap || !pci_msi_enabled ()) ||
1299
- (pm8001_ha -> chip_id == chip_8001 ))
1300
- tasklet_kill (& pm8001_ha -> tasklet [0 ]);
1301
- else
1302
- for (j = 0 ; j < PM8001_MAX_MSIX_VEC ; j ++ )
1303
- tasklet_kill (& pm8001_ha -> tasklet [j ]);
1304
- #endif
1311
+ pm8001_kill_tasklet (pm8001_ha );
1305
1312
scsi_host_put (pm8001_ha -> shost );
1306
1313
1307
1314
for (i = 0 ; i < pm8001_ha -> ccb_count ; i ++ ) {
@@ -1332,7 +1339,6 @@ static int __maybe_unused pm8001_pci_suspend(struct device *dev)
1332
1339
struct pci_dev * pdev = to_pci_dev (dev );
1333
1340
struct sas_ha_struct * sha = pci_get_drvdata (pdev );
1334
1341
struct pm8001_hba_info * pm8001_ha = sha -> lldd_ha ;
1335
- int j ;
1336
1342
1337
1343
sas_suspend_ha (sha );
1338
1344
flush_workqueue (pm8001_wq );
@@ -1345,16 +1351,8 @@ static int __maybe_unused pm8001_pci_suspend(struct device *dev)
1345
1351
PM8001_CHIP_DISP -> chip_soft_rst (pm8001_ha );
1346
1352
1347
1353
pm8001_free_irq (pm8001_ha );
1354
+ pm8001_kill_tasklet (pm8001_ha );
1348
1355
1349
- #ifdef PM8001_USE_TASKLET
1350
- /* For non-msix and msix interrupts */
1351
- if ((!pdev -> msix_cap || !pci_msi_enabled ()) ||
1352
- (pm8001_ha -> chip_id == chip_8001 ))
1353
- tasklet_kill (& pm8001_ha -> tasklet [0 ]);
1354
- else
1355
- for (j = 0 ; j < PM8001_MAX_MSIX_VEC ; j ++ )
1356
- tasklet_kill (& pm8001_ha -> tasklet [j ]);
1357
- #endif
1358
1356
pm8001_info (pm8001_ha , "pdev=0x%p, slot=%s, entering "
1359
1357
"suspended state\n" , pdev ,
1360
1358
pm8001_ha -> name );
0 commit comments