Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: keith.busch@intel.com (Keith Busch)
Subject: [PATCH] NVMe: Skip orderly shutdown on failed devices
Date: Wed, 25 Jun 2014 11:06:56 -0600 (MDT)	[thread overview]
Message-ID: <alpine.LRH.2.03.1406251055290.4699@AMR> (raw)
In-Reply-To: <20140625123717.GR12025@linux.intel.com>

On Wed, 25 Jun 2014, Matthew Wilcox wrote:
> On Mon, Jun 23, 2014@11:46:35AM -0600, Keith Busch wrote:
>> Rather than skipping shutdown only for device's that have been removed,
>> skip the orderly shutdown on failed devices to avoid the long timeout
>> handling that inevitably happens when deleting queues on such a device.
>
> How about this instead?

Yes, that's much better.

I also just encountered a device that dropped the ready bit. I'm not
sure why, but the device definitely wasn't ready to do anything, so I
can add the check and skip shutdown there as well.

> @@ -2500,11 +2500,14 @@ static void nvme_dev_list_remove(struct nvme_dev *dev)
> static void nvme_dev_shutdown(struct nvme_dev *dev)
> {
>        int i;
> +       u32 csts = -1;
>
>        dev->initialized = 0;
>        nvme_dev_list_remove(dev);
> +       if (dev->bar)
> +               csts = readl(&dev->bar->csts);
>
> -       if (!dev->bar || (dev->bar && readl(&dev->bar->csts) == -1)) {
> +       if (csts & NVME_CSTS_CFS) {
>                for (i = dev->queue_count - 1; i >= 0; i--) {
>                        struct nvme_queue *nvmeq = raw_nvmeq(dev, i);
>                        nvme_suspend_queue(nvmeq);

      reply	other threads:[~2014-06-25 17:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-23 17:46 [PATCH] NVMe: Skip orderly shutdown on failed devices Keith Busch
2014-06-25 12:37 ` Matthew Wilcox
2014-06-25 17:06   ` Keith Busch [this message]

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=alpine.LRH.2.03.1406251055290.4699@AMR \
    --to=keith.busch@intel.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