From patchwork Sun Jan 19 21:05:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kittel X-Patchwork-Id: 3510381 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 63A099F2E9 for ; Sun, 19 Jan 2014 21:05:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5C4BB2010E for ; Sun, 19 Jan 2014 21:05:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 14FF92010B for ; Sun, 19 Jan 2014 21:05:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752177AbaASVFX (ORCPT ); Sun, 19 Jan 2014 16:05:23 -0500 Received: from moutng.kundenserver.de ([212.227.126.171]:50047 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752037AbaASVFW (ORCPT ); Sun, 19 Jan 2014 16:05:22 -0500 Received: from egon.zuhause (p54BD1C0F.dip0.t-ipconnect.de [84.189.28.15]) by mrelayeu.kundenserver.de (node=mrbap4) with ESMTP (Nemesis) id 0MGR4S-1W9L9Y2G00-00DFFL; Sun, 19 Jan 2014 22:05:16 +0100 Received: from localhost ([127.0.0.1] ident=martin) by egon.zuhause with esmtp (Exim 4.82) (envelope-from ) id 1W4zYR-00031o-P8; Sun, 19 Jan 2014 22:05:15 +0100 Message-ID: <52DC3E0B.6010202@martin-kittel.de> Date: Sun, 19 Jan 2014 22:05:15 +0100 From: Martin Kittel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131103 Icedove/17.0.10 MIME-Version: 1.0 Newsgroups: gmane.linux.drivers.video-input-infrastructure To: Mauro Carvalho Chehab , Sean Young CC: linux-media@vger.kernel.org, Jarod Wilson Subject: Re: Patch mceusb: fix invalid urb interval References: <20131211131751.GA434@pequod.mess.org> <20140115134917.1450f87c@samsung.com> <20140115165245.GA23620@pequod.mess.org> <20140115155923.0b8978da.m.chehab@samsung.com> In-Reply-To: <20140115155923.0b8978da.m.chehab@samsung.com> X-Provags-ID: V02:K0:OYT5B+Rl/3+Mi0mi2s4PYA1MrZ8kzRQHMy6RSL0JxCN ACkFHftwQ6Q8rXh/UZ3JEp1kEOdL7mhAM8ON358go2keaFu7o7 Gy43SzwFGqg58ARwczodUfMrC3f2FzbpbvE6TgDJj5/XkhibjA MZ0svv1tYd7Ibpalwf8RZ72tCjWeNWEkE0+P5Y1vEzs+lSu61w PN7J6n+AkkV4oyjNPLwifaO/LTtoK3HlTe2JF89p+MAye9hkUE uwdNyNjtUGB+A6kGv0INVjwAcF7BRMQwMgzooEQrHrcLTw72lc ldkB5zA5lzwvY3OdkQlGYxe62cIW8Q6+ZY1UPibgyCAd4bpnN+ 7jJ4GYFK5mhaR/Qg8UW0= Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Mauro, hi Sean, On 01/15/2014 06:59 PM, Mauro Carvalho Chehab wrote: > Em Wed, 15 Jan 2014 16:52:45 +0000 > Sean Young escreveu: > >> On Wed, Jan 15, 2014 at 01:49:17PM -0200, Mauro Carvalho Chehab wrote: >>> Hi Martin, >>> >>> Em Wed, 11 Dec 2013 21:34:55 +0100 >>> Martin Kittel escreveu: >>> >>>> Hi Mauro, hi Sean, >>>> >>>> thanks for considering the patch. I have added an updated version at the >>>> end of this mail. >>>> >>>> Regarding the info Sean was requesting, it is indeed an xhci hub. I also >>>> added the details of the remote itself. >>>> >>>> Please let me know if there is anything missing. >>>> >>>> Best wishes, >>>> >>>> Martin. >>>> >>>> >>>> lsusb -vvv >>>> ------ >>>> Bus 001 Device 002: ID 2304:0225 Pinnacle Systems, Inc. Remote Kit >>>> Infrared Transceiver >>>> Device Descriptor: >>>> bLength 18 >>>> bDescriptorType 1 >>>> bcdUSB 2.00 >>>> bDeviceClass 0 (Defined at Interface level) >>>> bDeviceSubClass 0 >>>> bDeviceProtocol 0 >>>> bMaxPacketSize0 8 >>>> idVendor 0x2304 Pinnacle Systems, Inc. >>>> idProduct 0x0225 Remote Kit Infrared Transceiver >>>> bcdDevice 0.01 >>>> iManufacturer 1 Pinnacle Systems >>>> iProduct 2 PCTV Remote USB >>>> iSerial 5 7FFFFFFFFFFFFFFF >>>> bNumConfigurations 1 >>>> Configuration Descriptor: >>>> bLength 9 >>>> bDescriptorType 2 >>>> wTotalLength 32 >>>> bNumInterfaces 1 >>>> bConfigurationValue 1 >>>> iConfiguration 3 StandardConfiguration >>>> bmAttributes 0xa0 >>>> (Bus Powered) >>>> Remote Wakeup >>>> MaxPower 100mA >>>> Interface Descriptor: >>>> bLength 9 >>>> bDescriptorType 4 >>>> bInterfaceNumber 0 >>>> bAlternateSetting 0 >>>> bNumEndpoints 2 >>>> bInterfaceClass 255 Vendor Specific Class >>>> bInterfaceSubClass 0 >>>> bInterfaceProtocol 0 >>>> iInterface 4 StandardInterface >>>> Endpoint Descriptor: >>>> bLength 7 >>>> bDescriptorType 5 >>>> bEndpointAddress 0x81 EP 1 IN >>>> bmAttributes 2 >>>> Transfer Type Bulk >>>> Synch Type None >>>> Usage Type Data >>>> wMaxPacketSize 0x0040 1x 64 bytes >>>> bInterval 10 >>> >>> Hmm... interval is equal to 10, e. g. 125us * 2^(10 - 1) = 64 ms. >>> >>> I'm wandering why mceusb is just forcing the interval to 1 (125ms). That >>> sounds wrong, except, of course, if the endpoint descriptor is wrong. >> >> Note that the endpoint descriptor describes it as a bulk endpoint, but >> it is used as a interrupt endpoint by the driver. For bulk endpoints, >> the interval should not be used (?). >> >> Maybe the correct solution would be to use the endpoints as bulk endpoints >> if that is what the endpoint says? mceusb devices come in interrupt and >> bulk flavours. > > Yes, this could be a possible fix. > I have tried this and the driver is working fine without my initial fix. I haven't been running with the bulk setting for long, but so far I haven't seen the spurious 'xhci_queue_intr_tx: callbacks suppressed' messages like I have before. The current version of the patch against 3.13-rc8 is below. Please let me know if there is anything else I should check or further rework is needed. Thanks for your help and best wishes, Martin. ----------- From a71676dad29adef9cafb08598e693ec308ba2e95 Mon Sep 17 00:00:00 2001 From: Martin Kittel Date: Sun, 19 Jan 2014 21:24:55 +0100 Subject: [PATCH] mceusb: use endpoint xfer mode as advertised mceusb always sets endpoints to interrupt transfer mode no matter what the device itself is advertising. This causes trouble on xhci hubs. This patch changes the behavior to honor the device endpoint settings. Signed-off-by: Martin Kittel --- drivers/media/rc/mceusb.c | 51 ++++++++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 23 deletions(-) if (ep_in == NULL) { diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c index a25bb15..67df9a6 100644 --- a/drivers/media/rc/mceusb.c +++ b/drivers/media/rc/mceusb.c @@ -1277,32 +1277,37 @@ static int mceusb_dev_probe(struct usb_interface *intf, if ((ep_in == NULL) && ((ep->bEndpointAddress & USB_ENDPOINT_DIR_MASK) - == USB_DIR_IN) - && (((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) - == USB_ENDPOINT_XFER_BULK) - || ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) - == USB_ENDPOINT_XFER_INT))) { - - ep_in = ep; - ep_in->bmAttributes = USB_ENDPOINT_XFER_INT; - ep_in->bInterval = 1; - mce_dbg(&intf->dev, "acceptable inbound endpoint " - "found\n"); + == USB_DIR_IN)) { + if ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) + == USB_ENDPOINT_XFER_BULK) { + ep_in = ep; + mce_dbg(&intf->dev, "acceptable bulk inbound endpoint " + "found\n"); + } + if ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) + == USB_ENDPOINT_XFER_INT) { + ep_in = ep; + ep_in->bInterval = 1; + mce_dbg(&intf->dev, "acceptable interrupt inbound endpoint " + "found\n"); + } } - if ((ep_out == NULL) && ((ep->bEndpointAddress & USB_ENDPOINT_DIR_MASK) - == USB_DIR_OUT) - && (((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) - == USB_ENDPOINT_XFER_BULK) - || ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) - == USB_ENDPOINT_XFER_INT))) { - - ep_out = ep; - ep_out->bmAttributes = USB_ENDPOINT_XFER_INT; - ep_out->bInterval = 1; - mce_dbg(&intf->dev, "acceptable outbound endpoint " - "found\n"); + == USB_DIR_OUT)) { + if ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) + == USB_ENDPOINT_XFER_BULK) { + ep_out = ep; + mce_dbg(&intf->dev, "acceptable bulk outbound endpoint " + "found\n"); + } + if ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) + == USB_ENDPOINT_XFER_INT) { + ep_out = ep; + ep_out->bInterval = 1; + mce_dbg(&intf->dev, "acceptable interrupt outbound endpoint " + "found\n"); + } } }