public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* Patch mceusb: fix invalid urb interval
@ 2013-11-10 10:50 Martin Kittel
  2013-12-10 16:20 ` Mauro Carvalho Chehab
  2013-12-11 13:17 ` Sean Young
  0 siblings, 2 replies; 15+ messages in thread
From: Martin Kittel @ 2013-11-10 10:50 UTC (permalink / raw)
  To: linux-media

Hi,

I had trouble getting my MCE remote control to work on my new Intel
mainboard. It was working fine with older boards but with the new board
there would be no reply from the remote just after the setup package was
received during the init phase.
I traced the problem down to the mceusb_dev_recv function where the received
urb is resubmitted again. The problem is that my new board is so blazing
fast that the initial urb was processed in less than a single 125
microsecond interval, so the urb as it was received had urb->interval set to 0.
As the urb is just resubmitted as it came in it now had an invalid interval
set and was rejected.
The patch just resets urb->interval to its initial value and adds some error
diagnostics (which would have saved me a lot of time during my analysis).

Any comment is welcome.

Best wishes,

Martin.


diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c
index 3c76101..c5313cb 100644
--- a/drivers/media/rc/mceusb.c
+++ b/drivers/media/rc/mceusb.c
@@ -1030,7 +1030,7 @@ static void mceusb_process_ir_data(struct mceusb_dev *ir
 static void mceusb_dev_recv(struct urb *urb)
 {
        struct mceusb_dev *ir;
-       int buf_len;
+       int buf_len, res;
 
        if (!urb)
                return;
@@ -1067,7 +1067,11 @@ static void mceusb_dev_recv(struct urb *urb)
                break;
        }
 
-       usb_submit_urb(urb, GFP_ATOMIC);
+       urb->interval = ir->usb_ep_out->bInterval; /* reset urb interval */
+       res = usb_submit_urb(urb, GFP_ATOMIC);
+       if (res) {
+               mce_dbg(ir->dev, "restart request FAILED! (res=%d)\n", res);
+       }
 }
 
 static void mceusb_get_emulator_version(struct mceusb_dev *ir)



^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2014-11-04 22:39 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox