Skip to content

Commit 091694a

Browse files
sswenJames Bottomley
authored andcommitted
[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 <[email protected]> Signed-off-by: Christof Schmitt <[email protected]> Signed-off-by: James Bottomley <[email protected]>
1 parent 9fb3cd8 commit 091694a

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

drivers/s390/scsi/zfcp_aux.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,12 @@ static void __init zfcp_init_device_configure(void)
129129
goto out_unit;
130130
up(&zfcp_data.config_sema);
131131
ccw_device_set_online(adapter->ccw_device);
132+
132133
zfcp_erp_wait(adapter);
134+
wait_event(adapter->erp_done_wqh,
135+
!(atomic_read(&unit->status) &
136+
ZFCP_STATUS_UNIT_SCSI_WORK_PENDING));
137+
133138
down(&zfcp_data.config_sema);
134139
zfcp_unit_put(unit);
135140
out_unit:

drivers/s390/scsi/zfcp_erp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,6 +1189,7 @@ static void zfcp_erp_scsi_scan(struct work_struct *work)
11891189
scsilun_to_int((struct scsi_lun *)&unit->fcp_lun), 0);
11901190
atomic_clear_mask(ZFCP_STATUS_UNIT_SCSI_WORK_PENDING, &unit->status);
11911191
zfcp_unit_put(unit);
1192+
wake_up(&unit->port->adapter->erp_done_wqh);
11921193
kfree(p);
11931194
}
11941195

0 commit comments

Comments
 (0)