Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Sep 2013 12:06:53 +0200
From:      Hans Petter Selasky <hps@bitfrost.no>
To:        Kannan Manickam <me@arangamani.net>
Cc:        Alexander Motin <mav@FreeBSD.org>, freebsd-usb@freebsd.org
Subject:   Re: Issue detecting with USB 3.0 device on USB 2.0 port
Message-ID:  <523040BD.4030003@bitfrost.no>
In-Reply-To: <CAPcwmG5gEVMLh0dT6TwAe_%2B%2Bx93m6UUQ2EsPY5uEtWqRHjZsBw@mail.gmail.com>
References:  <CAPcwmG6Fo6_w0nNa2M2s0aBLpve%2BLCvzp0deeRCturUJnCYuPQ@mail.gmail.com> <523016CD.6000104@bitfrost.no> <CAPcwmG5gEVMLh0dT6TwAe_%2B%2Bx93m6UUQ2EsPY5uEtWqRHjZsBw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------090204060508060200040706
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

Your devices crashes or detach after receiving this 6-byte SCSI command:

12 01 00 00 FF 00 00 00 00  10 00 00 00 00 00 00

Which is an INQUIRY command.

#define SC_INQUIRY                      0x12

mav @ CC'ed.

I see there is a dirty byte there. Does the attached patch make any 
difference to you?

--HPS

> 00:28:29.351797 usbus6.3 SUBM-BULK-EP=0000000a,SPD=HIGH,NFR=1,SLEN=32,IVAL=0
>  frame[0] WRITE 31 bytes
>  0000  55 53 42 43 ED 01 00 00  FF 00 00 00 80 00 06 12  |USBC............|
>  0010  01 00 00 FF 00 00 00 00  10 00 00 00 00 00 00 --  |............... |
>  flags 0 <0>
>  status 0xea023 <OPEN|TRANSFERRING|STARTED|BDMA_ENABLE|BDMA_SETUP|CURR_DMA_SET|CAN_CANCEL_IMMED|DOING_CALLBACK|0>
> 00:28:29.351885 usbus6.3 DONE-BULK-EP=0000000a,SPD=HIGH,NFR=1,SLEN=0,IVAL=0,ERR=0
>  frame[0] WRITE 31 bytes
>  flags 0 <0>
>  status 0xca021 <OPEN|STARTED|BDMA_ENABLE|BDMA_SETUP|CAN_CANCEL_IMMED|DOING_CALLBACK|0>
> 00:28:29.351892 usbus6.3 SUBM-BULK-EP=0000008b,SPD=HIGH,NFR=1,SLEN=0,IVAL=0
>  frame[0] READ 255 bytes
>  flags 0x32 <SHORT_XFER_OK|PROXY_BUFFER|EXT_BUFFER|0>
>  status 0xeb023 <OPEN|TRANSFERRING|STARTED|SHORT_XFER_OK|BDMA_ENABLE|BDMA_SETUP|CURR_DMA_SET|CAN_CANCEL_IMMED|DOING_CALLBACK|0>
> 00:28:29.452035 usbus6.3 DONE-BULK-EP=0000008b,SPD=HIGH,NFR=1,SLEN=0,IVAL=0,ERR=STALLED
>  frame[0] READ 0 bytes
>  flags 0x32 <SHORT_XFER_OK|PROXY_BUFFER|EXT_BUFFER|0>
>  status 0xcb021 <OPEN|STARTED|SHORT_XFER_OK|BDMA_ENABLE|BDMA_SETUP|CAN_CANCEL_IMMED|DOING_CALLBACK|0>
> 00:28:29.452055 usbus6.3 SUBM-CTRL-EP=00000000,SPD=HIGH,NFR=1,SLEN=8,IVAL=0
>  frame[0] WRITE 8 bytes
>  0000  02 01 00 00 8B 00 00 00  -- -- -- -- -- -- -- --  |........        |
>  flags 0 <0>
>  status 0xea1a3 <OPEN|TRANSFERRING|STARTED|CONTROL_XFR|CONTROL_HDR|BDMA_ENABLE|BDMA_SETUP|CURR_DMA_SET|CAN_CANCEL_IMMED|DOING_CALLBACK|0>
> 00:28:29.452128 usbus6.3 DONE-CTRL-EP=00000000,SPD=HIGH,NFR=1,SLEN=0,IVAL=0,ERR=STALLED
>  frame[0] WRITE 0 bytes
>  flags 0 <0>
>  status 0xca1a1 <OPEN|STARTED|CONTROL_XFR|CONTROL_HDR|BDMA_ENABLE|BDMA_SETUP|CAN_CANCEL_IMMED|DOING_CALLBACK|0>


--------------090204060508060200040706
Content-Type: text/x-patch;
 name="commit.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="commit.diff"

=== sys/dev/usb/storage/umass.c
==================================================================
--- sys/dev/usb/storage/umass.c	(revision 255360)
+++ sys/dev/usb/storage/umass.c	(local)
@@ -1321,10 +1321,12 @@
 			}
 			sc->cbw.bCDBLength = sc->sc_transfer.cmd_len;
 
+			/* copy SCSI command data */
 			memcpy(sc->cbw.CBWCDB, sc->sc_transfer.cmd_data,
 			    sc->sc_transfer.cmd_len);
 
-			memset(sc->sc_transfer.cmd_data +
+			/* clear remaining command area */
+			memset(sc->cbw.CBWCDB +
 			    sc->sc_transfer.cmd_len, 0,
 			    sizeof(sc->cbw.CBWCDB) -
 			    sc->sc_transfer.cmd_len);

--------------090204060508060200040706--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?523040BD.4030003>