diff options
author | Christof Schmitt <christof.schmitt@de.ibm.com> | 2008-08-21 07:43:32 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-08-29 10:03:33 -0400 |
commit | d4538817287e56abc938900886301a5bdfafbfcd (patch) | |
tree | e7252f22ee956c1ec051824c623994d6b6d6d2e9 /drivers | |
parent | bfad9ceac5d11318c99ae8a0d1e926a380a56edd (diff) |
[SCSI] zfcp: Fix request queue locking
The request queue lock can be acquired from softirq context when the
SCSI midlayer issues commands. Disable softirqs for this lock when
commands are issued from zfcp.
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: Martin Petermann <martin@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/s390/scsi/zfcp_fsf.c | 56 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_qdio.c | 4 |
2 files changed, 30 insertions, 30 deletions
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index 19c1ca913874..aad33241a2ea 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c | |||
@@ -710,10 +710,10 @@ static void zfcp_fsf_exchange_port_data_handler(struct zfcp_fsf_req *req) | |||
710 | 710 | ||
711 | static int zfcp_fsf_sbal_check(struct zfcp_qdio_queue *queue) | 711 | static int zfcp_fsf_sbal_check(struct zfcp_qdio_queue *queue) |
712 | { | 712 | { |
713 | spin_lock(&queue->lock); | 713 | spin_lock_bh(&queue->lock); |
714 | if (atomic_read(&queue->count)) | 714 | if (atomic_read(&queue->count)) |
715 | return 1; | 715 | return 1; |
716 | spin_unlock(&queue->lock); | 716 | spin_unlock_bh(&queue->lock); |
717 | return 0; | 717 | return 0; |
718 | } | 718 | } |
719 | 719 | ||
@@ -722,13 +722,13 @@ static int zfcp_fsf_req_sbal_get(struct zfcp_adapter *adapter) | |||
722 | long ret; | 722 | long ret; |
723 | struct zfcp_qdio_queue *req_q = &adapter->req_q; | 723 | struct zfcp_qdio_queue *req_q = &adapter->req_q; |
724 | 724 | ||
725 | spin_unlock(&req_q->lock); | 725 | spin_unlock_bh(&req_q->lock); |
726 | ret = wait_event_interruptible_timeout(adapter->request_wq, | 726 | ret = wait_event_interruptible_timeout(adapter->request_wq, |
727 | zfcp_fsf_sbal_check(req_q), 5 * HZ); | 727 | zfcp_fsf_sbal_check(req_q), 5 * HZ); |
728 | if (ret > 0) | 728 | if (ret > 0) |
729 | return 0; | 729 | return 0; |
730 | 730 | ||
731 | spin_lock(&req_q->lock); | 731 | spin_lock_bh(&req_q->lock); |
732 | return -EIO; | 732 | return -EIO; |
733 | } | 733 | } |
734 | 734 | ||
@@ -870,7 +870,7 @@ int zfcp_fsf_status_read(struct zfcp_adapter *adapter) | |||
870 | volatile struct qdio_buffer_element *sbale; | 870 | volatile struct qdio_buffer_element *sbale; |
871 | int retval = -EIO; | 871 | int retval = -EIO; |
872 | 872 | ||
873 | spin_lock(&adapter->req_q.lock); | 873 | spin_lock_bh(&adapter->req_q.lock); |
874 | if (zfcp_fsf_req_sbal_get(adapter)) | 874 | if (zfcp_fsf_req_sbal_get(adapter)) |
875 | goto out; | 875 | goto out; |
876 | 876 | ||
@@ -910,7 +910,7 @@ failed_buf: | |||
910 | zfcp_fsf_req_free(req); | 910 | zfcp_fsf_req_free(req); |
911 | zfcp_hba_dbf_event_fsf_unsol("fail", adapter, NULL); | 911 | zfcp_hba_dbf_event_fsf_unsol("fail", adapter, NULL); |
912 | out: | 912 | out: |
913 | spin_unlock(&adapter->req_q.lock); | 913 | spin_unlock_bh(&adapter->req_q.lock); |
914 | return retval; | 914 | return retval; |
915 | } | 915 | } |
916 | 916 | ||
@@ -1106,7 +1106,7 @@ int zfcp_fsf_send_ct(struct zfcp_send_ct *ct, mempool_t *pool, | |||
1106 | struct zfcp_fsf_req *req; | 1106 | struct zfcp_fsf_req *req; |
1107 | int ret = -EIO; | 1107 | int ret = -EIO; |
1108 | 1108 | ||
1109 | spin_lock(&adapter->req_q.lock); | 1109 | spin_lock_bh(&adapter->req_q.lock); |
1110 | if (zfcp_fsf_req_sbal_get(adapter)) | 1110 | if (zfcp_fsf_req_sbal_get(adapter)) |
1111 | goto out; | 1111 | goto out; |
1112 | 1112 | ||
@@ -1148,7 +1148,7 @@ failed_send: | |||
1148 | if (erp_action) | 1148 | if (erp_action) |
1149 | erp_action->fsf_req = NULL; | 1149 | erp_action->fsf_req = NULL; |
1150 | out: | 1150 | out: |
1151 | spin_unlock(&adapter->req_q.lock); | 1151 | spin_unlock_bh(&adapter->req_q.lock); |
1152 | return ret; | 1152 | return ret; |
1153 | } | 1153 | } |
1154 | 1154 | ||
@@ -1263,7 +1263,7 @@ int zfcp_fsf_exchange_config_data(struct zfcp_erp_action *erp_action) | |||
1263 | struct zfcp_adapter *adapter = erp_action->adapter; | 1263 | struct zfcp_adapter *adapter = erp_action->adapter; |
1264 | int retval = -EIO; | 1264 | int retval = -EIO; |
1265 | 1265 | ||
1266 | spin_lock(&adapter->req_q.lock); | 1266 | spin_lock_bh(&adapter->req_q.lock); |
1267 | if (!atomic_read(&adapter->req_q.count)) | 1267 | if (!atomic_read(&adapter->req_q.count)) |
1268 | goto out; | 1268 | goto out; |
1269 | req = zfcp_fsf_req_create(adapter, | 1269 | req = zfcp_fsf_req_create(adapter, |
@@ -1295,7 +1295,7 @@ int zfcp_fsf_exchange_config_data(struct zfcp_erp_action *erp_action) | |||
1295 | erp_action->fsf_req = NULL; | 1295 | erp_action->fsf_req = NULL; |
1296 | } | 1296 | } |
1297 | out: | 1297 | out: |
1298 | spin_unlock(&adapter->req_q.lock); | 1298 | spin_unlock_bh(&adapter->req_q.lock); |
1299 | return retval; | 1299 | return retval; |
1300 | } | 1300 | } |
1301 | 1301 | ||
@@ -1306,7 +1306,7 @@ int zfcp_fsf_exchange_config_data_sync(struct zfcp_adapter *adapter, | |||
1306 | struct zfcp_fsf_req *req = NULL; | 1306 | struct zfcp_fsf_req *req = NULL; |
1307 | int retval = -EIO; | 1307 | int retval = -EIO; |
1308 | 1308 | ||
1309 | spin_lock(&adapter->req_q.lock); | 1309 | spin_lock_bh(&adapter->req_q.lock); |
1310 | if (zfcp_fsf_req_sbal_get(adapter)) | 1310 | if (zfcp_fsf_req_sbal_get(adapter)) |
1311 | goto out; | 1311 | goto out; |
1312 | 1312 | ||
@@ -1334,7 +1334,7 @@ int zfcp_fsf_exchange_config_data_sync(struct zfcp_adapter *adapter, | |||
1334 | zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); | 1334 | zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); |
1335 | retval = zfcp_fsf_req_send(req); | 1335 | retval = zfcp_fsf_req_send(req); |
1336 | out: | 1336 | out: |
1337 | spin_unlock(&adapter->req_q.lock); | 1337 | spin_unlock_bh(&adapter->req_q.lock); |
1338 | if (!retval) | 1338 | if (!retval) |
1339 | wait_event(req->completion_wq, | 1339 | wait_event(req->completion_wq, |
1340 | req->status & ZFCP_STATUS_FSFREQ_COMPLETED); | 1340 | req->status & ZFCP_STATUS_FSFREQ_COMPLETED); |
@@ -1359,7 +1359,7 @@ int zfcp_fsf_exchange_port_data(struct zfcp_erp_action *erp_action) | |||
1359 | if (!(adapter->adapter_features & FSF_FEATURE_HBAAPI_MANAGEMENT)) | 1359 | if (!(adapter->adapter_features & FSF_FEATURE_HBAAPI_MANAGEMENT)) |
1360 | return -EOPNOTSUPP; | 1360 | return -EOPNOTSUPP; |
1361 | 1361 | ||
1362 | spin_lock(&adapter->req_q.lock); | 1362 | spin_lock_bh(&adapter->req_q.lock); |
1363 | if (!atomic_read(&adapter->req_q.count)) | 1363 | if (!atomic_read(&adapter->req_q.count)) |
1364 | goto out; | 1364 | goto out; |
1365 | req = zfcp_fsf_req_create(adapter, FSF_QTCB_EXCHANGE_PORT_DATA, | 1365 | req = zfcp_fsf_req_create(adapter, FSF_QTCB_EXCHANGE_PORT_DATA, |
@@ -1385,7 +1385,7 @@ int zfcp_fsf_exchange_port_data(struct zfcp_erp_action *erp_action) | |||
1385 | erp_action->fsf_req = NULL; | 1385 | erp_action->fsf_req = NULL; |
1386 | } | 1386 | } |
1387 | out: | 1387 | out: |
1388 | spin_unlock(&adapter->req_q.lock); | 1388 | spin_unlock_bh(&adapter->req_q.lock); |
1389 | return retval; | 1389 | return retval; |
1390 | } | 1390 | } |
1391 | 1391 | ||
@@ -1405,7 +1405,7 @@ int zfcp_fsf_exchange_port_data_sync(struct zfcp_adapter *adapter, | |||
1405 | if (!(adapter->adapter_features & FSF_FEATURE_HBAAPI_MANAGEMENT)) | 1405 | if (!(adapter->adapter_features & FSF_FEATURE_HBAAPI_MANAGEMENT)) |
1406 | return -EOPNOTSUPP; | 1406 | return -EOPNOTSUPP; |
1407 | 1407 | ||
1408 | spin_lock(&adapter->req_q.lock); | 1408 | spin_lock_bh(&adapter->req_q.lock); |
1409 | if (!atomic_read(&adapter->req_q.count)) | 1409 | if (!atomic_read(&adapter->req_q.count)) |
1410 | goto out; | 1410 | goto out; |
1411 | 1411 | ||
@@ -1427,7 +1427,7 @@ int zfcp_fsf_exchange_port_data_sync(struct zfcp_adapter *adapter, | |||
1427 | zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); | 1427 | zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); |
1428 | retval = zfcp_fsf_req_send(req); | 1428 | retval = zfcp_fsf_req_send(req); |
1429 | out: | 1429 | out: |
1430 | spin_unlock(&adapter->req_q.lock); | 1430 | spin_unlock_bh(&adapter->req_q.lock); |
1431 | if (!retval) | 1431 | if (!retval) |
1432 | wait_event(req->completion_wq, | 1432 | wait_event(req->completion_wq, |
1433 | req->status & ZFCP_STATUS_FSFREQ_COMPLETED); | 1433 | req->status & ZFCP_STATUS_FSFREQ_COMPLETED); |
@@ -1531,7 +1531,7 @@ int zfcp_fsf_open_port(struct zfcp_erp_action *erp_action) | |||
1531 | struct zfcp_fsf_req *req; | 1531 | struct zfcp_fsf_req *req; |
1532 | int retval = -EIO; | 1532 | int retval = -EIO; |
1533 | 1533 | ||
1534 | spin_lock(&adapter->req_q.lock); | 1534 | spin_lock_bh(&adapter->req_q.lock); |
1535 | if (zfcp_fsf_req_sbal_get(adapter)) | 1535 | if (zfcp_fsf_req_sbal_get(adapter)) |
1536 | goto out; | 1536 | goto out; |
1537 | 1537 | ||
@@ -1562,7 +1562,7 @@ int zfcp_fsf_open_port(struct zfcp_erp_action *erp_action) | |||
1562 | erp_action->fsf_req = NULL; | 1562 | erp_action->fsf_req = NULL; |
1563 | } | 1563 | } |
1564 | out: | 1564 | out: |
1565 | spin_unlock(&adapter->req_q.lock); | 1565 | spin_unlock_bh(&adapter->req_q.lock); |
1566 | return retval; | 1566 | return retval; |
1567 | } | 1567 | } |
1568 | 1568 | ||
@@ -1603,7 +1603,7 @@ int zfcp_fsf_close_port(struct zfcp_erp_action *erp_action) | |||
1603 | struct zfcp_fsf_req *req; | 1603 | struct zfcp_fsf_req *req; |
1604 | int retval = -EIO; | 1604 | int retval = -EIO; |
1605 | 1605 | ||
1606 | spin_lock(&adapter->req_q.lock); | 1606 | spin_lock_bh(&adapter->req_q.lock); |
1607 | if (zfcp_fsf_req_sbal_get(adapter)) | 1607 | if (zfcp_fsf_req_sbal_get(adapter)) |
1608 | goto out; | 1608 | goto out; |
1609 | 1609 | ||
@@ -1633,7 +1633,7 @@ int zfcp_fsf_close_port(struct zfcp_erp_action *erp_action) | |||
1633 | erp_action->fsf_req = NULL; | 1633 | erp_action->fsf_req = NULL; |
1634 | } | 1634 | } |
1635 | out: | 1635 | out: |
1636 | spin_unlock(&adapter->req_q.lock); | 1636 | spin_unlock_bh(&adapter->req_q.lock); |
1637 | return retval; | 1637 | return retval; |
1638 | } | 1638 | } |
1639 | 1639 | ||
@@ -1700,7 +1700,7 @@ int zfcp_fsf_close_physical_port(struct zfcp_erp_action *erp_action) | |||
1700 | struct zfcp_fsf_req *req; | 1700 | struct zfcp_fsf_req *req; |
1701 | int retval = -EIO; | 1701 | int retval = -EIO; |
1702 | 1702 | ||
1703 | spin_lock(&adapter->req_q.lock); | 1703 | spin_lock_bh(&adapter->req_q.lock); |
1704 | if (zfcp_fsf_req_sbal_get(adapter)) | 1704 | if (zfcp_fsf_req_sbal_get(adapter)) |
1705 | goto out; | 1705 | goto out; |
1706 | 1706 | ||
@@ -1731,7 +1731,7 @@ int zfcp_fsf_close_physical_port(struct zfcp_erp_action *erp_action) | |||
1731 | erp_action->fsf_req = NULL; | 1731 | erp_action->fsf_req = NULL; |
1732 | } | 1732 | } |
1733 | out: | 1733 | out: |
1734 | spin_unlock(&adapter->req_q.lock); | 1734 | spin_unlock_bh(&adapter->req_q.lock); |
1735 | return retval; | 1735 | return retval; |
1736 | } | 1736 | } |
1737 | 1737 | ||
@@ -1875,7 +1875,7 @@ int zfcp_fsf_open_unit(struct zfcp_erp_action *erp_action) | |||
1875 | struct zfcp_fsf_req *req; | 1875 | struct zfcp_fsf_req *req; |
1876 | int retval = -EIO; | 1876 | int retval = -EIO; |
1877 | 1877 | ||
1878 | spin_lock(&adapter->req_q.lock); | 1878 | spin_lock_bh(&adapter->req_q.lock); |
1879 | if (zfcp_fsf_req_sbal_get(adapter)) | 1879 | if (zfcp_fsf_req_sbal_get(adapter)) |
1880 | goto out; | 1880 | goto out; |
1881 | 1881 | ||
@@ -1910,7 +1910,7 @@ int zfcp_fsf_open_unit(struct zfcp_erp_action *erp_action) | |||
1910 | erp_action->fsf_req = NULL; | 1910 | erp_action->fsf_req = NULL; |
1911 | } | 1911 | } |
1912 | out: | 1912 | out: |
1913 | spin_unlock(&adapter->req_q.lock); | 1913 | spin_unlock_bh(&adapter->req_q.lock); |
1914 | return retval; | 1914 | return retval; |
1915 | } | 1915 | } |
1916 | 1916 | ||
@@ -1965,7 +1965,7 @@ int zfcp_fsf_close_unit(struct zfcp_erp_action *erp_action) | |||
1965 | struct zfcp_fsf_req *req; | 1965 | struct zfcp_fsf_req *req; |
1966 | int retval = -EIO; | 1966 | int retval = -EIO; |
1967 | 1967 | ||
1968 | spin_lock(&adapter->req_q.lock); | 1968 | spin_lock_bh(&adapter->req_q.lock); |
1969 | if (zfcp_fsf_req_sbal_get(adapter)) | 1969 | if (zfcp_fsf_req_sbal_get(adapter)) |
1970 | goto out; | 1970 | goto out; |
1971 | req = zfcp_fsf_req_create(adapter, FSF_QTCB_CLOSE_LUN, | 1971 | req = zfcp_fsf_req_create(adapter, FSF_QTCB_CLOSE_LUN, |
@@ -1995,7 +1995,7 @@ int zfcp_fsf_close_unit(struct zfcp_erp_action *erp_action) | |||
1995 | erp_action->fsf_req = NULL; | 1995 | erp_action->fsf_req = NULL; |
1996 | } | 1996 | } |
1997 | out: | 1997 | out: |
1998 | spin_unlock(&adapter->req_q.lock); | 1998 | spin_unlock_bh(&adapter->req_q.lock); |
1999 | return retval; | 1999 | return retval; |
2000 | } | 2000 | } |
2001 | 2001 | ||
@@ -2417,7 +2417,7 @@ struct zfcp_fsf_req *zfcp_fsf_control_file(struct zfcp_adapter *adapter, | |||
2417 | return ERR_PTR(-EINVAL); | 2417 | return ERR_PTR(-EINVAL); |
2418 | } | 2418 | } |
2419 | 2419 | ||
2420 | spin_lock(&adapter->req_q.lock); | 2420 | spin_lock_bh(&adapter->req_q.lock); |
2421 | if (zfcp_fsf_req_sbal_get(adapter)) | 2421 | if (zfcp_fsf_req_sbal_get(adapter)) |
2422 | goto out; | 2422 | goto out; |
2423 | 2423 | ||
@@ -2447,7 +2447,7 @@ struct zfcp_fsf_req *zfcp_fsf_control_file(struct zfcp_adapter *adapter, | |||
2447 | zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); | 2447 | zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); |
2448 | retval = zfcp_fsf_req_send(req); | 2448 | retval = zfcp_fsf_req_send(req); |
2449 | out: | 2449 | out: |
2450 | spin_unlock(&adapter->req_q.lock); | 2450 | spin_unlock_bh(&adapter->req_q.lock); |
2451 | 2451 | ||
2452 | if (!retval) { | 2452 | if (!retval) { |
2453 | wait_event(req->completion_wq, | 2453 | wait_event(req->completion_wq, |
diff --git a/drivers/s390/scsi/zfcp_qdio.c b/drivers/s390/scsi/zfcp_qdio.c index d6dbd653fde9..69d632d851d9 100644 --- a/drivers/s390/scsi/zfcp_qdio.c +++ b/drivers/s390/scsi/zfcp_qdio.c | |||
@@ -423,9 +423,9 @@ void zfcp_qdio_close(struct zfcp_adapter *adapter) | |||
423 | 423 | ||
424 | /* clear QDIOUP flag, thus do_QDIO is not called during qdio_shutdown */ | 424 | /* clear QDIOUP flag, thus do_QDIO is not called during qdio_shutdown */ |
425 | req_q = &adapter->req_q; | 425 | req_q = &adapter->req_q; |
426 | spin_lock(&req_q->lock); | 426 | spin_lock_bh(&req_q->lock); |
427 | atomic_clear_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &adapter->status); | 427 | atomic_clear_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &adapter->status); |
428 | spin_unlock(&req_q->lock); | 428 | spin_unlock_bh(&req_q->lock); |
429 | 429 | ||
430 | qdio_shutdown(adapter->ccw_device, QDIO_FLAG_CLEANUP_USING_CLEAR); | 430 | qdio_shutdown(adapter->ccw_device, QDIO_FLAG_CLEANUP_USING_CLEAR); |
431 | 431 | ||