From: keith.busch@intel.com (Keith Busch)
Subject: [PATCH 3/9] NVMe: Fail device if unresponsive during init
Date: Thu, 19 Sep 2013 15:25:19 -0600 (MDT) [thread overview]
Message-ID: <alpine.LRH.2.03.1309191440330.31457@AMR> (raw)
In-Reply-To: <20130919202957.GH4668@linux.intel.com>
On Thu, 19 Sep 2013, Matthew Wilcox wrote:
> On Thu, Sep 05, 2013@02:45:09PM -0600, Keith Busch wrote:
>> - if (res)
>> + if (res) {
>> + if (res < 0)
>> + goto out_free;
>> continue;
>> + }
> Feels a little klunky. How about:
>
> res = nvme_identify(dev, i, 0, dma_addr);
> - if (res)
> + if (res < 0)
> + goto out_free;
> + else if (res)
> continue;
Aha, that is much more pleasent.
>> res = nvme_get_features(dev, NVME_FEAT_LBA_RANGE, i,
>> dma_addr + 4096, NULL);
>> - if (res)
>> + if (res) {
>> + if (res < 0)
>> + goto out_free;
>> memset(mem + 4096, 0, 4096);
>> + }
>
> I don't know if we need to do this. Consider a hypothetical device that
> has a broken get_features, but everything else works fine. We can still
> use that device just fine. Contrariwise, if the device happens to break
> between issuing the identify and get_features, we'll still error out
> really soon afterwards.
The fault is really on the hardware in such a scenario (get features
support is mandatory), but I'm not sure we want to do what you're
suggesting. It will take 1 minute per namespace before completing probe so
a user could be waiting a very long time for a driver to load. This would
also leak command id's and we only have 64 of them; if the device has
more than 64 namespaces, modprobe blocks forever on alloc_cmdid_killable
until a user kills the task which may not be possible if this is happening
on boot.
next prev parent reply other threads:[~2013-09-19 21:25 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-05 20:45 [PATCH 0/9] NVMe: Error handling Keith Busch
2013-09-05 20:45 ` [PATCH 1/9] NVMe: Merge issue on character device bring-up Keith Busch
2013-09-05 21:23 ` John Utz
2013-09-05 22:21 ` Keith Busch
2013-09-05 22:47 ` John Utz
2013-09-05 23:23 ` Keith Busch
2013-09-05 20:45 ` [PATCH 2/9] NVMe: Differentiate commands not completed Keith Busch
2013-09-05 20:45 ` [PATCH 3/9] NVMe: Fail device if unresponsive during init Keith Busch
2013-09-19 20:29 ` Matthew Wilcox
2013-09-19 21:25 ` Keith Busch [this message]
2013-09-05 20:45 ` [PATCH 4/9] NVMe: Reset failed controller Keith Busch
2013-09-05 20:45 ` [PATCH 5/9] NVMe: Abort timed out commands Keith Busch
2013-09-05 20:45 ` [PATCH 6/9] NVMe: User initiated controller reset Keith Busch
2013-09-05 20:45 ` [PATCH 7/9] NVMe: Add shutdown pci callback Keith Busch
2013-09-05 20:45 ` [PATCH 8/9] NVMe: Set queue db only when queue is initialized Keith Busch
2013-09-05 20:45 ` [PATCH 9/9] NVMe: Don't wait for delete queues to complete Keith Busch
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.1309191440330.31457@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;
as well as URLs for NNTP newsgroup(s).