Skip to content

Commit c2af754

Browse files
Christof SchmittJames Bottomley
authored andcommitted
[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 <[email protected]> Signed-off-by: Christof Schmitt <[email protected]> Signed-off-by: James Bottomley <[email protected]>
1 parent 30b6777 commit c2af754

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

drivers/s390/scsi/zfcp_fsf.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -719,11 +719,6 @@ static struct zfcp_fsf_req *zfcp_fsf_req_create(struct zfcp_qdio *qdio,
719719
zfcp_qdio_req_init(adapter->qdio, &req->qdio_req, req->req_id, sbtype,
720720
req->qtcb, sizeof(struct fsf_qtcb));
721721

722-
if (!(atomic_read(&adapter->status) & ZFCP_STATUS_ADAPTER_QDIOUP)) {
723-
zfcp_fsf_req_free(req);
724-
return ERR_PTR(-EIO);
725-
}
726-
727722
return req;
728723
}
729724

drivers/s390/scsi/zfcp_qdio.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@ static int zfcp_qdio_sbal_check(struct zfcp_qdio *qdio)
251251
struct zfcp_qdio_queue *req_q = &qdio->req_q;
252252

253253
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))
255256
return 1;
256257
spin_unlock_bh(&qdio->req_q_lock);
257258
return 0;
@@ -274,8 +275,13 @@ int zfcp_qdio_sbal_get(struct zfcp_qdio *qdio)
274275
spin_unlock_bh(&qdio->req_q_lock);
275276
ret = wait_event_interruptible_timeout(qdio->req_q_wq,
276277
zfcp_qdio_sbal_check(qdio), 5 * HZ);
278+
279+
if (!(atomic_read(&qdio->adapter->status) & ZFCP_STATUS_ADAPTER_QDIOUP))
280+
return -EIO;
281+
277282
if (ret > 0)
278283
return 0;
284+
279285
if (!ret) {
280286
atomic_inc(&qdio->req_q_full);
281287
/* assume hanging outbound queue, try queue recovery */
@@ -375,6 +381,8 @@ void zfcp_qdio_close(struct zfcp_qdio *qdio)
375381
atomic_clear_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &qdio->adapter->status);
376382
spin_unlock_bh(&qdio->req_q_lock);
377383

384+
wake_up(&qdio->req_q_wq);
385+
378386
qdio_shutdown(qdio->adapter->ccw_device,
379387
QDIO_FLAG_CLEANUP_USING_CLEAR);
380388

0 commit comments

Comments
 (0)