diff options
-rw-r--r-- | drivers/scsi/aic94xx/aic94xx_scb.c | 9 | ||||
-rw-r--r-- | drivers/scsi/libsas/sas_scsi_host.c | 4 | ||||
-rw-r--r-- | drivers/scsi/scsi_tgt_lib.c | 15 | ||||
-rw-r--r-- | include/scsi/libsas.h | 2 |
4 files changed, 18 insertions, 12 deletions
diff --git a/drivers/scsi/aic94xx/aic94xx_scb.c b/drivers/scsi/aic94xx/aic94xx_scb.c index 14d5d8c2ee13..75ed6b0569d1 100644 --- a/drivers/scsi/aic94xx/aic94xx_scb.c +++ b/drivers/scsi/aic94xx/aic94xx_scb.c | |||
@@ -414,9 +414,10 @@ void asd_invalidate_edb(struct asd_ascb *ascb, int edb_id) | |||
414 | } | 414 | } |
415 | 415 | ||
416 | /* hard reset a phy later */ | 416 | /* hard reset a phy later */ |
417 | static void do_phy_reset_later(void *data) | 417 | static void do_phy_reset_later(struct work_struct *work) |
418 | { | 418 | { |
419 | struct sas_phy *sas_phy = data; | 419 | struct sas_phy *sas_phy = |
420 | container_of(work, struct sas_phy, reset_work); | ||
420 | int error; | 421 | int error; |
421 | 422 | ||
422 | ASD_DPRINTK("%s: About to hard reset phy %d\n", __FUNCTION__, | 423 | ASD_DPRINTK("%s: About to hard reset phy %d\n", __FUNCTION__, |
@@ -430,7 +431,7 @@ static void do_phy_reset_later(void *data) | |||
430 | 431 | ||
431 | static void phy_reset_later(struct sas_phy *sas_phy, struct Scsi_Host *shost) | 432 | static void phy_reset_later(struct sas_phy *sas_phy, struct Scsi_Host *shost) |
432 | { | 433 | { |
433 | INIT_WORK(&sas_phy->reset_work, do_phy_reset_later, sas_phy); | 434 | INIT_WORK(&sas_phy->reset_work, do_phy_reset_later); |
434 | queue_work(shost->work_q, &sas_phy->reset_work); | 435 | queue_work(shost->work_q, &sas_phy->reset_work); |
435 | } | 436 | } |
436 | 437 | ||
@@ -442,7 +443,7 @@ static void task_kill_later(struct asd_ascb *ascb) | |||
442 | struct Scsi_Host *shost = sas_ha->core.shost; | 443 | struct Scsi_Host *shost = sas_ha->core.shost; |
443 | struct sas_task *task = ascb->uldd_task; | 444 | struct sas_task *task = ascb->uldd_task; |
444 | 445 | ||
445 | INIT_WORK(&task->abort_work, (void (*)(void *))sas_task_abort, task); | 446 | INIT_WORK(&task->abort_work, sas_task_abort); |
446 | queue_work(shost->work_q, &task->abort_work); | 447 | queue_work(shost->work_q, &task->abort_work); |
447 | } | 448 | } |
448 | 449 | ||
diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c index e064aac06b90..22672d54aa27 100644 --- a/drivers/scsi/libsas/sas_scsi_host.c +++ b/drivers/scsi/libsas/sas_scsi_host.c | |||
@@ -846,8 +846,10 @@ static int do_sas_task_abort(struct sas_task *task) | |||
846 | return -EAGAIN; | 846 | return -EAGAIN; |
847 | } | 847 | } |
848 | 848 | ||
849 | void sas_task_abort(struct sas_task *task) | 849 | void sas_task_abort(struct work_struct *work) |
850 | { | 850 | { |
851 | struct sas_task *task = | ||
852 | container_of(work, struct sas_task, abort_work); | ||
851 | int i; | 853 | int i; |
852 | 854 | ||
853 | for (i = 0; i < 5; i++) | 855 | for (i = 0; i < 5; i++) |
diff --git a/drivers/scsi/scsi_tgt_lib.c b/drivers/scsi/scsi_tgt_lib.c index 39da5cd6fb6f..386dbae17b44 100644 --- a/drivers/scsi/scsi_tgt_lib.c +++ b/drivers/scsi/scsi_tgt_lib.c | |||
@@ -185,10 +185,11 @@ static void cmd_hashlist_del(struct scsi_cmnd *cmd) | |||
185 | spin_unlock_irqrestore(&qdata->cmd_hash_lock, flags); | 185 | spin_unlock_irqrestore(&qdata->cmd_hash_lock, flags); |
186 | } | 186 | } |
187 | 187 | ||
188 | static void scsi_tgt_cmd_destroy(void *data) | 188 | static void scsi_tgt_cmd_destroy(struct work_struct *work) |
189 | { | 189 | { |
190 | struct scsi_cmnd *cmd = data; | 190 | struct scsi_tgt_cmd *tcmd = |
191 | struct scsi_tgt_cmd *tcmd = cmd->request->end_io_data; | 191 | container_of(work, struct scsi_tgt_cmd, work); |
192 | struct scsi_cmnd *cmd = tcmd->rq->special; | ||
192 | 193 | ||
193 | dprintk("cmd %p %d %lu\n", cmd, cmd->sc_data_direction, | 194 | dprintk("cmd %p %d %lu\n", cmd, cmd->sc_data_direction, |
194 | rq_data_dir(cmd->request)); | 195 | rq_data_dir(cmd->request)); |
@@ -214,6 +215,7 @@ static void init_scsi_tgt_cmd(struct request *rq, struct scsi_tgt_cmd *tcmd, | |||
214 | struct list_head *head; | 215 | struct list_head *head; |
215 | 216 | ||
216 | tcmd->tag = tag; | 217 | tcmd->tag = tag; |
218 | INIT_WORK(&tcmd->work, scsi_tgt_cmd_destroy); | ||
217 | spin_lock_irqsave(&qdata->cmd_hash_lock, flags); | 219 | spin_lock_irqsave(&qdata->cmd_hash_lock, flags); |
218 | head = &qdata->cmd_hash[cmd_hashfn(tag)]; | 220 | head = &qdata->cmd_hash[cmd_hashfn(tag)]; |
219 | list_add(&tcmd->hash_list, head); | 221 | list_add(&tcmd->hash_list, head); |
@@ -303,7 +305,7 @@ void scsi_tgt_free_queue(struct Scsi_Host *shost) | |||
303 | cmd = tcmd->rq->special; | 305 | cmd = tcmd->rq->special; |
304 | 306 | ||
305 | shost->hostt->eh_abort_handler(cmd); | 307 | shost->hostt->eh_abort_handler(cmd); |
306 | scsi_tgt_cmd_destroy(cmd); | 308 | scsi_tgt_cmd_destroy(&tcmd->work); |
307 | } | 309 | } |
308 | } | 310 | } |
309 | EXPORT_SYMBOL_GPL(scsi_tgt_free_queue); | 311 | EXPORT_SYMBOL_GPL(scsi_tgt_free_queue); |
@@ -347,7 +349,6 @@ static void scsi_tgt_cmd_done(struct scsi_cmnd *cmd) | |||
347 | dprintk("cmd %p %lu\n", cmd, rq_data_dir(cmd->request)); | 349 | dprintk("cmd %p %lu\n", cmd, rq_data_dir(cmd->request)); |
348 | 350 | ||
349 | scsi_tgt_uspace_send_status(cmd, tcmd->tag); | 351 | scsi_tgt_uspace_send_status(cmd, tcmd->tag); |
350 | INIT_WORK(&tcmd->work, scsi_tgt_cmd_destroy, cmd); | ||
351 | queue_work(scsi_tgtd, &tcmd->work); | 352 | queue_work(scsi_tgtd, &tcmd->work); |
352 | } | 353 | } |
353 | 354 | ||
@@ -549,13 +550,15 @@ static int scsi_tgt_copy_sense(struct scsi_cmnd *cmd, unsigned long uaddr, | |||
549 | 550 | ||
550 | static int scsi_tgt_abort_cmd(struct Scsi_Host *shost, struct scsi_cmnd *cmd) | 551 | static int scsi_tgt_abort_cmd(struct Scsi_Host *shost, struct scsi_cmnd *cmd) |
551 | { | 552 | { |
553 | struct scsi_tgt_cmd *tcmd; | ||
552 | int err; | 554 | int err; |
553 | 555 | ||
554 | err = shost->hostt->eh_abort_handler(cmd); | 556 | err = shost->hostt->eh_abort_handler(cmd); |
555 | if (err) | 557 | if (err) |
556 | eprintk("fail to abort %p\n", cmd); | 558 | eprintk("fail to abort %p\n", cmd); |
557 | 559 | ||
558 | scsi_tgt_cmd_destroy(cmd); | 560 | tcmd = cmd->request->end_io_data; |
561 | scsi_tgt_cmd_destroy(&tcmd->work); | ||
559 | return err; | 562 | return err; |
560 | } | 563 | } |
561 | 564 | ||
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index b09bdd8c3394..9233ed5de664 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h | |||
@@ -646,6 +646,6 @@ void sas_unregister_dev(struct domain_device *); | |||
646 | 646 | ||
647 | void sas_init_dev(struct domain_device *); | 647 | void sas_init_dev(struct domain_device *); |
648 | 648 | ||
649 | void sas_task_abort(struct sas_task *task); | 649 | void sas_task_abort(struct work_struct *); |
650 | 650 | ||
651 | #endif /* _SASLIB_H_ */ | 651 | #endif /* _SASLIB_H_ */ |