linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Lord <mlord@pobox.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Jonas Schwertfeger <jschwertfeger@gmail.com>,
	Sarah Sharp <sarah.a.sharp@linux.intel.com>,
	Dinh.Nguyen@freescale.com, Sergei Shtylyov <sshtylyov@mvista.com>,
	James Bottomley <James.Bottomley@suse.de>,
	Kay Sievers <kay.sievers@vrfy.org>,
	David Zeuthen <david@fubar.dk>,
	linux-hotplug@vger.kernel.org, linux-usb@vger.kernel.org,
	USB Storage List <usb-storage@lists.one-eyed-alien.net>,
	Matthew Dharm <mdharm-usb@one-eyed-alien.net>,
	linux-scsi@vger.kernel.org,
	Lennart Poettering <lennart@poettering.net>,
	Douglas Gilbert <dgilbert@interlog.com>
Subject: Re: System hangs when using USB 3.0 HD with on Ubuntu
Date: Wed, 12 May 2010 12:56:35 +0000	[thread overview]
Message-ID: <4BEAA583.1090805@pobox.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1005111022130.1834-100000@iolanthe.rowland.org>

On 11/05/10 10:44 AM, Alan Stern wrote:
> On Tue, 11 May 2010, Jonas Schwertfeger wrote:
>
>> On 05/07/2010 05:03 PM, Alan Stern wrote:
>>> Hmm.  I'm not sure I believe this data.  For a while (starting with
>>> 2.6.33) the usbmon implementation didn't work right with EHCI -- it
>>> looked in the transfer buffer before the DMA-unmapping was done, so on
>>> a system with>= 4 GB of memory it wouldn't always see the data.  The
>>> fix for this was merged only within the last week or so.
>>>
>>> Can you repeat the USB-2.0 test but this time doing "rmmod ehci-hcd"
>>> beforehand?
>>
>> I could not remove that module (I assume it is compiled into the kernel)
>> so I limited the memory the kernel can see to 1GB.  You were right, now
>> there is actually useful data in the trace.  Here it is:
>
> Great!  This is just what we need.
>
>> ffff88001bb82840 685088867 S Bo:1:003:2 -115 31 = 55534243 c9000000
>> 00020000 80001085 082e0000 00010000 00000000 40ec00
>
> That's an IDENTIFY DEVICE command being sent to the device,
> corresponding to the start of the hdparm debugging log:
>
> 	outgoing cdb:  85 08 2e 00 00 00 01 00 00 00 00 00 00 40 ec 00
>
>> ffff88001bb82840 685088982 C Bo:1:003:2 0 31>
>> ffff88001bbc3d80 685089045 S Bi:1:003:1 -115 512<
>> ffff88001bbc3d80 685094708 C Bi:1:003:1 0 512 = 4000ff3f 37c81000
>> 00000000 3f000000 00000000 32534d35 394a5a30 30313237
>
> These are the first 32 bytes of the reply.  (If necessary we could get
> all 512 bytes.)  But at this point the hdparm debugging log says:
>
> 	data:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>
> That certainly seems strange.  The reply data should be there.
>
>> ffff88001bb82840 685094763 S Bi:1:003:1 -115 13<
>> ffff88001bb82840 685094814 C Bi:1:003:1 0 13 = 55534253 c9000000 00000000 00
>
> And the status value is 0, indicating no problems.  Nevertheless,
> hdparm reported:
>
> 	SG_IO: ATA_16 status=0x0, host_status=0x0, driver_status=0x0
> 	SG_IO: bad response (not CHECK_CONDITION)
>
> Presumably this is because it saw all 0's instead of the actual data.
> Apart from that, it is what one would expect.
>
>> ffff88001bb82840 685095024 S Bo:1:003:2 -115 31 = 55534243 ca000000
>> 00020000 80001085 082e0000 00010000 00000000 40a100
>
> This is an IDENTIFY PACKET DEVICE command, corresponding to the next
> two lines in the hdparm log:
>
> 	Trying legacy HDIO_DRIVE_CMD
> 	outgoing cdb:  85 08 2e 00 00 00 01 00 00 00 00 00 00 40 a1 00
>
>> ffff88001bb82840 685095207 C Bo:1:003:2 0 31>
>> ffff88001bbc3d80 685095260 S Bi:1:003:1 -115 512<
>> ffff88001bbc3d80 685095457 C Bi:1:003:1 -32 0
>> ffff88001bb82840 685095509 S Co:1:003:0 s 02 01 0000 0081 0000 0
>> ffff88001bb82840 685095561 C Co:1:003:0 0 0
>> ffff88001bb82840 685095614 S Bi:1:003:1 -115 13<
>> ffff88001bb82840 685095699 C Bi:1:003:1 0 13 = 55534253 ca000000 00020000 01
>
> The device sends back no data, a Residue value of 512, and Check
> Condition status.
>
>> ffff88001bb82840 685095768 S Bo:1:003:2 -115 31 = 55534243 cb000000
>> 60000000 80000603 00000060 00000000 00000000 000000
>
> This is the REQUEST SENSE command automatically generated by the
> usb-storage driver.
>
>> ffff88001bb82840 685095817 C Bo:1:003:2 0 31>
>> ffff88001bbc3d80 685095885 S Bi:1:003:1 -115 96<
>> ffff88001bbc3d80 685096082 C Bi:1:003:1 0 96 = 720b0000 0000000e
>> 090c0004 00010000 00000000 40510000 00000000 00000000
>
> And these are the first 32 sense data bytes.  Here's what hdparm had to
> say:
>
> 	data:  40 00 ff 3f 37 c8 10 00 00 00 00 00 3f 00 00 00
> 	SG_IO: ATA_16 status=0x2, host_status=0x0, driver_status=0x8
> 	SG_IO: sb[]:  72 0b 00 00 00 00 00 0e 09 0c 00 04 00 01 00 00 00 00 00
> 	00 40 51 00 00 00 00 00 00 00 00 00 00
> 	SG_IO: desc[]:  09 0c 00 04 00 01 00 00 00 00 00 00
> 	       ATA_16 statQ err\x04 nsect\x01 lbal\0 lbam\0 lbah\0 dev@
> 	I/O error, ata_op=0xa1 ata_status=0x51 ata_error=0x04
>
> Notice that the "data" line contains the data from the previous
> command!  The status and sense buffer ("sb") values appear correct.
..

The "data:" dump from "hdparm --verbose" shows the _outgoing_data buffer
from just prior to command issue.  In this case, that buffer is on the stack.
So yes, it will often show data from the previous command,
and never from the current command.

I really ought to beef up --verbose to show the data in both directions.  :)

But it is a good clue, as it shows that the data probably did make it
all the way back to hdparm.

The sticky part is that hdparm explicitly asked for sense data.

But the results were marked as "no sense data".  Many of the commands
sent by hdparm _require_ "sense data" (ATA register values) in order
to see the results.  The USB driver appears to ignore that request
when it sees good device status from the original command.  Bug.

For "identify", we could work around that in hdparm,
but other commands would still be broken by the lack of sense data.

Cheers
-- 
Mark Lord
Real-Time Remedies Inc.
mlord@pobox.com

  reply	other threads:[~2010-05-12 12:56 UTC|newest]

Thread overview: 107+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.LNX.4.44L0.1003261705340.23253-100000@netrider.rowland.org>
     [not found] ` <4BAD275A.7050903@interlog.com>
     [not found]   ` <59ca64281003300044g53ae5170xaf198bf99964fc36@mail.gmail.com>
2010-03-31 11:39     ` System hangs when using USB 3.0 HD with on Ubuntu Jonas Schwertfeger
2010-03-31 14:56       ` Alan Stern
2010-03-31 15:20         ` David Zeuthen
2010-03-31 16:12           ` Douglas Gilbert
2010-03-31 16:36             ` Alan Stern
2010-04-01 13:32               ` Jonas Schwertfeger
2010-04-01 13:42                 ` Kay Sievers
2010-04-01 13:55                   ` Jonas Schwertfeger
     [not found]                     ` <r2k59ca64281004010655z93fedfa8rdeb447d82a848d9f-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-04-01 14:05                       ` Kay Sievers
2010-04-02 12:40                         ` Jonas Schwertfeger
     [not found]                           ` <m2l59ca64281004020540z7e502130g22dfc035f1ceda6a-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-04-02 13:09                             ` Jonas Schwertfeger
     [not found]                               ` <t2t59ca64281004020609sa0f67f0dj5c127e3f0b2e4db2-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-04-02 14:12                                 ` Alan Stern
     [not found]                                   ` <Pine.LNX.4.44L0.1004021010130.1615-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2010-04-02 14:41                                     ` James Bottomley
     [not found]                                       ` <1270219267.2899.73.camel-0iu6Cu4xQGLYCGPCin2YbQ@public.gmane.org>
2010-04-02 14:57                                         ` Alan Stern
     [not found]                                           ` <Pine.LNX.4.44L0.1004021052040.1615-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2010-04-02 15:19                                             ` Alan Stern
     [not found]                                               ` <Pine.LNX.4.44L0.1004021114160.1615-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2010-04-02 15:50                                                 ` Sergei Shtylyov
2010-04-02 15:59                                                   ` James Bottomley
2010-04-07 18:08                                                     ` Mark Lord
2010-04-07 18:29                                                       ` James Bottomley
2010-04-07 19:18                                                       ` Alan Stern
     [not found]                                                         ` <Pine.LNX.4.44L0.1004071516260.5760-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2010-04-07 22:49                                                           ` Mark Lord
2010-04-08  5:06                                                             ` Jonas Schwertfeger
2010-04-02 16:21                                                   ` Douglas Gilbert
2010-04-02 16:39                                                     ` Douglas Gilbert
     [not found]                                                       ` <4BB61DAF.7090709-qazKcTl6WRFWk0Htik3J/w@public.gmane.org>
2010-04-02 21:24                                                         ` Mark Lord
2010-04-03  6:21                                                           ` Jonas Schwertfeger
     [not found]                                                             ` <4BB73EB3.3040308@pobox.com>
2010-04-03 15:40                                                               ` Jonas Schwertfeger
2010-04-03 16:42                                                                 ` Alan Stern
2010-04-03 17:06                                                                   ` Jonas Schwertfeger
2010-04-03 20:58                                                                     ` Alan Stern
2010-04-04  1:29                                                                       ` Mark Lord
     [not found]                                                                       ` <Pine.LNX.4.44L0.1004031648230.21507-100000-pYrvlCTfrz9XsRXLowluHWD2FQJk+8+b@public.gmane.org>
2010-04-06  6:43                                                                         ` Jonas Schwertfeger
     [not found]                                                                           ` <4BBAD7FF.5000605-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-04-06 14:49                                                                             ` Alan Stern
2010-04-06 14:56                                                                               ` Jonas Schwertfeger
     [not found]                                                                               ` <Pine.LNX.4.44L0.1004061048590.1722-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2010-04-07  6:27                                                                                 ` Jonas Schwertfeger
     [not found]                                                                                   ` <4BBC25C9.5030201-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-04-07 14:36                                                                                     ` Alan Stern
2010-04-07 14:42                                                                                       ` Jonas Schwertfeger
2010-04-07 14:51                                                                                         ` Jerone Young
2010-04-07 15:03                                                                                         ` Alan Stern
2010-04-07 15:10                                                                                           ` Jonas Schwertfeger
2010-04-09 15:38                                                                                             ` Alan Stern
2010-04-09 16:39                                                                                               ` Douglas Gilbert
     [not found]                                                                                                 ` <4BBF582F.4040707-qazKcTl6WRFWk0Htik3J/w@public.gmane.org>
2010-04-09 17:14                                                                                                   ` Sarah Sharp
2010-04-09 18:00                                                                                                     ` Jonas Schwertfeger
2010-04-09 19:25                                                                                                       ` Alan Stern
2010-04-09 21:54                                                                                                         ` Sarah Sharp
2010-04-12  7:48                                                                                                           ` Jonas Schwertfeger
2010-04-16 18:20                                                                                                             ` Sarah Sharp
2010-04-16 19:25                                                                                                               ` Alan Stern
2010-04-19 21:15                                                                                                                 ` Sarah Sharp
2010-04-20  0:25                                                                                                                   ` Mark Lord
2010-04-20  4:31                                                                                                                     ` Mark Lord
2010-04-20 15:39                                                                                                                   ` Alan Stern
     [not found]                                                                                                                     ` <Pine.LNX.4.44L0.1004201045180.1837-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2010-04-20 17:37                                                                                                                       ` Sarah Sharp
2010-04-20 19:48                                                                                                                         ` Alan Stern
     [not found]                                                                                                                           ` <4BCF0605.7080508@pobox.com>
     [not found]                                                                                                                             ` <4BCF4120.4060806@pobox.com>
2010-04-21 18:27                                                                                                                               ` Jonas Schwertfeger
2010-04-21 19:07                                                                                                                                 ` Alan Stern
     [not found]                                                                                                                                   ` <Pine.LNX.4.44L0.1004211506040.1422-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2010-04-21 19:24                                                                                                                                     ` Mark Lord
2010-04-26 16:27                                                                                                                                 ` Sarah Sharp
2010-04-29  8:44                                                                                                                                   ` Jonas Schwertfeger
2010-04-29 12:56                                                                                                                                     ` Mark Lord
2010-04-29 15:45                                                                                                                                     ` Alan Stern
2010-05-07 10:42                                                                                                                                       ` Jonas Schwertfeger
     [not found]                                                                                                                                         ` <4BE3EE87.6020505-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-05-07 15:03                                                                                                                                           ` Alan Stern
2010-05-11  6:54                                                                                                                                             ` Jonas Schwertfeger
2010-05-11 14:44                                                                                                                                               ` Alan Stern
2010-05-12 12:56                                                                                                                                                 ` Mark Lord [this message]
2010-05-12 14:23                                                                                                                                                   ` Douglas Gilbert
2010-05-12 14:37                                                                                                                                                     ` Mark Lord
2010-05-12 14:45                                                                                                                                                       ` Mark Lord
2010-05-12 15:09                                                                                                                                                   ` Alan Stern
2010-05-12 15:39                                                                                                                                                     ` James Bottomley
2010-05-12 18:48                                                                                                                                                       ` Alan Stern
     [not found]                                                                                                                                                         ` <Pine.LNX.4.44L0.1005121444450.1353-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2010-05-13  3:12                                                                                                                                                           ` Mark Lord
2010-05-13 18:42                                                                                                                                                             ` Alan Stern
2010-04-21 12:31                                                                                                                         ` Luben Tuikov
2010-04-21 14:31                                                                                                                           ` Alan Stern
2010-04-21 12:47                                                                                                                         ` Luben Tuikov
2010-04-21 13:52                                                                                                                           ` Mark Lord
2010-04-21 14:04                                                                                                                             ` James Bottomley
2010-04-21 14:08                                                                                                                               ` Mark Lord
2010-04-21 14:15                                                                                                                                 ` James Bottomley
2010-04-21 14:13                                                                                                                               ` Mark Lord
2010-04-21 14:22                                                                                                                                 ` James Bottomley
     [not found]                                                                                                                                   ` <1271859728.2893.72.camel-0iu6Cu4xQGLYCGPCin2YbQ@public.gmane.org>
2010-04-21 14:53                                                                                                                                     ` Alan Stern
     [not found]                                                                                                                                       ` <Pine.LNX.4.44L0.1004211032460.1728-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2010-04-21 23:29                                                                                                                                         ` Stefan Richter
2010-04-20 17:48                                                                                                                     ` Douglas Gilbert
2010-04-16 21:31                                                                                                               ` James Bottomley
2010-04-16 23:56                                                                                                                 ` Douglas Gilbert
2010-04-19 15:04                                                                                                               ` Jonas Schwertfeger
2010-04-19 16:02                                                                                                                 ` Alan Stern
2010-04-19 20:45                                                                                                                 ` Sarah Sharp
2010-04-02 17:36                                   ` Sarah Sharp
2010-03-31 16:37             ` David Zeuthen
     [not found]               ` <1270053444.16657.17.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2010-03-31 16:58                 ` Lennart Poettering
2010-03-31 17:03                   ` Lennart Poettering
     [not found]                   ` <20100331165807.GA20547-kS5D54t9nk0aINubkmmoJbNAH6kLmebB@public.gmane.org>
2010-03-31 17:17                     ` David Zeuthen
2010-03-31 17:06                 ` David Zeuthen
     [not found]       ` <1270049200.2302.320.camel@laptop>
2010-03-31 15:37         ` Jonas Schwertfeger
2010-04-21 14:58       ` Luben Tuikov
2010-04-21 15:09       ` Luben Tuikov
2010-04-21 16:09         ` Alan Stern
2010-04-21 16:18           ` Martin K. Petersen
2010-04-21 17:41             ` Sarah Sharp
2010-04-21 18:08               ` Alan Stern
2010-04-22  0:08       ` Luben Tuikov
2010-04-22 14:52         ` Alan Stern

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=4BEAA583.1090805@pobox.com \
    --to=mlord@pobox.com \
    --cc=Dinh.Nguyen@freescale.com \
    --cc=James.Bottomley@suse.de \
    --cc=david@fubar.dk \
    --cc=dgilbert@interlog.com \
    --cc=jschwertfeger@gmail.com \
    --cc=kay.sievers@vrfy.org \
    --cc=lennart@poettering.net \
    --cc=linux-hotplug@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mdharm-usb@one-eyed-alien.net \
    --cc=sarah.a.sharp@linux.intel.com \
    --cc=sshtylyov@mvista.com \
    --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).