public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <michaelc@cs.wisc.edu>
To: "ravi.anand" <ravi.anand@qlogic.com>
Cc: James Bottomley <james.bottomley@suse.de>,
	Linux-SCSI Mailing List <linux-scsi@vger.kernel.org>,
	Karen Higgins <karen.higgins@qlogic.com>,
	Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Subject: Re: [PATCH 06/11] qla4xxx: added srb referance counter
Date: Thu, 11 Feb 2010 18:48:12 -0600	[thread overview]
Message-ID: <4B74A54C.5030100@cs.wisc.edu> (raw)
In-Reply-To: <4B7498A5.4040307@cs.wisc.edu>

On 02/11/2010 05:54 PM, Mike Christie wrote:
> It seems like you would want to do
>

Maybe one more fix.


> qla4xxx_wait_for_hba_online()
> spin_lock_irqsave(&ha->hardware_lock, flags);
>
> srb = (struct srb *) cmd->SCp.ptr;
> if (!srb)
> /* raced while waiting for hba online */
> return SUCCESS;
>
> /* Get a reference to the sp and drop the lock.*/
> sp_get(srb);
> spin_unlock_irqrestore(&ha->hardware_lock, flags);
> qla4xxx_abort_task()

 From what I can tell, we used to call qla4xxx_srb_compl (and now do the 
final sp_put in the normal completion path) while holding the 
hardware_lock. If this is not the case then the loop in the eh abort 
patch is racey and my pseudo code above is too).

If I am right, then I think here we want to do

spin_lock_irqsave(&ha->hardware_lock, flags);
sp_put(ha, srb);

So it is consistent with the other code, and then I think we want to add 
a comment in sp_put() that we should be holing the hardware_lock when 
calling it.


> sp_put(ha, srb)
> spin_lock_irqsave(&ha->hardware_lock, flags);
>
> qla4xxx_eh_wait_on_command(ha, cmd);
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html


  parent reply	other threads:[~2010-02-12  0:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-30  6:28 [PATCH 06/11] qla4xxx: added srb referance counter Ravi Anand
2010-02-01 18:22 ` Mike Christie
2010-02-11 11:08   ` Ravi Anand
2010-02-11 22:57     ` Mike Christie
2010-02-11 23:02       ` Mike Christie
     [not found]         ` <0CB616B0-0903-41A0-9ADD-5DD64989FFD1@qlogic.com>
2010-02-11 23:54           ` Mike Christie
2010-02-12  0:06             ` Mike Christie
2010-02-12  0:48             ` Mike Christie [this message]
2010-02-12 17:29     ` Mike Christie
2010-02-12 18:19       ` James Bottomley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B74A54C.5030100@cs.wisc.edu \
    --to=michaelc@cs.wisc.edu \
    --cc=james.bottomley@suse.de \
    --cc=karen.higgins@qlogic.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=ravi.anand@qlogic.com \
    --cc=vikas.chaudhary@qlogic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox