From: Matthew Wilcox <willy@linux.intel.com>
To: "Desai, Kashyap" <Kashyap.Desai@lsi.com>
Cc: Matthew Wilcox <matthew@wil.cx>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
DL-MPT Fusion Linux <DL-MPTFusionLinux@lsi.com>,
"nab@linux-iscsi.org" <nab@linux-iscsi.org>
Subject: Re: [PATCH] mpt2sas: Remove queuecommand wrapper
Date: Tue, 5 Jul 2011 11:21:43 -0400 [thread overview]
Message-ID: <20110705152143.GB4061@linux.intel.com> (raw)
In-Reply-To: <B2FD678A64EAAD45B089B123FDFC3ED70157E70F4A@inbmail01.lsi.com>
On Tue, Jul 05, 2011 at 08:25:43PM +0530, Desai, Kashyap wrote:
> > > e.a if scsih_qcmd_xxx has executed half of the code and (due to preemption is not \
> > > disable for the same CPU), Scheduler can execute any other process on the SAME cpu \
> > > (Though IRQ is disable). Consider Error handling is kicked off on the same CPU and as \
> > > part of EH, it executed HBA reset. As part of HBA reset Driver has return back all \
> > > pending Scsi command to mid-layer, and once control come back to original \
> > > scsih_qcmd_xxx LLD drive will see bad results (Kernel crash/Data corruption/h/w hung \
> > > or anything critical.....)
> >
> > I don't believe this scenario can happen. Error handling will not
> > commence until all commands are returned to the midlayer, which requires
> > that queuecommand is no longer running.
>
> I was able to see this scenario when I intially started doing code review. Since host_lock is removed Error handling can remove code from queuecommand anytime ( I asssume preemption is not disable, only IRQ is disable).. I am almost sure if we are planning to remove host_lock from SML, we at least need irq and preemption disable for mpt2sas and mptfusion to work properly.
I'm pretty sure that can't happen. Look:
void scsi_eh_wakeup(struct Scsi_Host *shost)
{
if (shost->host_busy == shost->host_failed) {
trace_scsi_eh_wakeup(shost);
wake_up_process(shost->ehandler);
So the SCSI error handler doesn't run until host_busy == host_failed.
host_busy is incremented in scsi_request_fn() (before scsi_dispatch_cmd
is called). host_failed is incremented in scsi_eh_scmd_add(). So after
a command has been issued, it prevents the EH from running until it
too fails. That means queuecommand cannot be running at the same time
as the EH.
That's documented in Documentation/scsi/scsi_eh.txt section [1-3].
next prev parent reply other threads:[~2011-07-05 15:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-04 19:27 [PATCH] mpt2sas: Remove queuecommand wrapper Matthew Wilcox
2011-07-05 4:46 ` Desai, Kashyap
2011-07-05 14:14 ` Matthew Wilcox
2011-07-05 14:55 ` Desai, Kashyap
2011-07-05 15:21 ` Matthew Wilcox [this message]
2011-07-05 17:18 ` Desai, Kashyap
2011-07-05 20:24 ` Matthew Wilcox
2011-07-06 18:00 ` Dan Williams
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=20110705152143.GB4061@linux.intel.com \
--to=willy@linux.intel.com \
--cc=DL-MPTFusionLinux@lsi.com \
--cc=Kashyap.Desai@lsi.com \
--cc=linux-scsi@vger.kernel.org \
--cc=matthew@wil.cx \
--cc=nab@linux-iscsi.org \
/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