linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RE: libata for SATA HDs.
@ 2005-08-10 18:42 Timothy Thelin
  2005-08-11  3:21 ` Jeff Garzik
  0 siblings, 1 reply; 12+ messages in thread
From: Timothy Thelin @ 2005-08-10 18:42 UTC (permalink / raw)
  To: Mark Lord, James Courtier-Dutton; +Cc: Jeff Garzik, linux-ide


>>>>> Yes, but only if you manually apply the "libata-passthru" patch.
>>>>
>>>> So, why hasn't that patch got into the kernel?
>>>
>>> Because there are several reports of it causing problems, when used on a
>>> loaded system.

> Please post more information about these "problems".

> I wonder if it might be another occurance of the libata eh lockups.
> Those are NOT unique to ATAPI -- the lockups can happen anytime
> the libata eh code is run, like on a busy RAID, or "loaded system"
> suffering failed "passthru" commands.
>
> Perhaps kill a couple of birds with one stone, if we're lucky.

I figured I should give my $.02 =)

I've noticed some bugs with the passthru implementation and have been
working on some fixes using a custom slax live cd.  I'm in the process of
fixing and creating multiple patches, which I was going to post to this
list.

In particular this is what I've found so far:
1) The sense buffer returned when the "check condition" bit is active is
incorrect
   - The status and error registers values returned are the command and
features registers sent in (they never get updated from the device after the
command is done).
   - The additional length field is 14 but it should be 12
2) The offline bit is ignored
3) The length fields are ignored
4) Not all the cdb protocols are implemented


Item 1: This is trivial to fix (note that the bug also exists when
generating the fixed length sense buffer)
Item 2: This is important for lower level vendor commands, and its inclusion
helps mean the difference between staying in linux or rebooting to dos.
Companies / Users are becomming less inclined to do the latter =)
Item 3: I don't know how important 3 is to fix considering you will have the
scsi layer's length info in addition to the cdbs length info.  Maybe just a
check to make sure they match, and if they don't, abort the cdb.
Item 4: Considering the passthru spec lists all the protocols, they should
get implemented.  Otherwise apps wanting to use the passthru mechanism are
going to be blind that protocols are not implemented.  Alternatively, there
could be a way to (1) identify the backend is libata so it can be
special-cased (maybe a "get version" ioctl), and (2) have a means to probe
libata to find out what is and is not implemented at runtime (maybe extra
information on the "get version" ioctl).


Btw I have not experienced any stability issues with the passthru
implmentation, just bugs or missing implementations.

Thanks,
Tim Thelin

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: libata for SATA HDs.
@ 2005-08-12  1:04 Douglas Gilbert
  0 siblings, 0 replies; 12+ messages in thread
From: Douglas Gilbert @ 2005-08-12  1:04 UTC (permalink / raw)
  To: linux-ide

Mark Lord wrote:
> James Courtier-Dutton wrote:
>
>> Google did not help me.
>>
>> Can I use the kernel libata and do commands like this now? :
>> hdparm -S60 /dev/sda
>
>
> Yes, but only if you manually apply the "libata-passthru" patch.
<snip>

For those occasions when libata is one box removed
(e.g. sitting in an enclosure) there is a SCSI way
to do "hdparm -S60" (i.e. set standby timer to 300
seconds). That is via the Power Condition mode page.
Changing the relevant fields in that mode page requires
libata to implement the SCSI MODE SELECT command.
Once that command is implemented the Writeback Cache
Enable (WCE) bit in the Caching mode page could also
be controlled.
With MODE SELECT implemented in libata, the equivalent
to "hdparm -S60" would be more longwinded:
  sdparm -s STANDBY=1,SCT=3000 /dev/sda

Jeff has just accepted a patch into libata to implement
the START STOP UNIT SCSI command. So soon it will be
possible to place a SATA disk in standby mode immediately
with:
  sdparm -C stop /dev/sda
Any media access command (or "sdparm -C start") will spin
it up again.

Also the SCSI-ATA Translation draft (SAT) defines two
SCSI commands to pass-through ATA commands. smartmontools
could be made to use these (with an option similar to
"-d ata").
A while back Jeff had some patches for those SCSI
pass-through ATA commands but they don't seem to have
made it into the mainline libata.

Doug Gilbert

^ permalink raw reply	[flat|nested] 12+ messages in thread
[parent not found: <42EEA9D5.5080304@superbug.demon.co.uk>]

end of thread, other threads:[~2005-08-12  1:04 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-10 18:42 libata for SATA HDs Timothy Thelin
2005-08-11  3:21 ` Jeff Garzik
  -- strict thread matches above, loose matches on Subject: below --
2005-08-12  1:04 Douglas Gilbert
     [not found] <42EEA9D5.5080304@superbug.demon.co.uk>
2005-08-09 13:40 ` Mark Lord
2005-08-09 17:01   ` Erik Slagter
2005-08-09 17:55   ` James Courtier-Dutton
2005-08-09 18:04     ` Jeff Garzik
2005-08-09 22:27       ` James Courtier-Dutton
2005-08-10  2:28         ` Mark Lord
2005-08-09 18:18   ` Erik Slagter
2005-08-09 20:04     ` Mark Lord
2005-08-10  7:41       ` Erik Slagter

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).