diff options
author | Martin Petermann <martin.petermann@de.ibm.com> | 2009-04-17 09:08:12 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-04-27 11:07:34 -0400 |
commit | 7001f0c4863230dd1560425fa0f5aad9e21716b8 (patch) | |
tree | 33bebe1d590076cf78a19dc813f9b271bf8d72bc | |
parent | c6936e7f34383db2f5038dfa2f0c168ebc2920e5 (diff) |
[SCSI] zfcp: revert previous patch for sbal counting
The current sbal counting can be wrong if a fsf request is
waiting for free sbals and at the same time qdio request queue
is shutdown and re-opened. Revering a previous patch fixes this
issue.
Signed-off-by: Martin Petermann <martin.petermann@de.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r-- | drivers/s390/scsi/zfcp_fsf.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index bd2b23766894..3f365ace7711 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c | |||
@@ -645,30 +645,30 @@ static void zfcp_fsf_exchange_port_data_handler(struct zfcp_fsf_req *req) | |||
645 | } | 645 | } |
646 | } | 646 | } |
647 | 647 | ||
648 | static int zfcp_fsf_req_sbal_get(struct zfcp_adapter *adapter) | 648 | static int zfcp_fsf_sbal_check(struct zfcp_adapter *adapter) |
649 | __releases(&adapter->req_q_lock) | ||
650 | __acquires(&adapter->req_q_lock) | ||
651 | { | 649 | { |
652 | struct zfcp_qdio_queue *req_q = &adapter->req_q; | 650 | struct zfcp_qdio_queue *req_q = &adapter->req_q; |
653 | long ret; | ||
654 | 651 | ||
655 | if (atomic_read(&req_q->count) <= -REQUEST_LIST_SIZE) | 652 | spin_lock_bh(&adapter->req_q_lock); |
656 | return -EIO; | 653 | if (atomic_read(&req_q->count)) |
657 | if (atomic_read(&req_q->count) > 0) | 654 | return 1; |
658 | return 0; | 655 | spin_unlock_bh(&adapter->req_q_lock); |
656 | return 0; | ||
657 | } | ||
658 | |||
659 | static int zfcp_fsf_req_sbal_get(struct zfcp_adapter *adapter) | ||
660 | { | ||
661 | long ret; | ||
659 | 662 | ||
660 | atomic_dec(&req_q->count); | ||
661 | spin_unlock_bh(&adapter->req_q_lock); | 663 | spin_unlock_bh(&adapter->req_q_lock); |
662 | ret = wait_event_interruptible_timeout(adapter->request_wq, | 664 | ret = wait_event_interruptible_timeout(adapter->request_wq, |
663 | atomic_read(&req_q->count) >= 0, | 665 | zfcp_fsf_sbal_check(adapter), 5 * HZ); |
664 | 5 * HZ); | ||
665 | spin_lock_bh(&adapter->req_q_lock); | ||
666 | atomic_inc(&req_q->count); | ||
667 | |||
668 | if (ret > 0) | 666 | if (ret > 0) |
669 | return 0; | 667 | return 0; |
670 | if (!ret) | 668 | if (!ret) |
671 | atomic_inc(&adapter->qdio_outb_full); | 669 | atomic_inc(&adapter->qdio_outb_full); |
670 | |||
671 | spin_lock_bh(&adapter->req_q_lock); | ||
672 | return -EIO; | 672 | return -EIO; |
673 | } | 673 | } |
674 | 674 | ||