From owner-freebsd-usb@FreeBSD.ORG Thu May 5 08:11:06 2011 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0BEA1065670 for ; Thu, 5 May 2011 08:11:06 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe07.c2i.net [212.247.154.194]) by mx1.freebsd.org (Postfix) with ESMTP id 3C5748FC0C for ; Thu, 5 May 2011 08:11:05 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=118a5bn0tGnRZbUa9ClBty6BTuM1bA5mUZqmf2RHYp4= c=1 sm=1 a=SvYTsOw2Z4kA:10 a=Qcgr9xoES4kA:10 a=WQU8e4WWZSUA:10 a=Q9fys5e9bTEA:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=m0bHr2FCAAAA:8 a=-sOZjCLaQ7dwQucEfc8A:9 a=PUjeQqilurYA:10 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe07.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 122493496; Thu, 05 May 2011 10:11:03 +0200 From: Hans Petter Selasky To: Trevor Blackwell Date: Thu, 5 May 2011 10:09:55 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: <201105050841.56095.hselasky@c2i.net> In-Reply-To: X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq, NwSZ4V"|LR.+tj}g5 %V,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( :AuzV9:.hESm-x4h240C`9=w MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201105051009.55454.hselasky@c2i.net> Cc: freebsd-usb@freebsd.org Subject: Re: Clearing stalls: usbd_xfer_set_stall vs usbd_do_clear_stall_callback X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 May 2011 08:11:06 -0000 On Thursday 05 May 2011 09:15:09 Trevor Blackwell wrote: > 8.2-STABLE. I'm willing to run whatever. > > I suspect the problem I'm having is the same as this: > http://kerneltrap.org/mailarchive/linux-usb/2009/5/15/5761363 > > I can manually kick it out of the wedged state by sending a RESET_TT > transaction to the hub with usbconfig -d ugen1.3 do_request 0x23 0x09 > 0x0000 0x0001 0 > > (UT_WRITE_CLASS_OTHER, UR_RESET_TT) > > I'm working on adding code to do this. My current hack is to do it from > uhub_explore. When my driver tries to do a clear-stall and gets a timeout > error from the clear-stall, it sets a flag on the parent_hs_hub to request > a RESET_TT. uhub_explore notices the flag and does it. > > Possibly I could also add it to usb_do_clear_stall_callback, but I don't > think I can call usb_do_request from inside a callback. > > Any suggestions? Hi, I think it is best to do this from the root HUB thread, then the operation gets properly serialised. Then the clear-stalls requests will simply be pending until normal operation is established. Could a control endpoint timeout in general imply that the parent High Speed HUB, if any, should be reset? --HPS