Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755352Ab3GAUlT (ORCPT ); Mon, 1 Jul 2013 16:41:19 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:38596 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1754776Ab3GAUlS (ORCPT ); Mon, 1 Jul 2013 16:41:18 -0400 Date: Mon, 1 Jul 2013 16:41:17 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: William Gulland cc: Sarah Sharp , Lan Tianyu , Ming Lei , , Subject: Re: [PATCH] usb: Clear both buffers when clearing a control transfer TT buffer. In-Reply-To: <1372374620-11790-1-git-send-email-wgulland@google.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1537 Lines: 42 On Thu, 27 Jun 2013, William Gulland wrote: > Control transfers have both IN and OUT (or SETUP) packets, so when > clearing TT buffers for a control transfer it's necessary to send > two HUB_CLEAR_TT_BUFFER requests to the hub. > > Signed-off-by: William Gulland > --- > drivers/usb/core/hub.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c > index feef935..868ad74 100644 > --- a/drivers/usb/core/hub.c > +++ b/drivers/usb/core/hub.c > @@ -668,6 +668,15 @@ resubmit: > static inline int > hub_clear_tt_buffer (struct usb_device *hdev, u16 devinfo, u16 tt) > { > + /* Need to clear both directions for control ep */ > + if (((devinfo >> 11) & USB_ENDPOINT_XFERTYPE_MASK) == > + USB_ENDPOINT_XFER_CONTROL) { > + int status = usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0), > + HUB_CLEAR_TT_BUFFER, USB_RT_PORT, > + devinfo ^ 0x8000, tt, NULL, 0, 1000); > + if (status) > + return status; > + } > return usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0), > HUB_CLEAR_TT_BUFFER, USB_RT_PORT, devinfo, > tt, NULL, 0, 1000); Well, this won't hurt much. And since it does seem to fix a hardware problem, Acked-by: Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/