From owner-svn-src-head@FreeBSD.ORG Sat Sep 3 18:29:46 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BA09106566B for ; Sat, 3 Sep 2011 18:29:46 +0000 (UTC) (envelope-from hselasky@freebsd.org) Received: from swip.net (mailfe08.c2i.net [212.247.154.226]) by mx1.freebsd.org (Postfix) with ESMTP id E60C18FC0A for ; Sat, 3 Sep 2011 18:29:45 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=ZrWDMTID0AMW4DNRKF44fvigJaUxxg2ESvddpUoMqyA= c=1 sm=1 a=yGaCp5QzH3EA:10 a=dBRESv0yCI8A:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=YCq3Qb_BBFZsq55wjxQA:9 a=pILNOxqGKmIA:10 a=Rv1Snup_ZrS8ksZP6OIA:9 a=wPNLvfGTeEIA:10 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe08.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 175011083; Sat, 03 Sep 2011 20:29:44 +0200 Received-SPF: softfail receiver=mailfe08.swip.net; client-ip=188.126.198.129; envelope-from=hselasky@freebsd.org To: Alex Kozlov From: Hans Petter Selasky X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq,NwSZ4V" =?iso-8859-15?q?=7CLR=2E+tj=7Dg5=0A=09=25V?=,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( =?iso-8859-15?q?=0A=09=3AAuzV9=3A=2EhESm-x4h240C=609=3Dw?= Date: Sat, 3 Sep 2011 20:27:05 +0200 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_5FnYO+OMWGGMxmt" Message-Id: <201109032027.05511.hselasky@freebsd.org> Cc: "svn-src-head@freebsd.org" Subject: Re: svn commit: r225350 - in head/sys: dev/usb dev/usb/quirk dev/usb/storage sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Sep 2011 18:29:46 -0000 --Boundary-00=_5FnYO+OMWGGMxmt Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit On Saturday 03 September 2011 18:32:38 Alex Kozlov wrote: > On Fri, Sep 02, 2011 at 06:50:44PM +0000, Hans Petter Selasky wrote: > > Log: > > This patch adds automatic detection of USB mass storage devices > > which does not support the no synchronize cache SCSI command. > > > > The __FreeBSD_version version macro has been bumped and > > external kernel modules needs to be recompiled after > > this patch. > > > > Approved by: re (kib) > > MFC after: 1 week > > PR: usb/160299 > > > > Modified: > > head/sys/dev/usb/quirk/usb_quirk.c > > head/sys/dev/usb/storage/umass.c > > head/sys/dev/usb/usb_device.c > > head/sys/dev/usb/usb_device.h > > head/sys/dev/usb/usb_dynamic.c > > head/sys/dev/usb/usb_dynamic.h > > head/sys/dev/usb/usb_freebsd.h > > head/sys/dev/usb/usb_msctest.c > > head/sys/dev/usb/usb_msctest.h > > head/sys/dev/usb/usbdi.h > > head/sys/sys/param.h > > This change broke the detection of one of my flash cards: > > Root mount waiting for: usbus7 > ugen7.2: at usbus7 > umass0: on > usbus7 Root mount waiting for: usbus7 > (probe0:umass-sim0:0:0:0): INQUIRY. CDB: 12 0 0 0 24 0 > (probe0:umass-sim0:0:0:0): CAM status: SCSI Status Error > (probe0:umass-sim0:0:0:0): SCSI status: Check Condition > (probe0:umass-sim0:0:0:0): SCSI sense: ILLEGAL REQUEST asc:24.0 (Invalid > field in CDB) field replaceable unit 6 Root mount waiting for: usbus7 > Trying to mount root from ufs:/dev/da0a [ro]... > mountroot: waiting for device /dev/da0a ... > Mounting from ufs:/dev/da0a failed with error 19. > > > -- > Adios Hi, Forgot one line in my patch. --HPS --Boundary-00=_5FnYO+OMWGGMxmt Content-Type: text/x-patch; charset="ISO-8859-1"; name="msc_auto_quirk.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="msc_auto_quirk.patch" === sys/dev/usb/usb_msctest.c ================================================================== --- sys/dev/usb/usb_msctest.c (revision 225354) +++ sys/dev/usb/usb_msctest.c (local) @@ -605,6 +605,7 @@ uint8_t is_no_direct; uint8_t sid_type; int err; + int failed = 0; sc = bbb_attach(udev, iface_index); if (sc == NULL) @@ -645,6 +646,8 @@ if (err != ERR_CSW_FAILED) goto error; + + failed = 1; } err = bbb_command_start(sc, DIR_IN, 0, NULL, 0, @@ -659,12 +662,18 @@ DPRINTF("Device doesn't handle synchronize cache\n"); usbd_add_dynamic_quirk(udev, UQ_MSC_NO_SYNC_CACHE); + + failed = 1; } done: bbb_detach(sc); - return (0); + if (failed) + usbd_req_re_enumerate(udev, NULL); + + return (failed ? USB_ERR_STALLED : 0); + error: bbb_detach(sc); --Boundary-00=_5FnYO+OMWGGMxmt--