diff options
Diffstat (limited to 'drivers/s390/scsi/zfcp_scsi.c')
-rw-r--r-- | drivers/s390/scsi/zfcp_scsi.c | 38 |
1 files changed, 14 insertions, 24 deletions
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c index 8e6fc68d6bd4..c3c4178888af 100644 --- a/drivers/s390/scsi/zfcp_scsi.c +++ b/drivers/s390/scsi/zfcp_scsi.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Interface to Linux SCSI midlayer. | 4 | * Interface to Linux SCSI midlayer. |
5 | * | 5 | * |
6 | * Copyright IBM Corporation 2002, 2009 | 6 | * Copyright IBM Corporation 2002, 2010 |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #define KMSG_COMPONENT "zfcp" | 9 | #define KMSG_COMPONENT "zfcp" |
@@ -15,6 +15,7 @@ | |||
15 | #include "zfcp_ext.h" | 15 | #include "zfcp_ext.h" |
16 | #include "zfcp_dbf.h" | 16 | #include "zfcp_dbf.h" |
17 | #include "zfcp_fc.h" | 17 | #include "zfcp_fc.h" |
18 | #include "zfcp_reqlist.h" | ||
18 | 19 | ||
19 | static unsigned int default_depth = 32; | 20 | static unsigned int default_depth = 32; |
20 | module_param_named(queue_depth, default_depth, uint, 0600); | 21 | module_param_named(queue_depth, default_depth, uint, 0600); |
@@ -43,7 +44,7 @@ static void zfcp_scsi_slave_destroy(struct scsi_device *sdpnt) | |||
43 | { | 44 | { |
44 | struct zfcp_unit *unit = (struct zfcp_unit *) sdpnt->hostdata; | 45 | struct zfcp_unit *unit = (struct zfcp_unit *) sdpnt->hostdata; |
45 | unit->device = NULL; | 46 | unit->device = NULL; |
46 | put_device(&unit->sysfs_device); | 47 | put_device(&unit->dev); |
47 | } | 48 | } |
48 | 49 | ||
49 | static int zfcp_scsi_slave_configure(struct scsi_device *sdp) | 50 | static int zfcp_scsi_slave_configure(struct scsi_device *sdp) |
@@ -59,10 +60,9 @@ static void zfcp_scsi_command_fail(struct scsi_cmnd *scpnt, int result) | |||
59 | { | 60 | { |
60 | struct zfcp_adapter *adapter = | 61 | struct zfcp_adapter *adapter = |
61 | (struct zfcp_adapter *) scpnt->device->host->hostdata[0]; | 62 | (struct zfcp_adapter *) scpnt->device->host->hostdata[0]; |
63 | |||
62 | set_host_byte(scpnt, result); | 64 | set_host_byte(scpnt, result); |
63 | if ((scpnt->device != NULL) && (scpnt->device->host != NULL)) | 65 | zfcp_dbf_scsi_fail_send(adapter->dbf, scpnt); |
64 | zfcp_dbf_scsi_result("fail", 4, adapter->dbf, scpnt, NULL); | ||
65 | /* return directly */ | ||
66 | scpnt->scsi_done(scpnt); | 66 | scpnt->scsi_done(scpnt); |
67 | } | 67 | } |
68 | 68 | ||
@@ -86,18 +86,10 @@ static int zfcp_scsi_queuecommand(struct scsi_cmnd *scpnt, | |||
86 | adapter = (struct zfcp_adapter *) scpnt->device->host->hostdata[0]; | 86 | adapter = (struct zfcp_adapter *) scpnt->device->host->hostdata[0]; |
87 | unit = scpnt->device->hostdata; | 87 | unit = scpnt->device->hostdata; |
88 | 88 | ||
89 | BUG_ON(!adapter || (adapter != unit->port->adapter)); | ||
90 | BUG_ON(!scpnt->scsi_done); | ||
91 | |||
92 | if (unlikely(!unit)) { | ||
93 | zfcp_scsi_command_fail(scpnt, DID_NO_CONNECT); | ||
94 | return 0; | ||
95 | } | ||
96 | |||
97 | scsi_result = fc_remote_port_chkready(rport); | 89 | scsi_result = fc_remote_port_chkready(rport); |
98 | if (unlikely(scsi_result)) { | 90 | if (unlikely(scsi_result)) { |
99 | scpnt->result = scsi_result; | 91 | scpnt->result = scsi_result; |
100 | zfcp_dbf_scsi_result("fail", 4, adapter->dbf, scpnt, NULL); | 92 | zfcp_dbf_scsi_fail_send(adapter->dbf, scpnt); |
101 | scpnt->scsi_done(scpnt); | 93 | scpnt->scsi_done(scpnt); |
102 | return 0; | 94 | return 0; |
103 | } | 95 | } |
@@ -189,9 +181,7 @@ static int zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt) | |||
189 | /* avoid race condition between late normal completion and abort */ | 181 | /* avoid race condition between late normal completion and abort */ |
190 | write_lock_irqsave(&adapter->abort_lock, flags); | 182 | write_lock_irqsave(&adapter->abort_lock, flags); |
191 | 183 | ||
192 | spin_lock(&adapter->req_list_lock); | 184 | old_req = zfcp_reqlist_find(adapter->req_list, old_reqid); |
193 | old_req = zfcp_reqlist_find(adapter, old_reqid); | ||
194 | spin_unlock(&adapter->req_list_lock); | ||
195 | if (!old_req) { | 185 | if (!old_req) { |
196 | write_unlock_irqrestore(&adapter->abort_lock, flags); | 186 | write_unlock_irqrestore(&adapter->abort_lock, flags); |
197 | zfcp_dbf_scsi_abort("lte1", adapter->dbf, scpnt, NULL, | 187 | zfcp_dbf_scsi_abort("lte1", adapter->dbf, scpnt, NULL, |
@@ -521,7 +511,7 @@ static void zfcp_scsi_terminate_rport_io(struct fc_rport *rport) | |||
521 | 511 | ||
522 | if (port) { | 512 | if (port) { |
523 | zfcp_erp_port_reopen(port, 0, "sctrpi1", NULL); | 513 | zfcp_erp_port_reopen(port, 0, "sctrpi1", NULL); |
524 | put_device(&port->sysfs_device); | 514 | put_device(&port->dev); |
525 | } | 515 | } |
526 | } | 516 | } |
527 | 517 | ||
@@ -563,23 +553,23 @@ static void zfcp_scsi_rport_block(struct zfcp_port *port) | |||
563 | 553 | ||
564 | void zfcp_scsi_schedule_rport_register(struct zfcp_port *port) | 554 | void zfcp_scsi_schedule_rport_register(struct zfcp_port *port) |
565 | { | 555 | { |
566 | get_device(&port->sysfs_device); | 556 | get_device(&port->dev); |
567 | port->rport_task = RPORT_ADD; | 557 | port->rport_task = RPORT_ADD; |
568 | 558 | ||
569 | if (!queue_work(port->adapter->work_queue, &port->rport_work)) | 559 | if (!queue_work(port->adapter->work_queue, &port->rport_work)) |
570 | put_device(&port->sysfs_device); | 560 | put_device(&port->dev); |
571 | } | 561 | } |
572 | 562 | ||
573 | void zfcp_scsi_schedule_rport_block(struct zfcp_port *port) | 563 | void zfcp_scsi_schedule_rport_block(struct zfcp_port *port) |
574 | { | 564 | { |
575 | get_device(&port->sysfs_device); | 565 | get_device(&port->dev); |
576 | port->rport_task = RPORT_DEL; | 566 | port->rport_task = RPORT_DEL; |
577 | 567 | ||
578 | if (port->rport && queue_work(port->adapter->work_queue, | 568 | if (port->rport && queue_work(port->adapter->work_queue, |
579 | &port->rport_work)) | 569 | &port->rport_work)) |
580 | return; | 570 | return; |
581 | 571 | ||
582 | put_device(&port->sysfs_device); | 572 | put_device(&port->dev); |
583 | } | 573 | } |
584 | 574 | ||
585 | void zfcp_scsi_schedule_rports_block(struct zfcp_adapter *adapter) | 575 | void zfcp_scsi_schedule_rports_block(struct zfcp_adapter *adapter) |
@@ -608,7 +598,7 @@ void zfcp_scsi_rport_work(struct work_struct *work) | |||
608 | } | 598 | } |
609 | } | 599 | } |
610 | 600 | ||
611 | put_device(&port->sysfs_device); | 601 | put_device(&port->dev); |
612 | } | 602 | } |
613 | 603 | ||
614 | 604 | ||
@@ -626,7 +616,7 @@ void zfcp_scsi_scan(struct work_struct *work) | |||
626 | scsilun_to_int((struct scsi_lun *) | 616 | scsilun_to_int((struct scsi_lun *) |
627 | &unit->fcp_lun), 0); | 617 | &unit->fcp_lun), 0); |
628 | 618 | ||
629 | put_device(&unit->sysfs_device); | 619 | put_device(&unit->dev); |
630 | } | 620 | } |
631 | 621 | ||
632 | struct fc_function_template zfcp_transport_functions = { | 622 | struct fc_function_template zfcp_transport_functions = { |