aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2010-12-22 12:57:02 -0500
committerJiri Kosina <jkosina@suse.cz>2010-12-22 12:57:02 -0500
commit4b7bd364700d9ac8372eff48832062b936d0793b (patch)
tree0dbf78c95456a0b02d07fcd473281f04a87e266d /drivers/s390/scsi
parentc0d8768af260e2cbb4bf659ae6094a262c86b085 (diff)
parent90a8a73c06cc32b609a880d48449d7083327e11a (diff)
Merge branch 'master' into for-next
Conflicts: MAINTAINERS arch/arm/mach-omap2/pm24xx.c drivers/scsi/bfa/bfa_fcpim.c Needed to update to apply fixes for which the old branch was too outdated.
Diffstat (limited to 'drivers/s390/scsi')
-rw-r--r--drivers/s390/scsi/zfcp_erp.c11
-rw-r--r--drivers/s390/scsi/zfcp_fc.h2
-rw-r--r--drivers/s390/scsi/zfcp_fsf.c14
-rw-r--r--drivers/s390/scsi/zfcp_scsi.c5
-rw-r--r--drivers/s390/scsi/zfcp_unit.c4
5 files changed, 19 insertions, 17 deletions
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c
index d37c7331f244..0bcd5806bd9a 100644
--- a/drivers/s390/scsi/zfcp_erp.c
+++ b/drivers/s390/scsi/zfcp_erp.c
@@ -156,6 +156,8 @@ static int zfcp_erp_required_act(int want, struct zfcp_adapter *adapter,
156 if (!(a_status & ZFCP_STATUS_COMMON_RUNNING) || 156 if (!(a_status & ZFCP_STATUS_COMMON_RUNNING) ||
157 a_status & ZFCP_STATUS_COMMON_ERP_FAILED) 157 a_status & ZFCP_STATUS_COMMON_ERP_FAILED)
158 return 0; 158 return 0;
159 if (p_status & ZFCP_STATUS_COMMON_NOESC)
160 return need;
159 if (!(a_status & ZFCP_STATUS_COMMON_UNBLOCKED)) 161 if (!(a_status & ZFCP_STATUS_COMMON_UNBLOCKED))
160 need = ZFCP_ERP_ACTION_REOPEN_ADAPTER; 162 need = ZFCP_ERP_ACTION_REOPEN_ADAPTER;
161 /* fall through */ 163 /* fall through */
@@ -188,6 +190,9 @@ static struct zfcp_erp_action *zfcp_erp_setup_act(int need, u32 act_status,
188 atomic_set_mask(ZFCP_STATUS_COMMON_ERP_INUSE, 190 atomic_set_mask(ZFCP_STATUS_COMMON_ERP_INUSE,
189 &zfcp_sdev->status); 191 &zfcp_sdev->status);
190 erp_action = &zfcp_sdev->erp_action; 192 erp_action = &zfcp_sdev->erp_action;
193 memset(erp_action, 0, sizeof(struct zfcp_erp_action));
194 erp_action->port = port;
195 erp_action->sdev = sdev;
191 if (!(atomic_read(&zfcp_sdev->status) & 196 if (!(atomic_read(&zfcp_sdev->status) &
192 ZFCP_STATUS_COMMON_RUNNING)) 197 ZFCP_STATUS_COMMON_RUNNING))
193 act_status |= ZFCP_STATUS_ERP_CLOSE_ONLY; 198 act_status |= ZFCP_STATUS_ERP_CLOSE_ONLY;
@@ -200,6 +205,8 @@ static struct zfcp_erp_action *zfcp_erp_setup_act(int need, u32 act_status,
200 zfcp_erp_action_dismiss_port(port); 205 zfcp_erp_action_dismiss_port(port);
201 atomic_set_mask(ZFCP_STATUS_COMMON_ERP_INUSE, &port->status); 206 atomic_set_mask(ZFCP_STATUS_COMMON_ERP_INUSE, &port->status);
202 erp_action = &port->erp_action; 207 erp_action = &port->erp_action;
208 memset(erp_action, 0, sizeof(struct zfcp_erp_action));
209 erp_action->port = port;
203 if (!(atomic_read(&port->status) & ZFCP_STATUS_COMMON_RUNNING)) 210 if (!(atomic_read(&port->status) & ZFCP_STATUS_COMMON_RUNNING))
204 act_status |= ZFCP_STATUS_ERP_CLOSE_ONLY; 211 act_status |= ZFCP_STATUS_ERP_CLOSE_ONLY;
205 break; 212 break;
@@ -209,6 +216,7 @@ static struct zfcp_erp_action *zfcp_erp_setup_act(int need, u32 act_status,
209 zfcp_erp_action_dismiss_adapter(adapter); 216 zfcp_erp_action_dismiss_adapter(adapter);
210 atomic_set_mask(ZFCP_STATUS_COMMON_ERP_INUSE, &adapter->status); 217 atomic_set_mask(ZFCP_STATUS_COMMON_ERP_INUSE, &adapter->status);
211 erp_action = &adapter->erp_action; 218 erp_action = &adapter->erp_action;
219 memset(erp_action, 0, sizeof(struct zfcp_erp_action));
212 if (!(atomic_read(&adapter->status) & 220 if (!(atomic_read(&adapter->status) &
213 ZFCP_STATUS_COMMON_RUNNING)) 221 ZFCP_STATUS_COMMON_RUNNING))
214 act_status |= ZFCP_STATUS_ERP_CLOSE_ONLY; 222 act_status |= ZFCP_STATUS_ERP_CLOSE_ONLY;
@@ -218,10 +226,7 @@ static struct zfcp_erp_action *zfcp_erp_setup_act(int need, u32 act_status,
218 return NULL; 226 return NULL;
219 } 227 }
220 228
221 memset(erp_action, 0, sizeof(struct zfcp_erp_action));
222 erp_action->adapter = adapter; 229 erp_action->adapter = adapter;
223 erp_action->port = port;
224 erp_action->sdev = sdev;
225 erp_action->action = need; 230 erp_action->action = need;
226 erp_action->status = act_status; 231 erp_action->status = act_status;
227 232
diff --git a/drivers/s390/scsi/zfcp_fc.h b/drivers/s390/scsi/zfcp_fc.h
index 938d50360166..b464ae01086c 100644
--- a/drivers/s390/scsi/zfcp_fc.h
+++ b/drivers/s390/scsi/zfcp_fc.h
@@ -270,7 +270,7 @@ void zfcp_fc_eval_fcp_rsp(struct fcp_resp_with_ext *fcp_rsp,
270 if (unlikely(rsp_flags & FCP_SNS_LEN_VAL)) { 270 if (unlikely(rsp_flags & FCP_SNS_LEN_VAL)) {
271 sense = (char *) &fcp_rsp[1]; 271 sense = (char *) &fcp_rsp[1];
272 if (rsp_flags & FCP_RSP_LEN_VAL) 272 if (rsp_flags & FCP_RSP_LEN_VAL)
273 sense += fcp_rsp->ext.fr_sns_len; 273 sense += fcp_rsp->ext.fr_rsp_len;
274 sense_len = min(fcp_rsp->ext.fr_sns_len, 274 sense_len = min(fcp_rsp->ext.fr_sns_len,
275 (u32) SCSI_SENSE_BUFFERSIZE); 275 (u32) SCSI_SENSE_BUFFERSIZE);
276 memcpy(scsi->sense_buffer, sense, sense_len); 276 memcpy(scsi->sense_buffer, sense, sense_len);
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index beaf0916ceab..2eb7dd56ab80 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -532,9 +532,6 @@ static void zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *req)
532 fc_host_port_type(shost) = FC_PORTTYPE_UNKNOWN; 532 fc_host_port_type(shost) = FC_PORTTYPE_UNKNOWN;
533 adapter->hydra_version = 0; 533 adapter->hydra_version = 0;
534 534
535 atomic_set_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK,
536 &adapter->status);
537
538 zfcp_fsf_link_down_info_eval(req, 535 zfcp_fsf_link_down_info_eval(req,
539 &qtcb->header.fsf_status_qual.link_down_info); 536 &qtcb->header.fsf_status_qual.link_down_info);
540 break; 537 break;
@@ -854,7 +851,7 @@ struct zfcp_fsf_req *zfcp_fsf_abort_fcp_cmnd(struct scsi_cmnd *scmnd)
854 851
855 zfcp_qdio_set_sbale_last(qdio, &req->qdio_req); 852 zfcp_qdio_set_sbale_last(qdio, &req->qdio_req);
856 853
857 req->data = zfcp_sdev; 854 req->data = sdev;
858 req->handler = zfcp_fsf_abort_fcp_command_handler; 855 req->handler = zfcp_fsf_abort_fcp_command_handler;
859 req->qtcb->header.lun_handle = zfcp_sdev->lun_handle; 856 req->qtcb->header.lun_handle = zfcp_sdev->lun_handle;
860 req->qtcb->header.port_handle = zfcp_sdev->port->handle; 857 req->qtcb->header.port_handle = zfcp_sdev->port->handle;
@@ -2072,8 +2069,6 @@ static void zfcp_fsf_fcp_cmnd_handler(struct zfcp_fsf_req *req)
2072 struct fcp_resp_with_ext *fcp_rsp; 2069 struct fcp_resp_with_ext *fcp_rsp;
2073 unsigned long flags; 2070 unsigned long flags;
2074 2071
2075 zfcp_fsf_fcp_handler_common(req);
2076
2077 read_lock_irqsave(&req->adapter->abort_lock, flags); 2072 read_lock_irqsave(&req->adapter->abort_lock, flags);
2078 2073
2079 scpnt = req->data; 2074 scpnt = req->data;
@@ -2082,6 +2077,8 @@ static void zfcp_fsf_fcp_cmnd_handler(struct zfcp_fsf_req *req)
2082 return; 2077 return;
2083 } 2078 }
2084 2079
2080 zfcp_fsf_fcp_handler_common(req);
2081
2085 if (unlikely(req->status & ZFCP_STATUS_FSFREQ_ERROR)) { 2082 if (unlikely(req->status & ZFCP_STATUS_FSFREQ_ERROR)) {
2086 set_host_byte(scpnt, DID_TRANSPORT_DISRUPTED); 2083 set_host_byte(scpnt, DID_TRANSPORT_DISRUPTED);
2087 goto skip_fsfstatus; 2084 goto skip_fsfstatus;
@@ -2173,12 +2170,13 @@ int zfcp_fsf_fcp_cmnd(struct scsi_cmnd *scsi_cmnd)
2173 struct zfcp_adapter *adapter = zfcp_sdev->port->adapter; 2170 struct zfcp_adapter *adapter = zfcp_sdev->port->adapter;
2174 struct zfcp_qdio *qdio = adapter->qdio; 2171 struct zfcp_qdio *qdio = adapter->qdio;
2175 struct fsf_qtcb_bottom_io *io; 2172 struct fsf_qtcb_bottom_io *io;
2173 unsigned long flags;
2176 2174
2177 if (unlikely(!(atomic_read(&zfcp_sdev->status) & 2175 if (unlikely(!(atomic_read(&zfcp_sdev->status) &
2178 ZFCP_STATUS_COMMON_UNBLOCKED))) 2176 ZFCP_STATUS_COMMON_UNBLOCKED)))
2179 return -EBUSY; 2177 return -EBUSY;
2180 2178
2181 spin_lock(&qdio->req_q_lock); 2179 spin_lock_irqsave(&qdio->req_q_lock, flags);
2182 if (atomic_read(&qdio->req_q_free) <= 0) { 2180 if (atomic_read(&qdio->req_q_free) <= 0) {
2183 atomic_inc(&qdio->req_q_full); 2181 atomic_inc(&qdio->req_q_full);
2184 goto out; 2182 goto out;
@@ -2242,7 +2240,7 @@ failed_scsi_cmnd:
2242 zfcp_fsf_req_free(req); 2240 zfcp_fsf_req_free(req);
2243 scsi_cmnd->host_scribble = NULL; 2241 scsi_cmnd->host_scribble = NULL;
2244out: 2242out:
2245 spin_unlock(&qdio->req_q_lock); 2243 spin_unlock_irqrestore(&qdio->req_q_lock, flags);
2246 return retval; 2244 return retval;
2247} 2245}
2248 2246
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c
index 50286d8707f3..63529ed801eb 100644
--- a/drivers/s390/scsi/zfcp_scsi.c
+++ b/drivers/s390/scsi/zfcp_scsi.c
@@ -76,8 +76,8 @@ static void zfcp_scsi_command_fail(struct scsi_cmnd *scpnt, int result)
76 scpnt->scsi_done(scpnt); 76 scpnt->scsi_done(scpnt);
77} 77}
78 78
79static int zfcp_scsi_queuecommand(struct scsi_cmnd *scpnt, 79static
80 void (*done) (struct scsi_cmnd *)) 80int zfcp_scsi_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scpnt)
81{ 81{
82 struct zfcp_scsi_dev *zfcp_sdev = sdev_to_zfcp(scpnt->device); 82 struct zfcp_scsi_dev *zfcp_sdev = sdev_to_zfcp(scpnt->device);
83 struct zfcp_adapter *adapter = zfcp_sdev->port->adapter; 83 struct zfcp_adapter *adapter = zfcp_sdev->port->adapter;
@@ -87,7 +87,6 @@ static int zfcp_scsi_queuecommand(struct scsi_cmnd *scpnt,
87 /* reset the status for this request */ 87 /* reset the status for this request */
88 scpnt->result = 0; 88 scpnt->result = 0;
89 scpnt->host_scribble = NULL; 89 scpnt->host_scribble = NULL;
90 scpnt->scsi_done = done;
91 90
92 scsi_result = fc_remote_port_chkready(rport); 91 scsi_result = fc_remote_port_chkready(rport);
93 if (unlikely(scsi_result)) { 92 if (unlikely(scsi_result)) {
diff --git a/drivers/s390/scsi/zfcp_unit.c b/drivers/s390/scsi/zfcp_unit.c
index 1119c535a667..20796ebc33ce 100644
--- a/drivers/s390/scsi/zfcp_unit.c
+++ b/drivers/s390/scsi/zfcp_unit.c
@@ -142,6 +142,8 @@ int zfcp_unit_add(struct zfcp_port *port, u64 fcp_lun)
142 return -ENOMEM; 142 return -ENOMEM;
143 } 143 }
144 144
145 get_device(&port->dev);
146
145 if (device_register(&unit->dev)) { 147 if (device_register(&unit->dev)) {
146 put_device(&unit->dev); 148 put_device(&unit->dev);
147 return -ENOMEM; 149 return -ENOMEM;
@@ -152,8 +154,6 @@ int zfcp_unit_add(struct zfcp_port *port, u64 fcp_lun)
152 return -EINVAL; 154 return -EINVAL;
153 } 155 }
154 156
155 get_device(&port->dev);
156
157 write_lock_irq(&port->unit_list_lock); 157 write_lock_irq(&port->unit_list_lock);
158 list_add_tail(&unit->list, &port->unit_list); 158 list_add_tail(&unit->list, &port->unit_list);
159 write_unlock_irq(&port->unit_list_lock); 159 write_unlock_irq(&port->unit_list_lock);