aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_aux.c
diff options
context:
space:
mode:
authorSwen Schillig <swen@vnet.ibm.com>2008-10-01 12:42:25 +0200
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-10-03 12:11:56 -0500
commit091694a556d168dc9df4d79e3a40116550b183cf (patch)
treed682fea39421269f67287e5dee5c6048247f08dc /drivers/s390/scsi/zfcp_aux.c
parent[SCSI] zfcp: fix erp list usage without using locks (diff)
downloadlinux-dev-091694a556d168dc9df4d79e3a40116550b183cf.tar.xz
linux-dev-091694a556d168dc9df4d79e3a40116550b183cf.zip
[SCSI] zfcp: wait on SCSI work to be finished before proceeding with init dev
Due to the character of a scheduled work we cannot guarantee the LUN register to be finished before an initial device tries to use it. Therefor we have to wait for PENDING_SCSI_WORK flag to be cleared before proceeding. 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_aux.c')
-rw-r--r--drivers/s390/scsi/zfcp_aux.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c
index 05f3de64f6a3..24255e42dc30 100644
--- a/drivers/s390/scsi/zfcp_aux.c
+++ b/drivers/s390/scsi/zfcp_aux.c
@@ -129,7 +129,12 @@ static void __init zfcp_init_device_configure(void)
goto out_unit;
up(&zfcp_data.config_sema);
ccw_device_set_online(adapter->ccw_device);
+
zfcp_erp_wait(adapter);
+ wait_event(adapter->erp_done_wqh,
+ !(atomic_read(&unit->status) &
+ ZFCP_STATUS_UNIT_SCSI_WORK_PENDING));
+
down(&zfcp_data.config_sema);
zfcp_unit_put(unit);
out_unit: