diff options
| author | Christof Schmitt <christof.schmitt@de.ibm.com> | 2010-06-21 04:11:32 -0400 |
|---|---|---|
| committer | James Bottomley <James.Bottomley@suse.de> | 2010-07-21 18:05:07 -0400 |
| commit | c2af7545aaff3495d9bf9a7608c52f0af86fb194 (patch) | |
| tree | 9a30d2da8ecabc075f46424cd4c20290b6b9b5ec | |
| parent | 30b6777b8931afc5f3aa42858fe917938b570f79 (diff) | |
[SCSI] zfcp: Do not wait for SBALs on stopped queue
Trying to read the FC host statistics on an offline adapter results in
a 5 seconds wait. Reading the statistics tries to issue an exchange
port data request which first waits up to 5 seconds for an entry in
the request queue.
Change the strategy for getting a free SBAL to exit when the queue is
stopped. Reading the statistics will then fail without the wait.
Reviewed-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
| -rw-r--r-- | drivers/s390/scsi/zfcp_fsf.c | 5 | ||||
| -rw-r--r-- | drivers/s390/scsi/zfcp_qdio.c | 10 |
2 files changed, 9 insertions, 6 deletions
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index 4e15361a83b9..229795f190e8 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c | |||
| @@ -719,11 +719,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, | 719 | zfcp_qdio_req_init(adapter->qdio, &req->qdio_req, req->req_id, sbtype, |
| 720 | req->qtcb, sizeof(struct fsf_qtcb)); | 720 | req->qtcb, sizeof(struct fsf_qtcb)); |
| 721 | 721 | ||
| 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; | 722 | return req; |
| 728 | } | 723 | } |
| 729 | 724 | ||
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 | ||
