From owner-freebsd-usb@FreeBSD.ORG Fri Jan 10 07:50:01 2014 Return-Path: Delivered-To: freebsd-usb@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5D96E6A9 for ; Fri, 10 Jan 2014 07:50:01 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2D9C610BC for ; Fri, 10 Jan 2014 07:50:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id s0A7o1fE097702 for ; Fri, 10 Jan 2014 07:50:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id s0A7o1eX097689; Fri, 10 Jan 2014 07:50:01 GMT (envelope-from gnats) Date: Fri, 10 Jan 2014 07:50:01 GMT Message-Id: <201401100750.s0A7o1eX097689@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org Cc: From: Hans Petter Selasky Subject: Re: usb/185628: usbd_req_re_enumerate set address failed USB_ERR_STALLED for Seagate USB drives between r259425 and r260321 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Hans Petter Selasky List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jan 2014 07:50:01 -0000 The following reply was made to PR usb/185628; it has been noted by GNATS. From: Hans Petter Selasky To: Alex Goncharov , freebsd-gnats-submit@FreeBSD.org Cc: Subject: Re: usb/185628: usbd_req_re_enumerate set address failed USB_ERR_STALLED for Seagate USB drives between r259425 and r260321 Date: Fri, 10 Jan 2014 08:48:38 +0100 This is a multi-part message in MIME format. --------------080508060307050403080600 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 01/10/14 04:02, Alex Goncharov wrote: > >> Number: 185628 >> Category: usb >> Synopsis: usbd_req_re_enumerate set address failed USB_ERR_STALLED for Seagate USB drives between r259425 and r260321 >> Confidential: no >> Severity: non-critical >> Priority: low >> Responsible: freebsd-usb >> State: open >> Quarter: >> Keywords: >> Date-Required: >> Class: sw-bug >> Submitter-Id: current-users >> Arrival-Date: Fri Jan 10 03:10:00 UTC 2014 >> Closed-Date: >> Last-Modified: >> Originator: Alex Goncharov >> Release: 9.2-STABLE, built from svn source, r260321 >> Organization: >> Environment: > FreeBSD 9.2-STABLE FreeBSD 9.2-STABLE #0 r260321 Sun Jan 5 13:06:01 EST 2014 >> Description: > This is an extremely reproducible and very upsetting new problem. Here is a patch you can try, as an attachment. --HPS --------------080508060307050403080600 Content-Type: text/x-patch; name="umass.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="umass.diff" === umass.c ================================================================== --- umass.c (revision 260392) +++ umass.c (local) @@ -1362,9 +1362,18 @@ sc->sc_transfer.data_ptr += actlen; sc->sc_transfer.actlen += actlen; + /* + * Filter out transfers containing a short packet when + * they shouldn't: + */ if (actlen < sumlen) { - /* short transfer */ - sc->sc_transfer.data_rem = 0; + if (actlen % 512) { + /* short transfer for sure */ + sc->sc_transfer.data_rem = 0; + } else { + /* get the remaining data, if any */ + sc->sc_transfer.data_timeout = 1000; + } } case USB_ST_SETUP: DPRINTF(sc, UDMASS_BBB, "max_bulk=%d, data_rem=%d\n", --------------080508060307050403080600--