From owner-freebsd-usb@FreeBSD.ORG Wed Sep 11 10:05:47 2013 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3956AF99; Wed, 11 Sep 2013 10:05:47 +0000 (UTC) (envelope-from hps@bitfrost.no) Received: from mta.bitpro.no (mta.bitpro.no [92.42.64.202]) by mx1.freebsd.org (Postfix) with ESMTP id BF2CE2110; Wed, 11 Sep 2013 10:05:46 +0000 (UTC) Received: from mail.lockless.no (mail.lockless.no [46.29.221.38]) by mta.bitpro.no (Postfix) with ESMTP id 8B17A7A086; Wed, 11 Sep 2013 12:05:44 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.lockless.no (Postfix) with ESMTP id 6CA768ED65D; Wed, 11 Sep 2013 12:06:00 +0200 (CEST) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at lockless.no Received: from mail.lockless.no ([127.0.0.1]) by localhost (mail.lockless.no [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2LwURgMrEuYE; Wed, 11 Sep 2013 12:05:59 +0200 (CEST) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) by mail.lockless.no (Postfix) with ESMTPSA id 8F5568ED5B9; Wed, 11 Sep 2013 12:05:59 +0200 (CEST) Message-ID: <523040BD.4030003@bitfrost.no> Date: Wed, 11 Sep 2013 12:06:53 +0200 From: Hans Petter Selasky Organization: Bitfrost A/S User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130522 Thunderbird/17.0.6 MIME-Version: 1.0 To: Kannan Manickam Subject: Re: Issue detecting with USB 3.0 device on USB 2.0 port References: <523016CD.6000104@bitfrost.no> In-Reply-To: Content-Type: multipart/mixed; boundary="------------090204060508060200040706" Cc: Alexander Motin , freebsd-usb@freebsd.org X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2013 10:05:47 -0000 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 > 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 > 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 > status 0xeb023 > 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 > status 0xcb021 > 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 > 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 --------------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--