Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 73121
b: refs/heads/master
c: 3c887e8
h: refs/heads/master
i:
  73119: 1b96d46
v: v3
  • Loading branch information
Robert Jennings authored and James Bottomley committed Nov 3, 2007
1 parent 985022f commit cd7917f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7e2b19fbc7b9c1fd8ee9c79b375fcedb69dd07c9
refs/heads/master: 3c887e8a1a4553ae6263fc9490e33de213e3746f
19 changes: 14 additions & 5 deletions trunk/drivers/scsi/ibmvscsi/ibmvscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ static int ibmvscsi_send_srp_event(struct srp_event_struct *evt_struct,
unsigned long timeout)
{
u64 *crq_as_u64 = (u64 *) &evt_struct->crq;
int request_status;
int request_status = 0;
int rc;

/* If we have exhausted our request limit, just fail this request,
Expand All @@ -574,6 +574,13 @@ static int ibmvscsi_send_srp_event(struct srp_event_struct *evt_struct,
if (request_status < -1)
goto send_error;
/* Otherwise, we may have run out of requests. */
/* If request limit was 0 when we started the adapter is in the
* process of performing a login with the server adapter, or
* we may have run out of requests.
*/
else if (request_status == -1 &&
evt_struct->iu.srp.login_req.opcode != SRP_LOGIN_REQ)
goto send_busy;
/* Abort and reset calls should make it through.
* Nothing except abort and reset should use the last two
* slots unless we had two or less to begin with.
Expand Down Expand Up @@ -633,7 +640,8 @@ static int ibmvscsi_send_srp_event(struct srp_event_struct *evt_struct,
unmap_cmd_data(&evt_struct->iu.srp.cmd, evt_struct, hostdata->dev);

free_event_struct(&hostdata->pool, evt_struct);
atomic_inc(&hostdata->request_limit);
if (request_status != -1)
atomic_inc(&hostdata->request_limit);
return SCSI_MLQUEUE_HOST_BUSY;

send_error:
Expand Down Expand Up @@ -927,10 +935,11 @@ static int send_srp_login(struct ibmvscsi_host_data *hostdata)
login->req_buf_fmt = SRP_BUF_FORMAT_DIRECT | SRP_BUF_FORMAT_INDIRECT;

spin_lock_irqsave(hostdata->host->host_lock, flags);
/* Start out with a request limit of 1, since this is negotiated in
* the login request we are just sending
/* Start out with a request limit of 0, since this is negotiated in
* the login request we are just sending and login requests always
* get sent by the driver regardless of request_limit.
*/
atomic_set(&hostdata->request_limit, 1);
atomic_set(&hostdata->request_limit, 0);

rc = ibmvscsi_send_srp_event(evt_struct, hostdata, init_timeout * 2);
spin_unlock_irqrestore(hostdata->host->host_lock, flags);
Expand Down

0 comments on commit cd7917f

Please sign in to comment.