From: Douglas Gilbert <dgilbert@interlog.com>
To: SCSI development list <linux-scsi@vger.kernel.org>,
linux-ide@vger.kernel.org
Cc: moverby@nvidia.com
Subject: SAT-2 and DSENSE
Date: Thu, 30 Jul 2009 15:50:05 -0400 [thread overview]
Message-ID: <4A71F96D.3090807@interlog.com> (raw)
The SCSI to ATA Translation 2 (SAT-2) project is in the
technical review stage pending standardization at
www.t10.org. In the last month a change has been added
which will break existing user space code (e.g. smartmontools).
The area of concern is the ATA return descriptor and the
newly introduced "Fixed format sense data" (sat2r08b.pdf
section 12.2.7). SAT code has been in the kernel (libata)
since 2005 and roughly complies the original SAT standard
(ANSI INCITS 431-2007). There has been an anomaly between
the way DSENSE in the control mode page of SPC-3 is defined
and the fact that parts of SAT-1 act as if it was always
set. So no matter that libata-scsi.c actually sets the DSENSE
bit to 0 (line 101 libata-scsi.c in lk 2.6.30), the ATA
PASS-THROUGH COMMANDs will yield descriptor sense format if
requested (e.g. by the CK_COND bit).
The non backwardly compatible SAT-2 change is that when
DSENSE=0, the newly introduced "Fixed format sense data"
should be generated by the SAT layer (SATL). ***
The code in libata-scsi.c is a SATL which we control.
However there are lots of other SATLs out there that
are not controlled by the kernel (e.g. a SATA disk in an
external USB, SAS, FC or iSCSI enclosure). That leaves
a bit of a mess in the hands of applications like
smartmontools that is fixable. Existing versions of
smartmontools will break if a SATL complying with SAT-2
sets DSENSE=0 (and my guess is most do).
I was thinking of sending a patch to change libata's setting
of DSENSE to 1 but that implies that all "normal" SCSI
commands (e.g. READ, WRITE and READ CAPACITY) would also
return descriptor sense data. So the patch would need to
include generation of descriptor format sense data where
required. That might upset some applications.
As a side note, sooner or later SCSI block devices (including
SATA devices behind libata's SATL) will need to use descriptor
sense format because the Information field in the fixed sense
data format is only 32 bits. As an example: the Information
field is used for the first failed LBA of a medium error.
For 512 byte sectors 32 bits gets as far as 2 TB.
*** If libata complies with SAT-2 DSENSE=0 handling it should
probably also handle PROTOCOL="Return response information"
properly as well. [It ignores it currently.]
Doug Gilbert
next reply other threads:[~2009-07-30 19:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-30 19:50 Douglas Gilbert [this message]
[not found] <C6974AD5.164CA%moverby@nvidia.com>
2009-07-30 20:10 ` SAT-2 and DSENSE Mark Overby
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=4A71F96D.3090807@interlog.com \
--to=dgilbert@interlog.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=moverby@nvidia.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).