linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: thomas schorpp <t.schorpp@gmx.de>
To: Timothy Thelin <Timothy.Thelin@wdc.com>
Cc: Alan Stern <stern@rowland.harvard.edu>,
	usb-storage@lists.one-eyed-alien.net, linux-ide@vger.kernel.org
Subject: Re: [usb-storage] [Merging ATA passthru] on integrating SMART/ATA-Security in usb-storage driver
Date: Thu, 03 Nov 2005 00:22:32 +0100	[thread overview]
Message-ID: <43694A38.2060908@gmx.de> (raw)
In-Reply-To: <CA45571DE57E1C45BF3552118BA92C9D69BF3A@WDSCEXBECL03.sc.wdc.com>

Timothy Thelin wrote:
> 
>>>>They aren't ATA read/write commands; they are SCSI commands.  
>>>>If there is 
>>>>a version of SMART that runs over SCSI, you might be able to use it.
>>>>
>>>>
>>>>
>>>>>and sata is short of smart support. both use scsi-emu(?).
>>>>>
>>>>>i dont think theres a hardware problem.
>>>>
>>>>Yes there is.  The USB interface on the drive won't recognize 
>>>>an ATA SMART
>>>>command and won't pass it on to the drive controller.
>>>>
>>>
>>>
>>>To expand on this, its really the USB device firmware which needs
>>>the passthru mechanism implmented, since (as stated) it expects
>>>to be getting scsi commands.  Now there are many vendor specific
>>>ways to embed ATA commands inside of scsi cdbs, and then there are
>>>two public methods that I'm aware of: SAT and the At2lp (cypress
>>>bridge board, docs on their website).
>>>
>>>And to send these commands, user-space already has SG_IO.
>>>

hmm, sg_mod is not loaded here on usb2 disk init...

sd_mod                 16144  0
usb_storage            63360  0
scsi_mod              130856  2 sd_mod,usb_storage

trying manual loading...

>>
>>so sg3_utils and sdparm could be used for commands(?)
>> 
> 
> 
> If those utilites understood the ATACB and SAT cdb specifications,
> they could be made to do security / smart commands by using SG_IO.
> My current understanding is that those utilities only think in
> terms of scsi, and not in terms of ATA passthru.

yes.

> 
> I have hands on experience using SG_IO to send ATACB cdbs to usb
> devices to do various things.  ATACB allows you to do most ATA
> commands, and it works pretty well.

great.

> 
> The biggest issue is that because USB device are exported to
> SCSI core as scsi2 devices, SCSI core adds LUN info into the
> cdb which messes up the ATACB signature and causes the bridge
> to reject the command (this will be a SAT passthru issue
> as well). When wanting to do ATACB I had to patch the kernel
> to stop this behavior so that the cdb would pass through the
> system unmangled.
> 
> If you had time to spare, instead of touching usb-storage,
> it might be better spent resurecting SG_FLAG_LUN_INHIBIT to
> stop the above behavior so that SG_IO cdbs can be passed
> through untouched.
> (SG_FLAG_FUN_INHIBIT was a flag SG_IO used to support a long
> time ago, and I have no idea why it was dropped, but it was)
> 

as you said, no need to touch usb-storage.

thx for the advise :)

ill try on resurecting SG_FLAG_LUN_INHIBIT if no one vetos (dont want to
break other stuff maybe using this behaviour).

> 
> Regards,
> Tim Thelin

y
tom


  reply	other threads:[~2005-11-02 23:22 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-02 22:18 [usb-storage] [Merging ATA passthru] on integrating SMART/ATA-Security in usb-storage driver Timothy Thelin
2005-11-02 23:22 ` thomas schorpp [this message]
2005-11-02 23:45 ` Matthew Dharm
2005-11-04  4:08   ` James Bottomley
2005-11-04 17:28     ` Matthew Dharm
2005-11-04 18:33       ` James Bottomley
2005-11-04 20:30         ` Matthew Dharm
2005-11-04 20:53           ` James Bottomley
  -- strict thread matches above, loose matches on Subject: below --
2005-11-08 19:50 Timothy Thelin
2005-11-09  9:04 ` thomas schorpp
2005-11-09  9:45   ` thomas schorpp
2005-11-09 10:05     ` thomas schorpp
2005-11-09 13:21     ` Mark Lord
2005-11-09 14:05       ` thomas schorpp
2005-11-07 20:18 Timothy Thelin
2005-11-07 17:51 Timothy Thelin
2005-11-04 18:30 Timothy Thelin
2005-11-04 18:58 ` James Bottomley
2005-11-04 20:30   ` Matthew Dharm
2005-11-04 20:49     ` James Bottomley
2005-11-05 23:55       ` Matthew Dharm
2005-11-06  0:49         ` James Bottomley
2005-11-06  3:38           ` thomas schorpp
2005-11-06 21:58           ` Matthew Dharm
2005-11-06 22:28             ` thomas schorpp
2005-11-06 23:52               ` Patrick Mansfield
2005-11-07 16:59                 ` Matthew Dharm
2005-11-07 17:05                 ` Matthew Dharm
2005-11-07 17:24                   ` Patrick Mansfield
2005-11-07 17:46                     ` Alan Stern
2005-11-07 18:06                       ` thomas schorpp
2005-11-07 19:33                         ` Alan Stern
2005-11-07 20:07                           ` thomas schorpp
2005-11-07 17:53                     ` Christoph Hellwig
2005-11-07 17:54                     ` thomas schorpp
2005-11-07 18:57                       ` Patrick Mansfield
2005-11-07 19:53                         ` Alan Stern
2005-11-07 20:47                           ` Patrick Mansfield
2005-11-07 20:59                             ` Alan Stern
2005-11-07 22:05                               ` James Bottomley
2005-11-08 17:09                                 ` Alan Stern
2005-11-08 23:05                                   ` Mike Anderson
2005-11-09 15:35                                     ` Alan Stern
2005-11-06 23:15             ` James Bottomley
2005-11-07 18:14         ` Patrick Mansfield
2005-11-04 23:56     ` Andries Brouwer
2005-11-04 23:46 ` Pete Zaitcev
2005-11-05 16:20   ` thomas schorpp
2005-11-02 20:33 Timothy Thelin
2005-11-02 21:55 ` thomas schorpp
2005-11-02 14:08 thomas schorpp
2005-11-02 16:05 ` [usb-storage] " Alan Stern
2005-11-02 19:12   ` thomas schorpp
2005-11-02 19:26     ` Alan Stern
2005-11-02 20:41       ` thomas schorpp

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=43694A38.2060908@gmx.de \
    --to=t.schorpp@gmx.de \
    --cc=Timothy.Thelin@wdc.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    --cc=usb-storage@lists.one-eyed-alien.net \
    /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).