diff options
Diffstat (limited to 'drivers/s390/scsi/zfcp_scsi.c')
-rw-r--r-- | drivers/s390/scsi/zfcp_scsi.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c index e0803757c0fa..9e6d07d7b3c8 100644 --- a/drivers/s390/scsi/zfcp_scsi.c +++ b/drivers/s390/scsi/zfcp_scsi.c | |||
@@ -68,7 +68,7 @@ struct zfcp_data zfcp_data = { | |||
68 | eh_host_reset_handler: zfcp_scsi_eh_host_reset_handler, | 68 | eh_host_reset_handler: zfcp_scsi_eh_host_reset_handler, |
69 | /* FIXME(openfcp): Tune */ | 69 | /* FIXME(openfcp): Tune */ |
70 | can_queue: 4096, | 70 | can_queue: 4096, |
71 | this_id: 0, | 71 | this_id: -1, |
72 | /* | 72 | /* |
73 | * FIXME: | 73 | * FIXME: |
74 | * one less? can zfcp_create_sbale cope with it? | 74 | * one less? can zfcp_create_sbale cope with it? |
@@ -183,7 +183,8 @@ zfcp_scsi_slave_alloc(struct scsi_device *sdp) | |||
183 | 183 | ||
184 | read_lock_irqsave(&zfcp_data.config_lock, flags); | 184 | read_lock_irqsave(&zfcp_data.config_lock, flags); |
185 | unit = zfcp_unit_lookup(adapter, sdp->channel, sdp->id, sdp->lun); | 185 | unit = zfcp_unit_lookup(adapter, sdp->channel, sdp->id, sdp->lun); |
186 | if (unit) { | 186 | if (unit && atomic_test_mask(ZFCP_STATUS_UNIT_REGISTERED, |
187 | &unit->status)) { | ||
187 | sdp->hostdata = unit; | 188 | sdp->hostdata = unit; |
188 | unit->device = sdp; | 189 | unit->device = sdp; |
189 | zfcp_unit_get(unit); | 190 | zfcp_unit_get(unit); |
@@ -208,6 +209,7 @@ zfcp_scsi_slave_destroy(struct scsi_device *sdpnt) | |||
208 | struct zfcp_unit *unit = (struct zfcp_unit *) sdpnt->hostdata; | 209 | struct zfcp_unit *unit = (struct zfcp_unit *) sdpnt->hostdata; |
209 | 210 | ||
210 | if (unit) { | 211 | if (unit) { |
212 | atomic_clear_mask(ZFCP_STATUS_UNIT_REGISTERED, &unit->status); | ||
211 | sdpnt->hostdata = NULL; | 213 | sdpnt->hostdata = NULL; |
212 | unit->device = NULL; | 214 | unit->device = NULL; |
213 | zfcp_unit_put(unit); | 215 | zfcp_unit_put(unit); |
@@ -242,7 +244,7 @@ zfcp_scsi_command_fail(struct scsi_cmnd *scpnt, int result) | |||
242 | if ((scpnt->device != NULL) && (scpnt->device->host != NULL)) | 244 | if ((scpnt->device != NULL) && (scpnt->device->host != NULL)) |
243 | zfcp_scsi_dbf_event_result("fail", 4, | 245 | zfcp_scsi_dbf_event_result("fail", 4, |
244 | (struct zfcp_adapter*) scpnt->device->host->hostdata[0], | 246 | (struct zfcp_adapter*) scpnt->device->host->hostdata[0], |
245 | scpnt); | 247 | scpnt, NULL); |
246 | /* return directly */ | 248 | /* return directly */ |
247 | scpnt->scsi_done(scpnt); | 249 | scpnt->scsi_done(scpnt); |
248 | } | 250 | } |
@@ -291,7 +293,7 @@ zfcp_scsi_command_async(struct zfcp_adapter *adapter, struct zfcp_unit *unit, | |||
291 | "on port 0x%016Lx in recovery\n", | 293 | "on port 0x%016Lx in recovery\n", |
292 | zfcp_get_busid_by_unit(unit), | 294 | zfcp_get_busid_by_unit(unit), |
293 | unit->fcp_lun, unit->port->wwpn); | 295 | unit->fcp_lun, unit->port->wwpn); |
294 | retval = SCSI_MLQUEUE_DEVICE_BUSY; | 296 | zfcp_scsi_command_fail(scpnt, DID_NO_CONNECT); |
295 | goto out; | 297 | goto out; |
296 | } | 298 | } |
297 | 299 | ||
@@ -446,7 +448,7 @@ zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt) | |||
446 | old_fsf_req = (struct zfcp_fsf_req *) scpnt->host_scribble; | 448 | old_fsf_req = (struct zfcp_fsf_req *) scpnt->host_scribble; |
447 | if (!old_fsf_req) { | 449 | if (!old_fsf_req) { |
448 | write_unlock_irqrestore(&adapter->abort_lock, flags); | 450 | write_unlock_irqrestore(&adapter->abort_lock, flags); |
449 | zfcp_scsi_dbf_event_abort("lte1", adapter, scpnt, new_fsf_req); | 451 | zfcp_scsi_dbf_event_abort("lte1", adapter, scpnt, NULL, NULL); |
450 | retval = SUCCESS; | 452 | retval = SUCCESS; |
451 | goto out; | 453 | goto out; |
452 | } | 454 | } |
@@ -460,6 +462,8 @@ zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt) | |||
460 | adapter, unit, 0); | 462 | adapter, unit, 0); |
461 | if (!new_fsf_req) { | 463 | if (!new_fsf_req) { |
462 | ZFCP_LOG_INFO("error: initiation of Abort FCP Cmnd failed\n"); | 464 | ZFCP_LOG_INFO("error: initiation of Abort FCP Cmnd failed\n"); |
465 | zfcp_scsi_dbf_event_abort("nres", adapter, scpnt, NULL, | ||
466 | old_fsf_req); | ||
463 | retval = FAILED; | 467 | retval = FAILED; |
464 | goto out; | 468 | goto out; |
465 | } | 469 | } |
@@ -470,13 +474,16 @@ zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt) | |||
470 | 474 | ||
471 | /* status should be valid since signals were not permitted */ | 475 | /* status should be valid since signals were not permitted */ |
472 | if (new_fsf_req->status & ZFCP_STATUS_FSFREQ_ABORTSUCCEEDED) { | 476 | if (new_fsf_req->status & ZFCP_STATUS_FSFREQ_ABORTSUCCEEDED) { |
473 | zfcp_scsi_dbf_event_abort("okay", adapter, scpnt, new_fsf_req); | 477 | zfcp_scsi_dbf_event_abort("okay", adapter, scpnt, new_fsf_req, |
478 | NULL); | ||
474 | retval = SUCCESS; | 479 | retval = SUCCESS; |
475 | } else if (new_fsf_req->status & ZFCP_STATUS_FSFREQ_ABORTNOTNEEDED) { | 480 | } else if (new_fsf_req->status & ZFCP_STATUS_FSFREQ_ABORTNOTNEEDED) { |
476 | zfcp_scsi_dbf_event_abort("lte2", adapter, scpnt, new_fsf_req); | 481 | zfcp_scsi_dbf_event_abort("lte2", adapter, scpnt, new_fsf_req, |
482 | NULL); | ||
477 | retval = SUCCESS; | 483 | retval = SUCCESS; |
478 | } else { | 484 | } else { |
479 | zfcp_scsi_dbf_event_abort("fail", adapter, scpnt, new_fsf_req); | 485 | zfcp_scsi_dbf_event_abort("fail", adapter, scpnt, new_fsf_req, |
486 | NULL); | ||
480 | retval = FAILED; | 487 | retval = FAILED; |
481 | } | 488 | } |
482 | zfcp_fsf_req_free(new_fsf_req); | 489 | zfcp_fsf_req_free(new_fsf_req); |