Commit 7001f0c4 authored by Martin Petermann's avatar Martin Petermann Committed by James Bottomley

[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: default avatarMartin Petermann <martin.petermann@de.ibm.com>
Signed-off-by: default avatarChristof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent c6936e7f
...@@ -645,30 +645,30 @@ static void zfcp_fsf_exchange_port_data_handler(struct zfcp_fsf_req *req) ...@@ -645,30 +645,30 @@ static void zfcp_fsf_exchange_port_data_handler(struct zfcp_fsf_req *req)
} }
} }
static int zfcp_fsf_req_sbal_get(struct zfcp_adapter *adapter) static int zfcp_fsf_sbal_check(struct zfcp_adapter *adapter)
__releases(&adapter->req_q_lock)
__acquires(&adapter->req_q_lock)
{ {
struct zfcp_qdio_queue *req_q = &adapter->req_q; struct zfcp_qdio_queue *req_q = &adapter->req_q;
long ret;
if (atomic_read(&req_q->count) <= -REQUEST_LIST_SIZE) spin_lock_bh(&adapter->req_q_lock);
return -EIO; if (atomic_read(&req_q->count))
if (atomic_read(&req_q->count) > 0) return 1;
return 0; spin_unlock_bh(&adapter->req_q_lock);
return 0;
}
static int zfcp_fsf_req_sbal_get(struct zfcp_adapter *adapter)
{
long ret;
atomic_dec(&req_q->count);
spin_unlock_bh(&adapter->req_q_lock); spin_unlock_bh(&adapter->req_q_lock);
ret = wait_event_interruptible_timeout(adapter->request_wq, ret = wait_event_interruptible_timeout(adapter->request_wq,
atomic_read(&req_q->count) >= 0, zfcp_fsf_sbal_check(adapter), 5 * HZ);
5 * HZ);
spin_lock_bh(&adapter->req_q_lock);
atomic_inc(&req_q->count);
if (ret > 0) if (ret > 0)
return 0; return 0;
if (!ret) if (!ret)
atomic_inc(&adapter->qdio_outb_full); atomic_inc(&adapter->qdio_outb_full);
spin_lock_bh(&adapter->req_q_lock);
return -EIO; return -EIO;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment