public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <m.chehab@samsung.com>
To: Martin Kittel <linux@martin-kittel.de>
Cc: linux-media@vger.kernel.org, Jarod Wilson <jwilson@redhat.com>,
	Sean Young <sean@mess.org>
Subject: Re: Patch mceusb: fix invalid urb interval
Date: Wed, 15 Jan 2014 13:49:17 -0200	[thread overview]
Message-ID: <20140115134917.1450f87c@samsung.com> (raw)
In-Reply-To: <l8ai94$cbr$1@ger.gmane.org>

Hi Martin,

Em Wed, 11 Dec 2013 21:34:55 +0100
Martin Kittel <linux@martin-kittel.de> 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.

On my eyes, though, 64ms seems to be a good enough interval to get
those events.

Jarod/Sean,

Are there any good reason for the mceusb driver to do this?
	ep_in->bInterval = 1;
	ep_out->bInterval = 1;

At least on my tests here with audio with xHCI and EHCI with audio on
em28xx, it seems that EHCI just uses the USB endpoint interval, when
urb->interval == 1, while xHCI uses whatever value stored there.

So, IMHO, the right fix would be to do:

diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c
index a25bb1581e46..9a0c2ca53f3a 100644
--- a/drivers/media/rc/mceusb.c
+++ b/drivers/media/rc/mceusb.c
@@ -1285,7 +1285,6 @@ static int mceusb_dev_probe(struct usb_interface *intf,
 
 			ep_in = ep;
 			ep_in->bmAttributes = USB_ENDPOINT_XFER_INT;
-			ep_in->bInterval = 1;
 			mce_dbg(&intf->dev, "acceptable inbound endpoint "
 				"found\n");
 		}
@@ -1300,7 +1299,6 @@ static int mceusb_dev_probe(struct usb_interface *intf,
 
 			ep_out = ep;
 			ep_out->bmAttributes = USB_ENDPOINT_XFER_INT;
-			ep_out->bInterval = 1;
 			mce_dbg(&intf->dev, "acceptable outbound endpoint "
 				"found\n");
 		}


Martin,

Could you please see if the above patch is enough to fix it?

Thanks!
Mauro

  reply	other threads:[~2014-01-15 15:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-10 10:50 Patch mceusb: fix invalid urb interval Martin Kittel
2013-12-10 16:20 ` Mauro Carvalho Chehab
2013-12-11 13:17 ` Sean Young
2013-12-11 20:34   ` Martin Kittel
2014-01-15 15:49     ` Mauro Carvalho Chehab [this message]
2014-01-15 16:52       ` Sean Young
2014-01-15 17:59         ` Mauro Carvalho Chehab
2014-01-19 21:05           ` Martin Kittel
2014-01-19 21:56             ` Sean Young
2014-01-20 17:36               ` Jarod Wilson
2014-11-03 16:49                 ` Mauro Carvalho Chehab
2014-11-04 21:25                   ` Sean Young
2014-11-04 22:39                     ` Mauro Carvalho Chehab
2014-01-16  2:55         ` Jarod Wilson
2014-01-20 21:29           ` Sean Young

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140115134917.1450f87c@samsung.com \
    --to=m.chehab@samsung.com \
    --cc=jwilson@redhat.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux@martin-kittel.de \
    --cc=sean@mess.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox