From owner-freebsd-usb@FreeBSD.ORG Sun May 22 18:35:07 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 09F4C106564A for ; Sun, 22 May 2011 18:35:07 +0000 (UTC) (envelope-from trevor.l.blackwell@gmail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id B608D8FC0C for ; Sun, 22 May 2011 18:35:06 +0000 (UTC) Received: by ywf7 with SMTP id 7so2363863ywf.13 for ; Sun, 22 May 2011 11:35:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=uNR4P+zVTqkVKTU9vxW3SbUqn84nygur9t+Db281Z2E=; b=g75wpQ8v3DxI4EYMFMG4HZ3ayVLut762mTqxuLjerlEx0sliZA/zkndDmuwLCoMxJj J1jpZB0cyBNWk43SoeyDcpAqK8X0SsW24JSXhpobHO1H9ZHKoaCKz6LrVjp78X/182+m /DN0rNdF1eVVomCt7SQT3px+Xgi0GGUkPSlK8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=dYG/JiLW1jR/NcTsZA4JN8VtFhkgbtcTwt3Oai6tRpaC5f6wQHgisL+8nnAgkIjUXr keWvPHv5SefQ5YVgNF43/mJL6O3BUjM1Jl+nYo8+KIDKciUv3ex7X9dZ0XhMcixj3oXY smA6+T9Fvz2QGj/MDIBbJ145IjVnY1+YW6cJo= MIME-Version: 1.0 Received: by 10.236.153.202 with SMTP id f50mr1857037yhk.253.1306089305832; Sun, 22 May 2011 11:35:05 -0700 (PDT) Sender: trevor.l.blackwell@gmail.com Received: by 10.236.95.175 with HTTP; Sun, 22 May 2011 11:35:05 -0700 (PDT) In-Reply-To: <201105201344.35918.hselasky@c2i.net> References: <201105051009.55454.hselasky@c2i.net> <201105201344.35918.hselasky@c2i.net> Date: Sun, 22 May 2011 11:35:05 -0700 X-Google-Sender-Auth: 9C2h_irvD3bO_B1m902Wb3HyD1k Message-ID: From: Trevor Blackwell To: Hans Petter Selasky Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 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: Sun, 22 May 2011 18:35:07 -0000 I decided to handle it at user level, so I added a sysctl to count stall or timeout errors during a clear-stall transaction. When that counter goes up by >= 5 counts in 5 seconds, the user-level daemon does a clear-TT transaction against the hub (using libusb20). If that doesn't solve it, it closes all USB devices and resets the hub. On Fri, May 20, 2011 at 4:44 AM, Hans Petter Selasky wrote: > On Thursday 05 May 2011 10:09:55 Hans Petter Selasky wrote: > > 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 > > Any updates on this issue? > > --HPS > -- Trevor Blackwell trevor@anybots.com 650 776 7870