diff options
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/scsi/zfcp_erp.c | 7 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_fc.c | 7 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_fsf.c | 20 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_scsi.c | 2 |
4 files changed, 23 insertions, 13 deletions
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index 35364f64da7f..c557ba34e1aa 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c | |||
@@ -720,7 +720,6 @@ static int zfcp_erp_adapter_strategy_generic(struct zfcp_erp_action *act, | |||
720 | goto failed_openfcp; | 720 | goto failed_openfcp; |
721 | 721 | ||
722 | atomic_set_mask(ZFCP_STATUS_COMMON_OPEN, &act->adapter->status); | 722 | atomic_set_mask(ZFCP_STATUS_COMMON_OPEN, &act->adapter->status); |
723 | schedule_work(&act->adapter->scan_work); | ||
724 | 723 | ||
725 | return ZFCP_ERP_SUCCEEDED; | 724 | return ZFCP_ERP_SUCCEEDED; |
726 | 725 | ||
@@ -1186,7 +1185,9 @@ static void zfcp_erp_scsi_scan(struct work_struct *work) | |||
1186 | container_of(work, struct zfcp_erp_add_work, work); | 1185 | container_of(work, struct zfcp_erp_add_work, work); |
1187 | struct zfcp_unit *unit = p->unit; | 1186 | struct zfcp_unit *unit = p->unit; |
1188 | struct fc_rport *rport = unit->port->rport; | 1187 | struct fc_rport *rport = unit->port->rport; |
1189 | scsi_scan_target(&rport->dev, 0, rport->scsi_target_id, | 1188 | |
1189 | if (rport && rport->port_state == FC_PORTSTATE_ONLINE) | ||
1190 | scsi_scan_target(&rport->dev, 0, rport->scsi_target_id, | ||
1190 | scsilun_to_int((struct scsi_lun *)&unit->fcp_lun), 0); | 1191 | scsilun_to_int((struct scsi_lun *)&unit->fcp_lun), 0); |
1191 | atomic_clear_mask(ZFCP_STATUS_UNIT_SCSI_WORK_PENDING, &unit->status); | 1192 | atomic_clear_mask(ZFCP_STATUS_UNIT_SCSI_WORK_PENDING, &unit->status); |
1192 | zfcp_unit_put(unit); | 1193 | zfcp_unit_put(unit); |
@@ -1282,6 +1283,8 @@ static void zfcp_erp_action_cleanup(struct zfcp_erp_action *act, int result) | |||
1282 | case ZFCP_ERP_ACTION_REOPEN_ADAPTER: | 1283 | case ZFCP_ERP_ACTION_REOPEN_ADAPTER: |
1283 | if (result != ZFCP_ERP_SUCCEEDED) | 1284 | if (result != ZFCP_ERP_SUCCEEDED) |
1284 | zfcp_erp_rports_del(adapter); | 1285 | zfcp_erp_rports_del(adapter); |
1286 | else | ||
1287 | schedule_work(&adapter->scan_work); | ||
1285 | zfcp_adapter_put(adapter); | 1288 | zfcp_adapter_put(adapter); |
1286 | break; | 1289 | break; |
1287 | } | 1290 | } |
diff --git a/drivers/s390/scsi/zfcp_fc.c b/drivers/s390/scsi/zfcp_fc.c index 1a7c80a77ff5..8aab3091a7b1 100644 --- a/drivers/s390/scsi/zfcp_fc.c +++ b/drivers/s390/scsi/zfcp_fc.c | |||
@@ -50,7 +50,8 @@ static int zfcp_wka_port_get(struct zfcp_wka_port *wka_port) | |||
50 | if (mutex_lock_interruptible(&wka_port->mutex)) | 50 | if (mutex_lock_interruptible(&wka_port->mutex)) |
51 | return -ERESTARTSYS; | 51 | return -ERESTARTSYS; |
52 | 52 | ||
53 | if (wka_port->status != ZFCP_WKA_PORT_ONLINE) { | 53 | if (wka_port->status == ZFCP_WKA_PORT_OFFLINE || |
54 | wka_port->status == ZFCP_WKA_PORT_CLOSING) { | ||
54 | wka_port->status = ZFCP_WKA_PORT_OPENING; | 55 | wka_port->status = ZFCP_WKA_PORT_OPENING; |
55 | if (zfcp_fsf_open_wka_port(wka_port)) | 56 | if (zfcp_fsf_open_wka_port(wka_port)) |
56 | wka_port->status = ZFCP_WKA_PORT_OFFLINE; | 57 | wka_port->status = ZFCP_WKA_PORT_OFFLINE; |
@@ -125,8 +126,7 @@ static void _zfcp_fc_incoming_rscn(struct zfcp_fsf_req *fsf_req, u32 range, | |||
125 | 126 | ||
126 | read_lock_irqsave(&zfcp_data.config_lock, flags); | 127 | read_lock_irqsave(&zfcp_data.config_lock, flags); |
127 | list_for_each_entry(port, &fsf_req->adapter->port_list_head, list) { | 128 | list_for_each_entry(port, &fsf_req->adapter->port_list_head, list) { |
128 | /* FIXME: ZFCP_STATUS_PORT_DID_DID check is racy */ | 129 | if (!(atomic_read(&port->status) & ZFCP_STATUS_PORT_PHYS_OPEN)) |
129 | if (!(atomic_read(&port->status) & ZFCP_STATUS_PORT_DID_DID)) | ||
130 | /* Try to connect to unused ports anyway. */ | 130 | /* Try to connect to unused ports anyway. */ |
131 | zfcp_erp_port_reopen(port, | 131 | zfcp_erp_port_reopen(port, |
132 | ZFCP_STATUS_COMMON_ERP_FAILED, | 132 | ZFCP_STATUS_COMMON_ERP_FAILED, |
@@ -610,7 +610,6 @@ int zfcp_scan_ports(struct zfcp_adapter *adapter) | |||
610 | int ret, i; | 610 | int ret, i; |
611 | struct zfcp_gpn_ft *gpn_ft; | 611 | struct zfcp_gpn_ft *gpn_ft; |
612 | 612 | ||
613 | zfcp_erp_wait(adapter); /* wait until adapter is finished with ERP */ | ||
614 | if (fc_host_port_type(adapter->scsi_host) != FC_PORTTYPE_NPORT) | 613 | if (fc_host_port_type(adapter->scsi_host) != FC_PORTTYPE_NPORT) |
615 | return 0; | 614 | return 0; |
616 | 615 | ||
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index d024442ee128..dc0367690405 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c | |||
@@ -930,8 +930,10 @@ struct zfcp_fsf_req *zfcp_fsf_abort_fcp_command(unsigned long old_req_id, | |||
930 | goto out; | 930 | goto out; |
931 | req = zfcp_fsf_req_create(adapter, FSF_QTCB_ABORT_FCP_CMND, | 931 | req = zfcp_fsf_req_create(adapter, FSF_QTCB_ABORT_FCP_CMND, |
932 | req_flags, adapter->pool.fsf_req_abort); | 932 | req_flags, adapter->pool.fsf_req_abort); |
933 | if (IS_ERR(req)) | 933 | if (IS_ERR(req)) { |
934 | req = NULL; | ||
934 | goto out; | 935 | goto out; |
936 | } | ||
935 | 937 | ||
936 | if (unlikely(!(atomic_read(&unit->status) & | 938 | if (unlikely(!(atomic_read(&unit->status) & |
937 | ZFCP_STATUS_COMMON_UNBLOCKED))) | 939 | ZFCP_STATUS_COMMON_UNBLOCKED))) |
@@ -1584,6 +1586,7 @@ static void zfcp_fsf_open_wka_port_handler(struct zfcp_fsf_req *req) | |||
1584 | wka_port->status = ZFCP_WKA_PORT_OFFLINE; | 1586 | wka_port->status = ZFCP_WKA_PORT_OFFLINE; |
1585 | break; | 1587 | break; |
1586 | case FSF_PORT_ALREADY_OPEN: | 1588 | case FSF_PORT_ALREADY_OPEN: |
1589 | break; | ||
1587 | case FSF_GOOD: | 1590 | case FSF_GOOD: |
1588 | wka_port->handle = header->port_handle; | 1591 | wka_port->handle = header->port_handle; |
1589 | wka_port->status = ZFCP_WKA_PORT_ONLINE; | 1592 | wka_port->status = ZFCP_WKA_PORT_ONLINE; |
@@ -2113,18 +2116,21 @@ static inline void zfcp_fsf_trace_latency(struct zfcp_fsf_req *fsf_req) | |||
2113 | 2116 | ||
2114 | static void zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *req) | 2117 | static void zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *req) |
2115 | { | 2118 | { |
2116 | struct scsi_cmnd *scpnt = req->data; | 2119 | struct scsi_cmnd *scpnt; |
2117 | struct fcp_rsp_iu *fcp_rsp_iu = (struct fcp_rsp_iu *) | 2120 | struct fcp_rsp_iu *fcp_rsp_iu = (struct fcp_rsp_iu *) |
2118 | &(req->qtcb->bottom.io.fcp_rsp); | 2121 | &(req->qtcb->bottom.io.fcp_rsp); |
2119 | u32 sns_len; | 2122 | u32 sns_len; |
2120 | char *fcp_rsp_info = (unsigned char *) &fcp_rsp_iu[1]; | 2123 | char *fcp_rsp_info = (unsigned char *) &fcp_rsp_iu[1]; |
2121 | unsigned long flags; | 2124 | unsigned long flags; |
2122 | 2125 | ||
2123 | if (unlikely(!scpnt)) | ||
2124 | return; | ||
2125 | |||
2126 | read_lock_irqsave(&req->adapter->abort_lock, flags); | 2126 | read_lock_irqsave(&req->adapter->abort_lock, flags); |
2127 | 2127 | ||
2128 | scpnt = req->data; | ||
2129 | if (unlikely(!scpnt)) { | ||
2130 | read_unlock_irqrestore(&req->adapter->abort_lock, flags); | ||
2131 | return; | ||
2132 | } | ||
2133 | |||
2128 | if (unlikely(req->status & ZFCP_STATUS_FSFREQ_ABORTED)) { | 2134 | if (unlikely(req->status & ZFCP_STATUS_FSFREQ_ABORTED)) { |
2129 | set_host_byte(scpnt, DID_SOFT_ERROR); | 2135 | set_host_byte(scpnt, DID_SOFT_ERROR); |
2130 | set_driver_byte(scpnt, SUGGEST_RETRY); | 2136 | set_driver_byte(scpnt, SUGGEST_RETRY); |
@@ -2442,8 +2448,10 @@ struct zfcp_fsf_req *zfcp_fsf_send_fcp_ctm(struct zfcp_adapter *adapter, | |||
2442 | goto out; | 2448 | goto out; |
2443 | req = zfcp_fsf_req_create(adapter, FSF_QTCB_FCP_CMND, req_flags, | 2449 | req = zfcp_fsf_req_create(adapter, FSF_QTCB_FCP_CMND, req_flags, |
2444 | adapter->pool.fsf_req_scsi); | 2450 | adapter->pool.fsf_req_scsi); |
2445 | if (IS_ERR(req)) | 2451 | if (IS_ERR(req)) { |
2452 | req = NULL; | ||
2446 | goto out; | 2453 | goto out; |
2454 | } | ||
2447 | 2455 | ||
2448 | req->status |= ZFCP_STATUS_FSFREQ_TASK_MANAGEMENT; | 2456 | req->status |= ZFCP_STATUS_FSFREQ_TASK_MANAGEMENT; |
2449 | req->data = unit; | 2457 | req->data = unit; |
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c index e46fd3e9f68f..468c880f8b6d 100644 --- a/drivers/s390/scsi/zfcp_scsi.c +++ b/drivers/s390/scsi/zfcp_scsi.c | |||
@@ -88,7 +88,7 @@ static int zfcp_scsi_queuecommand(struct scsi_cmnd *scpnt, | |||
88 | ret = zfcp_fsf_send_fcp_command_task(adapter, unit, scpnt, 0, | 88 | ret = zfcp_fsf_send_fcp_command_task(adapter, unit, scpnt, 0, |
89 | ZFCP_REQ_AUTO_CLEANUP); | 89 | ZFCP_REQ_AUTO_CLEANUP); |
90 | if (unlikely(ret == -EBUSY)) | 90 | if (unlikely(ret == -EBUSY)) |
91 | zfcp_scsi_command_fail(scpnt, DID_NO_CONNECT); | 91 | return SCSI_MLQUEUE_DEVICE_BUSY; |
92 | else if (unlikely(ret < 0)) | 92 | else if (unlikely(ret < 0)) |
93 | return SCSI_MLQUEUE_HOST_BUSY; | 93 | return SCSI_MLQUEUE_HOST_BUSY; |
94 | 94 | ||