aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_qdio.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/scsi/zfcp_qdio.c')
-rw-r--r--drivers/s390/scsi/zfcp_qdio.c10
1 files changed, 9 insertions, 1 deletions
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