Skip to content

Commit

Permalink
HID: Only dump input if someone is listening
Browse files Browse the repository at this point in the history
Going through the motions of printing the debug message information
takes a long time; using the keyboard can lead to a 160 us irqsoff
latency. This patch skips hid_dump_input() when there are no open
handles, which brings latency down to 100 us.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Henrik Rydberg authored and Jiri Kosina committed Sep 2, 2012
1 parent 67ddbb3 commit 9bfc8da
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/hid/hid-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,8 @@ static void hid_process_event(struct hid_device *hid, struct hid_field *field,
struct hid_driver *hdrv = hid->driver;
int ret;

hid_dump_input(hid, usage, value);
if (!list_empty(&hid->debug_list))
hid_dump_input(hid, usage, value);

if (hdrv && hdrv->event && hid_match_usage(hid, usage)) {
ret = hdrv->event(hid, field, usage, value);
Expand Down

0 comments on commit 9bfc8da

Please sign in to comment.