From patchwork Tue Jul 12 15:52:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Stern X-Patchwork-Id: 9225659 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id ABBCF604DB for ; Tue, 12 Jul 2016 15:52:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9AA8A2793D for ; Tue, 12 Jul 2016 15:52:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8ADA127CCB; Tue, 12 Jul 2016 15:52:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C78522793D for ; Tue, 12 Jul 2016 15:52:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932331AbcGLPwl (ORCPT ); Tue, 12 Jul 2016 11:52:41 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:48294 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S932207AbcGLPwk (ORCPT ); Tue, 12 Jul 2016 11:52:40 -0400 Received: (qmail 3160 invoked by uid 2102); 12 Jul 2016 11:52:33 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 12 Jul 2016 11:52:33 -0400 Date: Tue, 12 Jul 2016 11:52:33 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Mauro Carvalho Chehab cc: Wade Berrier , Sean Young , , Subject: Re: mceusb xhci issue? In-Reply-To: <20160709115956.64187c4e@recife.lan> Message-ID: MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Sat, 9 Jul 2016, Mauro Carvalho Chehab wrote: > C/C linux-usb Mailing list: > > > Em Wed, 18 May 2016 08:52:28 -0600 > Wade Berrier escreveu: ... > > > That message above links to some other threads describing the issue. > > > Here's a post with a patch that supposedly works: > > > > > > http://www.gossamer-threads.com/lists/mythtv/users/587930 > > > > > > No idea if that's the "correct" way to fix this. > > > > > > I'll be trying that out and then report back... > > > > Indeed, this patch does fix the issue: > > > > ---------------------- > > > > diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c > > index 31ccdcc..03321d4 100644 > > --- a/drivers/usb/core/config.c > > +++ b/drivers/usb/core/config.c > > @@ -247,7 +247,7 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum, > > /* For low-speed, 10 ms is the official minimum. > > * But some "overclocked" devices might want faster > > * polling so we'll allow it. */ > > - n = 32; > > + n = 10; > > break; > > } > > } else if (usb_endpoint_xfer_isoc(d)) { > > > > > > ---------------------- > > > > Is this change appropriate to be pushed upstream? Where to go from > > here? > > This issue is at the USB core. So, it should be reported to the > linux-usb mailing list. > > The people there should help about how to proceed to get this > fixed upstream. Here's a proper version of that patch. If this is okay, it can be merged. Alan Stern --- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: usb-4.x/drivers/usb/core/config.c =================================================================== --- usb-4.x.orig/drivers/usb/core/config.c +++ usb-4.x/drivers/usb/core/config.c @@ -213,8 +213,10 @@ static int usb_parse_endpoint(struct dev memcpy(&endpoint->desc, d, n); INIT_LIST_HEAD(&endpoint->urb_list); - /* Fix up bInterval values outside the legal range. Use 32 ms if no - * proper value can be guessed. */ + /* + * Fix up bInterval values outside the legal range. + * Use 10 or 8 ms if no proper value can be guessed. + */ i = 0; /* i = min, j = max, n = default */ j = 255; if (usb_endpoint_xfer_int(d)) { @@ -223,13 +225,15 @@ static int usb_parse_endpoint(struct dev case USB_SPEED_SUPER_PLUS: case USB_SPEED_SUPER: case USB_SPEED_HIGH: - /* Many device manufacturers are using full-speed + /* + * Many device manufacturers are using full-speed * bInterval values in high-speed interrupt endpoint * descriptors. Try to fix those and fall back to a - * 32 ms default value otherwise. */ + * 8 ms default value otherwise. + */ n = fls(d->bInterval*8); if (n == 0) - n = 9; /* 32 ms = 2^(9-1) uframes */ + n = 7; /* 8 ms = 2^(7-1) uframes */ j = 16; /* @@ -247,7 +251,7 @@ static int usb_parse_endpoint(struct dev /* For low-speed, 10 ms is the official minimum. * But some "overclocked" devices might want faster * polling so we'll allow it. */ - n = 32; + n = 10; break; } } else if (usb_endpoint_xfer_isoc(d)) { @@ -255,10 +259,10 @@ static int usb_parse_endpoint(struct dev j = 16; switch (to_usb_device(ddev)->speed) { case USB_SPEED_HIGH: - n = 9; /* 32 ms = 2^(9-1) uframes */ + n = 7; /* 8 ms = 2^(7-1) uframes */ break; default: /* USB_SPEED_FULL */ - n = 6; /* 32 ms = 2^(6-1) frames */ + n = 4; /* 8 ms = 2^(4-1) frames */ break; } }