aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSwen Schillig <swen@vnet.ibm.com>2008-10-01 06:42:25 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-10-03 13:11:56 -0400
commit091694a556d168dc9df4d79e3a40116550b183cf (patch)
treed682fea39421269f67287e5dee5c6048247f08dc
parent9fb3cd86e4870d54d71a80323e97c48df4de05bd (diff)
[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>
-rw-r--r--drivers/s390/scsi/zfcp_aux.c5
-rw-r--r--drivers/s390/scsi/zfcp_erp.c1
2 files changed, 6 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)
129 goto out_unit; 129 goto out_unit;
130 up(&zfcp_data.config_sema); 130 up(&zfcp_data.config_sema);
131 ccw_device_set_online(adapter->ccw_device); 131 ccw_device_set_online(adapter->ccw_device);
132
132 zfcp_erp_wait(adapter); 133 zfcp_erp_wait(adapter);
134 wait_event(adapter->erp_done_wqh,
135 !(atomic_read(&unit->status) &
136 ZFCP_STATUS_UNIT_SCSI_WORK_PENDING));
137
133 down(&zfcp_data.config_sema); 138 down(&zfcp_data.config_sema);
134 zfcp_unit_put(unit); 139 zfcp_unit_put(unit);
135out_unit: 140out_unit:
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c
index 4539530768a2..26049c663438 100644
--- a/drivers/s390/scsi/zfcp_erp.c
+++ b/drivers/s390/scsi/zfcp_erp.c
@@ -1189,6 +1189,7 @@ static void zfcp_erp_scsi_scan(struct work_struct *work)
1189 scsilun_to_int((struct scsi_lun *)&unit->fcp_lun), 0); 1189 scsilun_to_int((struct scsi_lun *)&unit->fcp_lun), 0);
1190 atomic_clear_mask(ZFCP_STATUS_UNIT_SCSI_WORK_PENDING, &unit->status); 1190 atomic_clear_mask(ZFCP_STATUS_UNIT_SCSI_WORK_PENDING, &unit->status);
1191 zfcp_unit_put(unit); 1191 zfcp_unit_put(unit);
1192 wake_up(&unit->port->adapter->erp_done_wqh);
1192 kfree(p); 1193 kfree(p);
1193} 1194}
1194 1195