From: Hannes Reinecke <hare@suse.de>
To: James Bottomley <jbottomley@parallels.com>
Cc: Robert Elliot <elliot@hp.com>,
Christoph Hellwig <hch@infradead.org>,
linux-scsi@vger.kernel.org, Hannes Reinecke <hare@suse.de>
Subject: [PATCH 0/2] scanning fixes
Date: Thu, 5 Jun 2014 09:26:41 +0200 [thread overview]
Message-ID: <1401953203-103015-1-git-send-email-hare@suse.de> (raw)
Hi all,
here are two fixes for the scanning logic which resolve two long-standing
issues:
1) We need to send a 'TEST UNIT READY' to the LUN before scanning.
The INQUIRY command does _not_ clear any unit attentions,
so if there are any outstanding unit attention conditions they'll
be attached to the first command after INQUIRY.
Which typically wouldn't be too bad, as most of the commands
are now equipped with at least rudimentary error checking.
However, the problem arises when we're sending a REPORT LUN command
to that LUN. As per spec the REPORT LUN command will _always_
return something, but the list might not be fully populated if
the firmware is still starting up (see SPC for details here).
This will cause us to miss some devices during startup.
Added to that we're not handling the unit attention
'REPORT LUN DATA HAS CHANGED', so the kernel will never be
able to rescan all disks.
To fix this we should be issuing a TEST UNIT READY after
INQUIRY, and wait until any pending unit attention goes away.
2) Power-on/Reset handling
While we're not sending out uevents for various unit attention
conditions, we fail to observe the status precedence as per SAM.
This might cause any 29/XX sense code to effectively overwrite
any preceding unit attentions, causing us to miss those events.
Hence as a minimal fix we need to report the power-on reset
event via uevents, too.
Hannes Reinecke (2):
scsi_scan: Send TEST UNIT READY to the LUN before scanning
scsi: Handle power-on reset unit attention
drivers/scsi/scsi_error.c | 6 ++++
drivers/scsi/scsi_lib.c | 4 +++
drivers/scsi/scsi_scan.c | 86 +++++++++++++++++++++++++++++++++++++++-------
include/scsi/scsi_device.h | 3 +-
4 files changed, 85 insertions(+), 14 deletions(-)
--
1.7.12.4
next reply other threads:[~2014-06-05 7:26 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-05 7:26 Hannes Reinecke [this message]
2014-06-05 7:26 ` [PATCH 1/2] scsi_scan: Send TEST UNIT READY to the LUN before scanning Hannes Reinecke
2014-06-11 13:40 ` Christoph Hellwig
2014-06-11 14:24 ` James Bottomley
2014-06-11 14:33 ` Hannes Reinecke
2014-06-11 14:46 ` James Bottomley
2014-06-11 15:13 ` Hannes Reinecke
2014-06-11 15:25 ` James Bottomley
2014-06-11 15:04 ` Jeremy Linton
2014-09-07 16:24 ` Christoph Hellwig
2014-09-14 8:17 ` Hannes Reinecke
2014-06-05 7:26 ` [PATCH 2/2] scsi: Handle power-on reset unit attention Hannes Reinecke
2014-06-11 12:49 ` Christoph Hellwig
2014-06-11 14:19 ` Ewan Milne
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=1401953203-103015-1-git-send-email-hare@suse.de \
--to=hare@suse.de \
--cc=elliot@hp.com \
--cc=hch@infradead.org \
--cc=jbottomley@parallels.com \
--cc=linux-scsi@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).