From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Tejun Heo <tj@kernel.org>
Cc: Matthias Prager <linux@matthiasprager.de>,
Robert Trace <maillist@farcaster.org>,
linux-scsi@vger.kernel.org, Jens Axboe <jaxboe@fusionio.com>,
Eric Moore <Eric.Moore@lsi.com>, Alan <alan@lxorguk.ukuu.org.uk>,
"Darrick J. Wong" <djwong@us.ibm.com>,
linux-ide@vger.kernel.org
Subject: Re: 'Device not ready' issue on mpt2sas since 3.1.10
Date: Wed, 25 Jul 2012 18:19:13 +0400 [thread overview]
Message-ID: <1343225953.12094.55.camel@dabdike> (raw)
In-Reply-To: <20120722173146.GE5144@dhcp-172-17-108-109.mtv.corp.google.com>
On Sun, 2012-07-22 at 10:31 -0700, Tejun Heo wrote:
> Hello,
>
> On Sat, Jul 21, 2012 at 02:15:56PM +0200, Matthias Prager wrote:
> > Now I'm not sure this isn't taping over another bug. Which leads me to
> > my question: What is the correct behavior?
> >
> > #1 Issuing a separate spin-up command (START UNIT?) prior to sending i/o
> > by setting allow_restart=1 for sata disks on sas controllers
> >
> > or
> >
> > #2 Teaching the sas drivers they do not need spin-up commands and can
> > simply start issuing i/o to sata disks
>
> I haven't consulted SAT but it seems like a bug in SAS driver or
> firmware. If it's a driver bug, we better fix it there. If a
> firmware bug, working around those is one of major roles of drivers,
> so I think setting allow_restart is fine.
Actually, I don't think so. SAT-2 section 8.12.2 does say
if the device is in the stopped state as the result of
processing a START STOP UNIT command (see 9.11), then the SATL
shall terminate the TEST UNIT READY command with CHECK CONDITION
status with the sense key set to NOT READY and the additional
sense code of LOGICAL UNIT NOT READY, INITIALIZING COMMAND
REQUIRED;
START STOP UNIT (with START=0) translates to STANDBY IMMEDIATE, and
that's what hdparm -y issues. We don't see this in /drivers/ata because
TEST UNIT READY always returns success.
So it looks like the mpt2sas SAT is doing the correct thing and we only
don't see this problem in normal SATA devices because of a bug in the
libata-scsi SAT.
However, the kernel log
Apr 04 22:55:10 [kernel] sd 1:0:1:0: [sdj] Device not ready
Apr 04 22:55:10 [kernel] sd 1:0:1:0: [sdj] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
Apr 04 22:55:10 [kernel] sd 1:0:1:0: [sdj] Sense Key : Not Ready [current]
Apr 04 22:55:10 [kernel] sd 1:0:1:0: [sdj] Add. Sense: Logical unit not ready, initializing command required
Apr 04 22:55:10 [kernel] sd 1:0:1:0: [sdj] CDB: Write(10): 2a 00 57 54 52 3f 00 00 08 00
Indicates we got the NOT READY to a non-TUR command, so I suspect what's
happening is that sending the TUR causes the SAT to remember the standby
state and respond NOT READY to all subsequent commands. However, if we
just send an ordinary command, not a TUR, it quietly wakes the drive and
we don't see any problems.
There is support in SAT for this behaviour because there's a note on the
START STOP UNIT command saying
After returning GOOD status for a START STOP UNIT command with
the START bit set to zero, the SATL shall consider the ATA
device to be in the Stopped power state (see SBC-2)
Which in SCSI terms would mean return NOT READY to any subsequent
commands.
Can someone verify this is indeed what the mpt2sas HBA is doing?
James
next prev parent reply other threads:[~2012-07-25 14:19 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-22 11:19 'Device not ready' issue on mpt2sas since 3.1.10 Matthias Prager
2012-07-09 14:40 ` Matthias Prager
2012-07-09 19:37 ` Robert Trace
2012-07-09 20:45 ` Darrick J. Wong
2012-07-09 22:24 ` Robert Trace
2012-07-10 0:21 ` Matthias Prager
2012-07-10 1:56 ` Robert Trace
2012-07-10 16:54 ` Darrick J. Wong
2012-07-10 0:12 ` Matthias Prager
2012-07-10 1:51 ` Robert Trace
2012-07-10 23:27 ` Robert Trace
2012-07-11 12:19 ` Matthias Prager
2012-07-11 13:48 ` Matthias Prager
2012-07-17 18:09 ` Tejun Heo
2012-07-17 19:39 ` Matthias Prager
2012-07-17 20:01 ` Tejun Heo
2012-07-21 12:15 ` Matthias Prager
2012-07-22 17:31 ` Tejun Heo
2012-07-22 23:14 ` Matthias Prager
2012-07-23 15:26 ` Tejun Heo
2012-07-24 22:04 ` Matthias Prager
2012-07-25 10:26 ` Reddy, Sreekanth
2012-07-25 14:19 ` James Bottomley [this message]
2012-07-25 17:17 ` Tejun Heo
2012-07-25 19:55 ` James Bottomley
2012-07-25 23:56 ` Matthias Prager
2012-07-26 19:16 ` Robert Trace
2012-08-16 18:26 ` Robert Trace
2012-08-16 20:24 ` Matthias Prager
2012-08-16 20:33 ` Robert Trace
2012-07-25 22:35 ` tomm
2012-07-26 19:20 ` Robert Trace
2012-07-09 22:08 ` NeilBrown
2012-07-10 0:03 ` Matthias Prager
-- strict thread matches above, loose matches on Subject: below --
2015-11-27 10:28 Felix Matouschek
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=1343225953.12094.55.camel@dabdike \
--to=james.bottomley@hansenpartnership.com \
--cc=Eric.Moore@lsi.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=djwong@us.ibm.com \
--cc=jaxboe@fusionio.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linux@matthiasprager.de \
--cc=maillist@farcaster.org \
--cc=tj@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).