* [PATCH] HID: make timeout HZ independent
@ 2015-05-02 15:55 Nicholas Mc Guire
2015-05-07 8:33 ` Jiri Kosina
0 siblings, 1 reply; 2+ messages in thread
From: Nicholas Mc Guire @ 2015-05-02 15:55 UTC (permalink / raw)
To: Jiri Kosina; +Cc: linux-input, linux-kernel, Nicholas Mc Guire
wait_event_interruptible_timeout() expects a timeout in jiffies so the
numeric constant becomes HZ dependent - put it through msecs_to_jiffies()
to make it HZ independent.
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
---
The comment indicates that the expected timeout should be 40 milliseconds
Patch was compile tested with x86_64_defconfig (implies
CONFIG_HID_LOGITECH=y)
Patch is against 4.0-rc1 (localversion-next is -next-20150501)
drivers/hid/hid-lg.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/hid/hid-lg.c b/drivers/hid/hid-lg.c
index b86c18e..2671de9 100644
--- a/drivers/hid/hid-lg.c
+++ b/drivers/hid/hid-lg.c
@@ -700,7 +700,8 @@ static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id)
/* insert a little delay of 10 jiffies ~ 40ms */
wait_queue_head_t wait;
init_waitqueue_head (&wait);
- wait_event_interruptible_timeout(wait, 0, 10);
+ wait_event_interruptible_timeout(wait, 0,
+ msecs_to_jiffies(40));
/* Select random Address */
buf[1] = 0xB2;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] HID: make timeout HZ independent
2015-05-02 15:55 [PATCH] HID: make timeout HZ independent Nicholas Mc Guire
@ 2015-05-07 8:33 ` Jiri Kosina
0 siblings, 0 replies; 2+ messages in thread
From: Jiri Kosina @ 2015-05-07 8:33 UTC (permalink / raw)
To: Nicholas Mc Guire; +Cc: linux-input, linux-kernel
On Sat, 2 May 2015, Nicholas Mc Guire wrote:
> wait_event_interruptible_timeout() expects a timeout in jiffies so the
> numeric constant becomes HZ dependent - put it through msecs_to_jiffies()
> to make it HZ independent.
>
> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Applied to for-4.2/logitech. Thanks,
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-05-07 8:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-02 15:55 [PATCH] HID: make timeout HZ independent Nicholas Mc Guire
2015-05-07 8:33 ` Jiri Kosina
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.