Skip to content

Commit

Permalink
HID: i2c-hid: Fix "incomplete report" noise
Browse files Browse the repository at this point in the history
Commit ac75a04 ("HID: i2c-hid: fix size check and type usage") started
writing messages when the ret_size is <= 2 from i2c_master_recv.  However, my
device i2c-DLL07D1 returns 2 for a short period of time (~0.5s) after I stop
moving the pointing stick or touchpad.  It varies, but you get ~50 messages
each time which spams the log hard.

[  95.925055] i2c_hid i2c-DLL07D1:01: i2c_hid_get_input: incomplete report (83/2)

This has also been observed with a i2c-ALP0017.

[ 1781.266353] i2c_hid i2c-ALP0017:00: i2c_hid_get_input: incomplete report (30/2)

Only print the message when ret_size is totally invalid and less than 2 to cut
down on the log spam.

Fixes: ac75a04 ("HID: i2c-hid: fix size check and type usage")
Reported-by: John Smith <[email protected]>
Cc: [email protected]
Signed-off-by: Jason Andryuk <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
  • Loading branch information
jandryuk authored and Jiri Kosina committed Jul 9, 2018
1 parent 3b8d573 commit ef6eaf2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/hid/i2c-hid/i2c-hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ static void i2c_hid_get_input(struct i2c_hid *ihid)
return;
}

if ((ret_size > size) || (ret_size <= 2)) {
if ((ret_size > size) || (ret_size < 2)) {
dev_err(&ihid->client->dev, "%s: incomplete report (%d/%d)\n",
__func__, size, ret_size);
return;
Expand Down

0 comments on commit ef6eaf2

Please sign in to comment.