Patch mceusb: fix invalid urb interval

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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)


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux