Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: mr.nuke.me@gmail.com (Alex G.)
Subject: [PATCH] nvme-pci: Skip queue deletion if there are no queues
Date: Wed, 28 Mar 2018 16:02:01 -0500	[thread overview]
Message-ID: <a799ef7c-22af-24c2-8c14-bc5d0672bdeb@gmail.com> (raw)
In-Reply-To: <20180328202240.GK13039@localhost.localdomain>

On 03/28/2018 03:22 PM, Keith Busch wrote:
> On Wed, Mar 28, 2018@03:13:37PM -0500, Alex G. wrote:
>> Which branch am I supposed to be using to test this? It doesn't apply to
>> mainline.
> 
> This is targeted to the 4.17 staging trees (sorry, this doesn't seem to
> be a good 4.16 candidate this late in the game). This should apply on
> linux-block for-4.17/block here:
> 
>   https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git/log/?h=for-4.17/block

Then I should probably test with that.
Tested-by: Alex Gagniuc <Alex_Gagniuc at Dellteam.com>

So I see the check is really meant to protect dereferencing
&dev->queues[0] in nvme_disable_admin_queue(). My previous comment is
still valid then. Successfully tested this approach as well.

Thanks for the quick turn-around.

Alex

> 
> A 4.16 port would would like this:
> 
> ---
> diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
> index b6f43b738f03..2459067d208b 100644
> --- a/drivers/nvme/host/pci.c
> +++ b/drivers/nvme/host/pci.c
> @@ -2194,7 +2194,7 @@ static void nvme_dev_disable(struct nvme_dev *dev, bool shutdown)
>  	 * Give the controller a chance to complete all entered requests if
>  	 * doing a safe shutdown.
>  	 */
> -	if (!dead) {
> +	if (!dead && dev->ctrl.queue_count > 0) {
>  		if (shutdown)
>  			nvme_wait_freeze_timeout(&dev->ctrl, NVME_IO_TIMEOUT);
>  
> --
> 

  reply	other threads:[~2018-03-28 21:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-28 18:04 [PATCH] nvme-pci: Skip queue deletion if there are no queues Keith Busch
     [not found] ` <e872954fedc943c08ef11451679d5a2c@AUSX13MPS305.AMER.DELL.COM>
2018-03-28 20:13   ` Alex G.
2018-03-28 20:22     ` Keith Busch
2018-03-28 21:02       ` Alex G. [this message]
2018-04-04 13:00 ` Sagi Grimberg

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=a799ef7c-22af-24c2-8c14-bc5d0672bdeb@gmail.com \
    --to=mr.nuke.me@gmail.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