All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Wilck <mwilck@suse.de>
To: Bart Van Assche <bvanassche@acm.org>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	"James E . J . Bottomley" <jejb@linux.vnet.ibm.com>,
	Quinn Tran <qutran@marvell.com>,
	Himanshu Madhani <hmadhani@marvell.com>
Cc: linux-scsi@vger.kernel.org, Martin Wilck <mwilck@suse.com>,
	Daniel Wagner <dwagner@suse.de>,
	Roman Bolshakov <r.bolshakov@yadro.com>
Subject: Re: [PATCH 2/4] qla2xxx: Simplify the code for aborting SCSI commands
Date: Wed, 11 Dec 2019 11:26:47 +0100	[thread overview]
Message-ID: <fae628a795fe71c86deefbf57d52954dad5f96c4.camel@suse.de> (raw)
In-Reply-To: <125b4d82-c579-eab1-ff1f-6df7508dce97@acm.org>

Hi Bart,

On Tue, 2019-12-10 at 15:45 -0500, Bart Van Assche wrote:
> On 12/10/19 3:29 PM, Martin Wilck wrote:
> > On Tue, 2019-12-10 at 12:57 -0500, Bart Van Assche wrote:
> > > On 12/10/19 6:47 AM, Martin Wilck wrote:
> > > > blk_mq_request_started() returns true for requests in
> > > > MQ_RQ_COMPLETE
> > > > state. Is this really an equivalent condition?
> > > > 
> > > > That said, the condition in the current code is sort of
> > > > strange, as
> > > > it's equivalent to !(sp->completed && sp->aborted). I'm
> > > > wondering
> > > > what
> > > > it means if a command is both completed and aborted. Naïvely
> > > > thinking
> > > > (and inferring from the current code) this condition could
> > > > never be
> > > > met, and thus its negation would hold for every command.
> > > > Perhaps
> > > > Quinn
> > > > meant "!(sp->completed || sp->aborted)" ?
> > > 
> > > Hi Martin,
> > > 
> > > The only caller of qla2x00_abort_srb() is
> > > qla2x00_abort_all_cmds().
> > > That
> > > function should only be called after completion interrupts have
> > > been
> > > disabled. In other words, I don't think that we have to worry
> > > about
> > > blk_mq_request_started() encountering the MQ_RQ_COMPLETE state.
> > > No
> > > request should have that state when qla2x00_abort_all_cmds() is
> > > called.
> > 
> > I thought avoiding a race between completion and abort was the
> > whole
> > point of f45bca8c5052 ("scsi: qla2xxx: Fix double scsi_done for
> > abort
> > path"), which introduced the code that you're now changing. But I
> > must
> > be overlooking something then, as Himanshu has acked this.
> 
> Hi Martin,
> 
> My understanding of commit f45bca8c5052 ("scsi: qla2xxx: Fix double
> scsi_done for abort path") is as follows:
> * A long time ago a scsi_done() call was introduced in
> qla2xxx_eh_abort(). Maybe this commit introduced that call:
> 083a469db4ec
> ("[SCSI] qla2xxx: Correct use-after-free oops seen during EH-
> abort.").
> * Calling scsi_done() from qla2xxx_eh_abort() is only fine if the
> firmware does not report a completion after having processed an abort
> request. My conclusion from commit f45bca8c5052 is that the firmware
> does report a completion after having processed an abort request.
> Hence
> the removal of that scsi_done call from qla2xxx_eh_abort().

I think it depends on the scenario in which commands are aborted.
For "regular" aborts, you're certainly right. But in certain scenarios,
e.g. controller removal or module unloading, the current driver shuts
down the firmware early in the shutdown process, and once the firmware
is stopped, I suppose it will not report completions any more.

Whether it was a good idea in the first place to shut down the FW so
early is a different issue, which I tried to adress with the 2 patches
I submitted on Nov. 29th.

Regards,
Martin



  reply	other threads:[~2019-12-11 10:25 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-09 18:02 [PATCH 0/4] qla2xxx patches for kernel v5.6 Bart Van Assche
2019-12-09 18:02 ` [PATCH 1/4] qla2xxx: Check locking assumptions at runtime in qla2x00_abort_srb() Bart Van Assche
2019-12-10 11:06   ` Martin Wilck
2019-12-10 19:39   ` Himanshu Madhani
2019-12-11 19:03   ` Roman Bolshakov
2019-12-09 18:02 ` [PATCH 2/4] qla2xxx: Simplify the code for aborting SCSI commands Bart Van Assche
2019-12-10 11:47   ` Martin Wilck
2019-12-10 17:57     ` Bart Van Assche
2019-12-10 20:29       ` Martin Wilck
2019-12-10 20:45         ` Bart Van Assche
2019-12-11 10:26           ` Martin Wilck [this message]
2019-12-12 16:01     ` Roman Bolshakov
2019-12-10 19:41   ` Himanshu Madhani
2019-12-12 16:04   ` Roman Bolshakov
2019-12-09 18:02 ` [PATCH 3/4] qla2xxx: Fix point-to-point mode for qla25xx and older Bart Van Assche
2019-12-10 10:52   ` Martin Wilck
2019-12-10 18:00     ` Bart Van Assche
2019-12-10 19:44       ` Martin Wilck
2019-12-12 20:07     ` Roman Bolshakov
2019-12-14  1:04       ` Roman Bolshakov
2019-12-15  0:09         ` Bart Van Assche
2019-12-16 11:45           ` Roman Bolshakov
2019-12-16 20:08             ` Roman Bolshakov
2019-12-16  8:37         ` Daniel Wagner
2019-12-10 19:40   ` Himanshu Madhani
2019-12-09 18:02 ` [PATCH 4/4] qla2xxx: Micro-optimize qla2x00_configure_local_loop() Bart Van Assche
2019-12-10 10:46   ` Martin Wilck
2019-12-14 12:30     ` Roman Bolshakov
2019-12-15  0:12     ` Bart Van Assche
2019-12-14 12:33   ` Roman Bolshakov
2019-12-15  0:14     ` Bart Van Assche
2020-02-06 13:23 ` [PATCH 0/4] qla2xxx patches for kernel v5.6 Martin Wilck
2020-02-06 20:49   ` Bart Van Assche
2020-02-06 20:52     ` Martin Wilck
2020-02-06 21:01       ` Bart Van Assche
2020-02-07  9:09         ` Martin Wilck
2020-02-08  3:17           ` Bart Van Assche

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=fae628a795fe71c86deefbf57d52954dad5f96c4.camel@suse.de \
    --to=mwilck@suse.de \
    --cc=bvanassche@acm.org \
    --cc=dwagner@suse.de \
    --cc=hmadhani@marvell.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=mwilck@suse.com \
    --cc=qutran@marvell.com \
    --cc=r.bolshakov@yadro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.