diff options
author | Swen Schillig <swen@vnet.ibm.com> | 2009-04-17 09:08:04 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-04-27 11:07:26 -0400 |
commit | 92d5193b467c68e8432d6878980621c787e735af (patch) | |
tree | f38286d32216e23adfd4f8a8dc0e8ef152cd4de4 /drivers/s390/scsi/zfcp_scsi.c | |
parent | ada81b748b768eb5b75567fd1db5e87ba5c98bf0 (diff) |
[SCSI] zfcp: Dont block zfcp_wq with scan
When running the scsi_scan from the zfcp workqueue and the target
device does not respond, the zfcp workqueue can block until the
scsi_scan hits a timeout. Move the work to the scsi host workqueue,
since this one is also used for the scan from the SCSI midlayer.
Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/s390/scsi/zfcp_scsi.c')
-rw-r--r-- | drivers/s390/scsi/zfcp_scsi.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c index 58201e1ae478..5b11386d70bb 100644 --- a/drivers/s390/scsi/zfcp_scsi.c +++ b/drivers/s390/scsi/zfcp_scsi.c | |||
@@ -583,6 +583,23 @@ void zfcp_scsi_rport_work(struct work_struct *work) | |||
583 | } | 583 | } |
584 | 584 | ||
585 | 585 | ||
586 | void zfcp_scsi_scan(struct work_struct *work) | ||
587 | { | ||
588 | struct zfcp_unit *unit = container_of(work, struct zfcp_unit, | ||
589 | scsi_work); | ||
590 | struct fc_rport *rport; | ||
591 | |||
592 | flush_work(&unit->port->rport_work); | ||
593 | rport = unit->port->rport; | ||
594 | |||
595 | if (rport && rport->port_state == FC_PORTSTATE_ONLINE) | ||
596 | scsi_scan_target(&rport->dev, 0, rport->scsi_target_id, | ||
597 | scsilun_to_int((struct scsi_lun *) | ||
598 | &unit->fcp_lun), 0); | ||
599 | |||
600 | zfcp_unit_put(unit); | ||
601 | } | ||
602 | |||
586 | struct fc_function_template zfcp_transport_functions = { | 603 | struct fc_function_template zfcp_transport_functions = { |
587 | .show_starget_port_id = 1, | 604 | .show_starget_port_id = 1, |
588 | .show_starget_port_name = 1, | 605 | .show_starget_port_name = 1, |