Re: [PATCH 3/3] HID: usbhid: defer LED setting to a workqueue

From: Oliver Neukum
Date: Mon Nov 07 2011 - 09:47:14 EST


Am Dienstag, 1. November 2011, 10:25:47 schrieb Daniel Kurtz:
> Defer LED setting action to a workqueue.
> This is more likely to perform all LED change events in a single URB.
>
> Signed-off-by: Daniel Kurtz <djkurtz@xxxxxxxxxxxx>
> ---
> drivers/hid/hid-input.c | 42 ++++++++++++++++++++++++++++++++++++++++
> drivers/hid/usbhid/hid-core.c | 43 +++++++++++++++++++++++++++++++---------
> drivers/hid/usbhid/usbhid.h | 2 +
> include/linux/hid.h | 2 +

> @@ -1292,6 +1314,7 @@ static void hid_cancel_delayed_stuff(struct usbhid_device *usbhid)
> {
> del_timer_sync(&usbhid->io_retry);
> cancel_work_sync(&usbhid->reset_work);
> + cancel_work_sync(&usbhid->led_work);
> }

Hi,

this seems to introduce a race in usbhid_stop() which might fail to kill the urb
used to change the LEDs.

Regards
Oliver
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/