diff options
Diffstat (limited to 'drivers/s390/scsi/zfcp_aux.c')
-rw-r--r-- | drivers/s390/scsi/zfcp_aux.c | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index 68d151aaa474..e17b4d58a9f6 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c | |||
@@ -97,11 +97,6 @@ MODULE_PARM_DESC(loglevel, | |||
97 | "FC ERP QDIO CIO Config FSF SCSI Other, " | 97 | "FC ERP QDIO CIO Config FSF SCSI Other, " |
98 | "levels: 0=none 1=normal 2=devel 3=trace"); | 98 | "levels: 0=none 1=normal 2=devel 3=trace"); |
99 | 99 | ||
100 | #ifdef ZFCP_PRINT_FLAGS | ||
101 | u32 flags_dump = 0; | ||
102 | module_param(flags_dump, uint, 0); | ||
103 | #endif | ||
104 | |||
105 | /****************************************************************/ | 100 | /****************************************************************/ |
106 | /************** Functions without logging ***********************/ | 101 | /************** Functions without logging ***********************/ |
107 | /****************************************************************/ | 102 | /****************************************************************/ |
@@ -223,13 +218,20 @@ zfcp_in_els_dbf_event(struct zfcp_adapter *adapter, const char *text, | |||
223 | * Parse "device=..." parameter string. | 218 | * Parse "device=..." parameter string. |
224 | */ | 219 | */ |
225 | static int __init | 220 | static int __init |
226 | zfcp_device_setup(char *str) | 221 | zfcp_device_setup(char *devstr) |
227 | { | 222 | { |
228 | char *tmp; | 223 | char *tmp, *str; |
224 | size_t len; | ||
229 | 225 | ||
230 | if (!str) | 226 | if (!devstr) |
231 | return 0; | 227 | return 0; |
232 | 228 | ||
229 | len = strlen(devstr) + 1; | ||
230 | str = (char *) kmalloc(len, GFP_KERNEL); | ||
231 | if (!str) | ||
232 | goto err_out; | ||
233 | memcpy(str, devstr, len); | ||
234 | |||
233 | tmp = strchr(str, ','); | 235 | tmp = strchr(str, ','); |
234 | if (!tmp) | 236 | if (!tmp) |
235 | goto err_out; | 237 | goto err_out; |
@@ -246,10 +248,12 @@ zfcp_device_setup(char *str) | |||
246 | zfcp_data.init_fcp_lun = simple_strtoull(tmp, &tmp, 0); | 248 | zfcp_data.init_fcp_lun = simple_strtoull(tmp, &tmp, 0); |
247 | if (*tmp != '\0') | 249 | if (*tmp != '\0') |
248 | goto err_out; | 250 | goto err_out; |
251 | kfree(str); | ||
249 | return 1; | 252 | return 1; |
250 | 253 | ||
251 | err_out: | 254 | err_out: |
252 | ZFCP_LOG_NORMAL("Parse error for device parameter string %s\n", str); | 255 | ZFCP_LOG_NORMAL("Parse error for device parameter string %s\n", str); |
256 | kfree(str); | ||
253 | return 0; | 257 | return 0; |
254 | } | 258 | } |
255 | 259 | ||
@@ -525,7 +529,7 @@ zfcp_cfdc_dev_ioctl(struct file *file, unsigned int command, | |||
525 | 529 | ||
526 | out: | 530 | out: |
527 | if (fsf_req != NULL) | 531 | if (fsf_req != NULL) |
528 | zfcp_fsf_req_cleanup(fsf_req); | 532 | zfcp_fsf_req_free(fsf_req); |
529 | 533 | ||
530 | if ((adapter != NULL) && (retval != -ENXIO)) | 534 | if ((adapter != NULL) && (retval != -ENXIO)) |
531 | zfcp_adapter_put(adapter); | 535 | zfcp_adapter_put(adapter); |
@@ -1154,7 +1158,7 @@ zfcp_adapter_enqueue(struct ccw_device *ccw_device) | |||
1154 | INIT_LIST_HEAD(&adapter->port_remove_lh); | 1158 | INIT_LIST_HEAD(&adapter->port_remove_lh); |
1155 | 1159 | ||
1156 | /* initialize list of fsf requests */ | 1160 | /* initialize list of fsf requests */ |
1157 | rwlock_init(&adapter->fsf_req_list_lock); | 1161 | spin_lock_init(&adapter->fsf_req_list_lock); |
1158 | INIT_LIST_HEAD(&adapter->fsf_req_list_head); | 1162 | INIT_LIST_HEAD(&adapter->fsf_req_list_head); |
1159 | 1163 | ||
1160 | /* initialize abort lock */ | 1164 | /* initialize abort lock */ |
@@ -1239,9 +1243,9 @@ zfcp_adapter_dequeue(struct zfcp_adapter *adapter) | |||
1239 | zfcp_sysfs_adapter_remove_files(&adapter->ccw_device->dev); | 1243 | zfcp_sysfs_adapter_remove_files(&adapter->ccw_device->dev); |
1240 | dev_set_drvdata(&adapter->ccw_device->dev, NULL); | 1244 | dev_set_drvdata(&adapter->ccw_device->dev, NULL); |
1241 | /* sanity check: no pending FSF requests */ | 1245 | /* sanity check: no pending FSF requests */ |
1242 | read_lock_irqsave(&adapter->fsf_req_list_lock, flags); | 1246 | spin_lock_irqsave(&adapter->fsf_req_list_lock, flags); |
1243 | retval = !list_empty(&adapter->fsf_req_list_head); | 1247 | retval = !list_empty(&adapter->fsf_req_list_head); |
1244 | read_unlock_irqrestore(&adapter->fsf_req_list_lock, flags); | 1248 | spin_unlock_irqrestore(&adapter->fsf_req_list_lock, flags); |
1245 | if (retval) { | 1249 | if (retval) { |
1246 | ZFCP_LOG_NORMAL("bug: adapter %s (%p) still in use, " | 1250 | ZFCP_LOG_NORMAL("bug: adapter %s (%p) still in use, " |
1247 | "%i requests outstanding\n", | 1251 | "%i requests outstanding\n", |
@@ -1483,19 +1487,15 @@ zfcp_fsf_incoming_els_rscn(struct zfcp_adapter *adapter, | |||
1483 | fcp_rscn_element++; | 1487 | fcp_rscn_element++; |
1484 | switch (fcp_rscn_element->addr_format) { | 1488 | switch (fcp_rscn_element->addr_format) { |
1485 | case ZFCP_PORT_ADDRESS: | 1489 | case ZFCP_PORT_ADDRESS: |
1486 | ZFCP_LOG_FLAGS(1, "ZFCP_PORT_ADDRESS\n"); | ||
1487 | range_mask = ZFCP_PORTS_RANGE_PORT; | 1490 | range_mask = ZFCP_PORTS_RANGE_PORT; |
1488 | break; | 1491 | break; |
1489 | case ZFCP_AREA_ADDRESS: | 1492 | case ZFCP_AREA_ADDRESS: |
1490 | ZFCP_LOG_FLAGS(1, "ZFCP_AREA_ADDRESS\n"); | ||
1491 | range_mask = ZFCP_PORTS_RANGE_AREA; | 1493 | range_mask = ZFCP_PORTS_RANGE_AREA; |
1492 | break; | 1494 | break; |
1493 | case ZFCP_DOMAIN_ADDRESS: | 1495 | case ZFCP_DOMAIN_ADDRESS: |
1494 | ZFCP_LOG_FLAGS(1, "ZFCP_DOMAIN_ADDRESS\n"); | ||
1495 | range_mask = ZFCP_PORTS_RANGE_DOMAIN; | 1496 | range_mask = ZFCP_PORTS_RANGE_DOMAIN; |
1496 | break; | 1497 | break; |
1497 | case ZFCP_FABRIC_ADDRESS: | 1498 | case ZFCP_FABRIC_ADDRESS: |
1498 | ZFCP_LOG_FLAGS(1, "ZFCP_FABRIC_ADDRESS\n"); | ||
1499 | range_mask = ZFCP_PORTS_RANGE_FABRIC; | 1499 | range_mask = ZFCP_PORTS_RANGE_FABRIC; |
1500 | break; | 1500 | break; |
1501 | default: | 1501 | default: |
@@ -1762,7 +1762,10 @@ static void zfcp_ns_gid_pn_handler(unsigned long data) | |||
1762 | ct_iu_req = zfcp_sg_to_address(ct->req); | 1762 | ct_iu_req = zfcp_sg_to_address(ct->req); |
1763 | ct_iu_resp = zfcp_sg_to_address(ct->resp); | 1763 | ct_iu_resp = zfcp_sg_to_address(ct->resp); |
1764 | 1764 | ||
1765 | if ((ct->status != 0) || zfcp_check_ct_response(&ct_iu_resp->header)) { | 1765 | if (ct->status != 0) |
1766 | goto failed; | ||
1767 | |||
1768 | if (zfcp_check_ct_response(&ct_iu_resp->header)) { | ||
1766 | /* FIXME: do we need some specific erp entry points */ | 1769 | /* FIXME: do we need some specific erp entry points */ |
1767 | atomic_set_mask(ZFCP_STATUS_PORT_INVALID_WWPN, &port->status); | 1770 | atomic_set_mask(ZFCP_STATUS_PORT_INVALID_WWPN, &port->status); |
1768 | goto failed; | 1771 | goto failed; |