Commit c2af7545aaff3495d9bf9a7608c52f0af86fb194
Committed by
James Bottomley
1 parent
30b6777b89
Exists in
master
and in
7 other branches
[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>
Showing 2 changed files with 9 additions and 6 deletions Side-by-side Diff
drivers/s390/scsi/zfcp_fsf.c
... | ... | @@ -719,11 +719,6 @@ |
719 | 719 | zfcp_qdio_req_init(adapter->qdio, &req->qdio_req, req->req_id, sbtype, |
720 | 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 | 722 | return req; |
728 | 723 | } |
729 | 724 |
drivers/s390/scsi/zfcp_qdio.c
... | ... | @@ -251,7 +251,8 @@ |
251 | 251 | struct zfcp_qdio_queue *req_q = &qdio->req_q; |
252 | 252 | |
253 | 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 | 256 | return 1; |
256 | 257 | spin_unlock_bh(&qdio->req_q_lock); |
257 | 258 | return 0; |
258 | 259 | |
... | ... | @@ -274,8 +275,13 @@ |
274 | 275 | spin_unlock_bh(&qdio->req_q_lock); |
275 | 276 | ret = wait_event_interruptible_timeout(qdio->req_q_wq, |
276 | 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 | 282 | if (ret > 0) |
278 | 283 | return 0; |
284 | + | |
279 | 285 | if (!ret) { |
280 | 286 | atomic_inc(&qdio->req_q_full); |
281 | 287 | /* assume hanging outbound queue, try queue recovery */ |
... | ... | @@ -374,6 +380,8 @@ |
374 | 380 | spin_lock_bh(&qdio->req_q_lock); |
375 | 381 | atomic_clear_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &qdio->adapter->status); |
376 | 382 | spin_unlock_bh(&qdio->req_q_lock); |
383 | + | |
384 | + wake_up(&qdio->req_q_wq); | |
377 | 385 | |
378 | 386 | qdio_shutdown(qdio->adapter->ccw_device, |
379 | 387 | QDIO_FLAG_CLEANUP_USING_CLEAR); |