aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/s390/scsi/zfcp_erp.c8
-rw-r--r--drivers/s390/scsi/zfcp_fsf.c10
-rw-r--r--drivers/s390/scsi/zfcp_qdio.c10
-rw-r--r--drivers/scsi/ibmvscsi/rpa_vscsi.c13
-rw-r--r--drivers/scsi/ipr.c51
-rw-r--r--drivers/scsi/ipr.h5
6 files changed, 63 insertions, 34 deletions
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c
index e3dbeda97179..fd068bc1bd0a 100644
--- a/drivers/s390/scsi/zfcp_erp.c
+++ b/drivers/s390/scsi/zfcp_erp.c
@@ -714,6 +714,14 @@ static int zfcp_erp_adapter_strategy_open_fsf(struct zfcp_erp_action *act)
714 if (zfcp_erp_adapter_strategy_open_fsf_xport(act) == ZFCP_ERP_FAILED) 714 if (zfcp_erp_adapter_strategy_open_fsf_xport(act) == ZFCP_ERP_FAILED)
715 return ZFCP_ERP_FAILED; 715 return ZFCP_ERP_FAILED;
716 716
717 if (mempool_resize(act->adapter->pool.status_read_data,
718 act->adapter->stat_read_buf_num, GFP_KERNEL))
719 return ZFCP_ERP_FAILED;
720
721 if (mempool_resize(act->adapter->pool.status_read_req,
722 act->adapter->stat_read_buf_num, GFP_KERNEL))
723 return ZFCP_ERP_FAILED;
724
717 atomic_set(&act->adapter->stat_miss, act->adapter->stat_read_buf_num); 725 atomic_set(&act->adapter->stat_miss, act->adapter->stat_read_buf_num);
718 if (zfcp_status_read_refill(act->adapter)) 726 if (zfcp_status_read_refill(act->adapter))
719 return ZFCP_ERP_FAILED; 727 return ZFCP_ERP_FAILED;
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index 9ac6a6e4a604..71663fb77310 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -496,7 +496,8 @@ static int zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *req)
496 496
497 adapter->hydra_version = bottom->adapter_type; 497 adapter->hydra_version = bottom->adapter_type;
498 adapter->timer_ticks = bottom->timer_interval; 498 adapter->timer_ticks = bottom->timer_interval;
499 adapter->stat_read_buf_num = max(bottom->status_read_buf_num, (u16)16); 499 adapter->stat_read_buf_num = max(bottom->status_read_buf_num,
500 (u16)FSF_STATUS_READS_RECOM);
500 501
501 if (fc_host_permanent_port_name(shost) == -1) 502 if (fc_host_permanent_port_name(shost) == -1)
502 fc_host_permanent_port_name(shost) = fc_host_port_name(shost); 503 fc_host_permanent_port_name(shost) = fc_host_port_name(shost);
@@ -719,11 +720,6 @@ static struct zfcp_fsf_req *zfcp_fsf_req_create(struct zfcp_qdio *qdio,
719 zfcp_qdio_req_init(adapter->qdio, &req->qdio_req, req->req_id, sbtype, 720 zfcp_qdio_req_init(adapter->qdio, &req->qdio_req, req->req_id, sbtype,
720 req->qtcb, sizeof(struct fsf_qtcb)); 721 req->qtcb, sizeof(struct fsf_qtcb));
721 722
722 if (!(atomic_read(&adapter->status) & ZFCP_STATUS_ADAPTER_QDIOUP)) {
723 zfcp_fsf_req_free(req);
724 return ERR_PTR(-EIO);
725 }
726
727 return req; 723 return req;
728} 724}
729 725
@@ -981,7 +977,7 @@ static int zfcp_fsf_setup_ct_els_sbals(struct zfcp_fsf_req *req,
981 } 977 }
982 978
983 /* use single, unchained SBAL if it can hold the request */ 979 /* use single, unchained SBAL if it can hold the request */
984 if (zfcp_qdio_sg_one_sbale(sg_req) || zfcp_qdio_sg_one_sbale(sg_resp)) { 980 if (zfcp_qdio_sg_one_sbale(sg_req) && zfcp_qdio_sg_one_sbale(sg_resp)) {
985 zfcp_fsf_setup_ct_els_unchained(adapter->qdio, &req->qdio_req, 981 zfcp_fsf_setup_ct_els_unchained(adapter->qdio, &req->qdio_req,
986 sg_req, sg_resp); 982 sg_req, sg_resp);
987 return 0; 983 return 0;
diff --git a/drivers/s390/scsi/zfcp_qdio.c b/drivers/s390/scsi/zfcp_qdio.c
index 28117e130e2c..6fa5e0453176 100644
--- a/drivers/s390/scsi/zfcp_qdio.c
+++ b/drivers/s390/scsi/zfcp_qdio.c
@@ -251,7 +251,8 @@ static int zfcp_qdio_sbal_check(struct zfcp_qdio *qdio)
251 struct zfcp_qdio_queue *req_q = &qdio->req_q; 251 struct zfcp_qdio_queue *req_q = &qdio->req_q;
252 252
253 spin_lock_bh(&qdio->req_q_lock); 253 spin_lock_bh(&qdio->req_q_lock);
254 if (atomic_read(&req_q->count)) 254 if (atomic_read(&req_q->count) ||
255 !(atomic_read(&qdio->adapter->status) & ZFCP_STATUS_ADAPTER_QDIOUP))
255 return 1; 256 return 1;
256 spin_unlock_bh(&qdio->req_q_lock); 257 spin_unlock_bh(&qdio->req_q_lock);
257 return 0; 258 return 0;
@@ -274,8 +275,13 @@ int zfcp_qdio_sbal_get(struct zfcp_qdio *qdio)
274 spin_unlock_bh(&qdio->req_q_lock); 275 spin_unlock_bh(&qdio->req_q_lock);
275 ret = wait_event_interruptible_timeout(qdio->req_q_wq, 276 ret = wait_event_interruptible_timeout(qdio->req_q_wq,
276 zfcp_qdio_sbal_check(qdio), 5 * HZ); 277 zfcp_qdio_sbal_check(qdio), 5 * HZ);
278
279 if (!(atomic_read(&qdio->adapter->status) & ZFCP_STATUS_ADAPTER_QDIOUP))
280 return -EIO;
281
277 if (ret > 0) 282 if (ret > 0)
278 return 0; 283 return 0;
284
279 if (!ret) { 285 if (!ret) {
280 atomic_inc(&qdio->req_q_full); 286 atomic_inc(&qdio->req_q_full);
281 /* assume hanging outbound queue, try queue recovery */ 287 /* assume hanging outbound queue, try queue recovery */
@@ -375,6 +381,8 @@ void zfcp_qdio_close(struct zfcp_qdio *qdio)
375 atomic_clear_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &qdio->adapter->status); 381 atomic_clear_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &qdio->adapter->status);
376 spin_unlock_bh(&qdio->req_q_lock); 382 spin_unlock_bh(&qdio->req_q_lock);
377 383
384 wake_up(&qdio->req_q_wq);
385
378 qdio_shutdown(qdio->adapter->ccw_device, 386 qdio_shutdown(qdio->adapter->ccw_device,
379 QDIO_FLAG_CLEANUP_USING_CLEAR); 387 QDIO_FLAG_CLEANUP_USING_CLEAR);
380 388
diff --git a/drivers/scsi/ibmvscsi/rpa_vscsi.c b/drivers/scsi/ibmvscsi/rpa_vscsi.c
index a864ccc0a342..989b9a8ba72d 100644
--- a/drivers/scsi/ibmvscsi/rpa_vscsi.c
+++ b/drivers/scsi/ibmvscsi/rpa_vscsi.c
@@ -277,6 +277,12 @@ static int rpavscsi_init_crq_queue(struct crq_queue *queue,
277 goto reg_crq_failed; 277 goto reg_crq_failed;
278 } 278 }
279 279
280 queue->cur = 0;
281 spin_lock_init(&queue->lock);
282
283 tasklet_init(&hostdata->srp_task, (void *)rpavscsi_task,
284 (unsigned long)hostdata);
285
280 if (request_irq(vdev->irq, 286 if (request_irq(vdev->irq,
281 rpavscsi_handle_event, 287 rpavscsi_handle_event,
282 0, "ibmvscsi", (void *)hostdata) != 0) { 288 0, "ibmvscsi", (void *)hostdata) != 0) {
@@ -291,15 +297,10 @@ static int rpavscsi_init_crq_queue(struct crq_queue *queue,
291 goto req_irq_failed; 297 goto req_irq_failed;
292 } 298 }
293 299
294 queue->cur = 0;
295 spin_lock_init(&queue->lock);
296
297 tasklet_init(&hostdata->srp_task, (void *)rpavscsi_task,
298 (unsigned long)hostdata);
299
300 return retrc; 300 return retrc;
301 301
302 req_irq_failed: 302 req_irq_failed:
303 tasklet_kill(&hostdata->srp_task);
303 do { 304 do {
304 rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address); 305 rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address);
305 } while ((rc == H_BUSY) || (H_IS_LONG_BUSY(rc))); 306 } while ((rc == H_BUSY) || (H_IS_LONG_BUSY(rc)));
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 82ea4a8226b0..f820cffb7f00 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -1129,20 +1129,22 @@ static int ipr_is_same_device(struct ipr_resource_entry *res,
1129} 1129}
1130 1130
1131/** 1131/**
1132 * ipr_format_resource_path - Format the resource path for printing. 1132 * ipr_format_res_path - Format the resource path for printing.
1133 * @res_path: resource path 1133 * @res_path: resource path
1134 * @buf: buffer 1134 * @buf: buffer
1135 * 1135 *
1136 * Return value: 1136 * Return value:
1137 * pointer to buffer 1137 * pointer to buffer
1138 **/ 1138 **/
1139static char *ipr_format_resource_path(u8 *res_path, char *buffer) 1139static char *ipr_format_res_path(u8 *res_path, char *buffer, int len)
1140{ 1140{
1141 int i; 1141 int i;
1142 char *p = buffer;
1142 1143
1143 sprintf(buffer, "%02X", res_path[0]); 1144 res_path[0] = '\0';
1144 for (i=1; res_path[i] != 0xff; i++) 1145 p += snprintf(p, buffer + len - p, "%02X", res_path[0]);
1145 sprintf(buffer, "%s-%02X", buffer, res_path[i]); 1146 for (i = 1; res_path[i] != 0xff && ((i * 3) < len); i++)
1147 p += snprintf(p, buffer + len - p, "-%02X", res_path[i]);
1146 1148
1147 return buffer; 1149 return buffer;
1148} 1150}
@@ -1187,7 +1189,8 @@ static void ipr_update_res_entry(struct ipr_resource_entry *res,
1187 1189
1188 if (res->sdev && new_path) 1190 if (res->sdev && new_path)
1189 sdev_printk(KERN_INFO, res->sdev, "Resource path: %s\n", 1191 sdev_printk(KERN_INFO, res->sdev, "Resource path: %s\n",
1190 ipr_format_resource_path(&res->res_path[0], &buffer[0])); 1192 ipr_format_res_path(res->res_path, buffer,
1193 sizeof(buffer)));
1191 } else { 1194 } else {
1192 res->flags = cfgtew->u.cfgte->flags; 1195 res->flags = cfgtew->u.cfgte->flags;
1193 if (res->flags & IPR_IS_IOA_RESOURCE) 1196 if (res->flags & IPR_IS_IOA_RESOURCE)
@@ -1573,7 +1576,8 @@ static void ipr_log_sis64_config_error(struct ipr_ioa_cfg *ioa_cfg,
1573 ipr_err_separator; 1576 ipr_err_separator;
1574 1577
1575 ipr_err("Device %d : %s", i + 1, 1578 ipr_err("Device %d : %s", i + 1,
1576 ipr_format_resource_path(&dev_entry->res_path[0], &buffer[0])); 1579 ipr_format_res_path(dev_entry->res_path, buffer,
1580 sizeof(buffer)));
1577 ipr_log_ext_vpd(&dev_entry->vpd); 1581 ipr_log_ext_vpd(&dev_entry->vpd);
1578 1582
1579 ipr_err("-----New Device Information-----\n"); 1583 ipr_err("-----New Device Information-----\n");
@@ -1919,13 +1923,14 @@ static void ipr_log64_fabric_path(struct ipr_hostrcb *hostrcb,
1919 1923
1920 ipr_hcam_err(hostrcb, "%s %s: Resource Path=%s\n", 1924 ipr_hcam_err(hostrcb, "%s %s: Resource Path=%s\n",
1921 path_active_desc[i].desc, path_state_desc[j].desc, 1925 path_active_desc[i].desc, path_state_desc[j].desc,
1922 ipr_format_resource_path(&fabric->res_path[0], &buffer[0])); 1926 ipr_format_res_path(fabric->res_path, buffer,
1927 sizeof(buffer)));
1923 return; 1928 return;
1924 } 1929 }
1925 } 1930 }
1926 1931
1927 ipr_err("Path state=%02X Resource Path=%s\n", path_state, 1932 ipr_err("Path state=%02X Resource Path=%s\n", path_state,
1928 ipr_format_resource_path(&fabric->res_path[0], &buffer[0])); 1933 ipr_format_res_path(fabric->res_path, buffer, sizeof(buffer)));
1929} 1934}
1930 1935
1931static const struct { 1936static const struct {
@@ -2066,7 +2071,8 @@ static void ipr_log64_path_elem(struct ipr_hostrcb *hostrcb,
2066 2071
2067 ipr_hcam_err(hostrcb, "%s %s: Resource Path=%s, Link rate=%s, WWN=%08X%08X\n", 2072 ipr_hcam_err(hostrcb, "%s %s: Resource Path=%s, Link rate=%s, WWN=%08X%08X\n",
2068 path_status_desc[j].desc, path_type_desc[i].desc, 2073 path_status_desc[j].desc, path_type_desc[i].desc,
2069 ipr_format_resource_path(&cfg->res_path[0], &buffer[0]), 2074 ipr_format_res_path(cfg->res_path, buffer,
2075 sizeof(buffer)),
2070 link_rate[cfg->link_rate & IPR_PHY_LINK_RATE_MASK], 2076 link_rate[cfg->link_rate & IPR_PHY_LINK_RATE_MASK],
2071 be32_to_cpu(cfg->wwid[0]), be32_to_cpu(cfg->wwid[1])); 2077 be32_to_cpu(cfg->wwid[0]), be32_to_cpu(cfg->wwid[1]));
2072 return; 2078 return;
@@ -2074,7 +2080,7 @@ static void ipr_log64_path_elem(struct ipr_hostrcb *hostrcb,
2074 } 2080 }
2075 ipr_hcam_err(hostrcb, "Path element=%02X: Resource Path=%s, Link rate=%s " 2081 ipr_hcam_err(hostrcb, "Path element=%02X: Resource Path=%s, Link rate=%s "
2076 "WWN=%08X%08X\n", cfg->type_status, 2082 "WWN=%08X%08X\n", cfg->type_status,
2077 ipr_format_resource_path(&cfg->res_path[0], &buffer[0]), 2083 ipr_format_res_path(cfg->res_path, buffer, sizeof(buffer)),
2078 link_rate[cfg->link_rate & IPR_PHY_LINK_RATE_MASK], 2084 link_rate[cfg->link_rate & IPR_PHY_LINK_RATE_MASK],
2079 be32_to_cpu(cfg->wwid[0]), be32_to_cpu(cfg->wwid[1])); 2085 be32_to_cpu(cfg->wwid[0]), be32_to_cpu(cfg->wwid[1]));
2080} 2086}
@@ -2139,7 +2145,7 @@ static void ipr_log_sis64_array_error(struct ipr_ioa_cfg *ioa_cfg,
2139 2145
2140 ipr_err("RAID %s Array Configuration: %s\n", 2146 ipr_err("RAID %s Array Configuration: %s\n",
2141 error->protection_level, 2147 error->protection_level,
2142 ipr_format_resource_path(&error->last_res_path[0], &buffer[0])); 2148 ipr_format_res_path(error->last_res_path, buffer, sizeof(buffer)));
2143 2149
2144 ipr_err_separator; 2150 ipr_err_separator;
2145 2151
@@ -2160,9 +2166,11 @@ static void ipr_log_sis64_array_error(struct ipr_ioa_cfg *ioa_cfg,
2160 ipr_err("Array Member %d:\n", i); 2166 ipr_err("Array Member %d:\n", i);
2161 ipr_log_ext_vpd(&array_entry->vpd); 2167 ipr_log_ext_vpd(&array_entry->vpd);
2162 ipr_err("Current Location: %s", 2168 ipr_err("Current Location: %s",
2163 ipr_format_resource_path(&array_entry->res_path[0], &buffer[0])); 2169 ipr_format_res_path(array_entry->res_path, buffer,
2170 sizeof(buffer)));
2164 ipr_err("Expected Location: %s", 2171 ipr_err("Expected Location: %s",
2165 ipr_format_resource_path(&array_entry->expected_res_path[0], &buffer[0])); 2172 ipr_format_res_path(array_entry->expected_res_path,
2173 buffer, sizeof(buffer)));
2166 2174
2167 ipr_err_separator; 2175 ipr_err_separator;
2168 } 2176 }
@@ -4079,7 +4087,8 @@ static struct device_attribute ipr_adapter_handle_attr = {
4079}; 4087};
4080 4088
4081/** 4089/**
4082 * ipr_show_resource_path - Show the resource path for this device. 4090 * ipr_show_resource_path - Show the resource path or the resource address for
4091 * this device.
4083 * @dev: device struct 4092 * @dev: device struct
4084 * @buf: buffer 4093 * @buf: buffer
4085 * 4094 *
@@ -4097,9 +4106,14 @@ static ssize_t ipr_show_resource_path(struct device *dev, struct device_attribut
4097 4106
4098 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags); 4107 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
4099 res = (struct ipr_resource_entry *)sdev->hostdata; 4108 res = (struct ipr_resource_entry *)sdev->hostdata;
4100 if (res) 4109 if (res && ioa_cfg->sis64)
4101 len = snprintf(buf, PAGE_SIZE, "%s\n", 4110 len = snprintf(buf, PAGE_SIZE, "%s\n",
4102 ipr_format_resource_path(&res->res_path[0], &buffer[0])); 4111 ipr_format_res_path(res->res_path, buffer,
4112 sizeof(buffer)));
4113 else if (res)
4114 len = snprintf(buf, PAGE_SIZE, "%d:%d:%d:%d\n", ioa_cfg->host->host_no,
4115 res->bus, res->target, res->lun);
4116
4103 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); 4117 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
4104 return len; 4118 return len;
4105} 4119}
@@ -4351,7 +4365,8 @@ static int ipr_slave_configure(struct scsi_device *sdev)
4351 scsi_adjust_queue_depth(sdev, 0, sdev->host->cmd_per_lun); 4365 scsi_adjust_queue_depth(sdev, 0, sdev->host->cmd_per_lun);
4352 if (ioa_cfg->sis64) 4366 if (ioa_cfg->sis64)
4353 sdev_printk(KERN_INFO, sdev, "Resource path: %s\n", 4367 sdev_printk(KERN_INFO, sdev, "Resource path: %s\n",
4354 ipr_format_resource_path(&res->res_path[0], &buffer[0])); 4368 ipr_format_res_path(res->res_path, buffer,
4369 sizeof(buffer)));
4355 return 0; 4370 return 0;
4356 } 4371 }
4357 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); 4372 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h
index 9ecd2259eb39..b965f3587c9d 100644
--- a/drivers/scsi/ipr.h
+++ b/drivers/scsi/ipr.h
@@ -1684,8 +1684,9 @@ struct ipr_ucode_image_header {
1684 if (ipr_is_device(hostrcb)) { \ 1684 if (ipr_is_device(hostrcb)) { \
1685 if ((hostrcb)->ioa_cfg->sis64) { \ 1685 if ((hostrcb)->ioa_cfg->sis64) { \
1686 printk(KERN_ERR IPR_NAME ": %s: " fmt, \ 1686 printk(KERN_ERR IPR_NAME ": %s: " fmt, \
1687 ipr_format_resource_path(&hostrcb->hcam.u.error64.fd_res_path[0], \ 1687 ipr_format_res_path(hostrcb->hcam.u.error64.fd_res_path, \
1688 &hostrcb->rp_buffer[0]), \ 1688 hostrcb->rp_buffer, \
1689 sizeof(hostrcb->rp_buffer)), \
1689 __VA_ARGS__); \ 1690 __VA_ARGS__); \
1690 } else { \ 1691 } else { \
1691 ipr_ra_err((hostrcb)->ioa_cfg, \ 1692 ipr_ra_err((hostrcb)->ioa_cfg, \