linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c-hid: Fix "incomplete report" noise
@ 2018-06-22 16:25 Jason Andryuk
  2018-07-09 12:14 ` Jason Andryuk
  2018-07-09 12:29 ` Jiri Kosina
  0 siblings, 2 replies; 3+ messages in thread
From: Jason Andryuk @ 2018-06-22 16:25 UTC (permalink / raw)
  To: linux-kernel
  Cc: john-s-84, Jason Andryuk, stable, Jiri Kosina,
	Benjamin Tissoires, linux-input

Commit ac75a041048b ("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.

Reported-by: John Smith <john-s-84@gmx.net>
Cc: stable@vger.kernel.org
Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
---
John Smith originally reported this, but his post did not include a git
formatted patch nor a Signed-off-by.
https://www.spinics.net/lists/linux-input/msg56171.html
https://patchwork.kernel.org/patch/10374383/

When ret_size is 2, hid_input_report is passed 0 and returns early.  ret_size
== 2 seems to be a header size saying there is no content.  Should
i2c_hid_get_input just return early in that case?

Also, should this condition be noted to stop an interrupt from firing to
avoid the ~50 bogus messages?

 drivers/hid/i2c-hid/i2c-hid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
index c1652bb7bd15..eae0cb3ddec6 100644
--- a/drivers/hid/i2c-hid/i2c-hid.c
+++ b/drivers/hid/i2c-hid/i2c-hid.c
@@ -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;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] i2c-hid: Fix "incomplete report" noise
  2018-06-22 16:25 [PATCH] i2c-hid: Fix "incomplete report" noise Jason Andryuk
@ 2018-07-09 12:14 ` Jason Andryuk
  2018-07-09 12:29 ` Jiri Kosina
  1 sibling, 0 replies; 3+ messages in thread
From: Jason Andryuk @ 2018-07-09 12:14 UTC (permalink / raw)
  To: open list, Jiri Kosina, Benjamin Tissoires
  Cc: john-s-84, Jason Andryuk, stable, linux-input

Ping?

The logging here is very excessive.  If not this change, then some
other change is needed to cut down on the sheer quantity of messages.

Thanks,
Jason


On Fri, Jun 22, 2018 at 12:25 PM, Jason Andryuk <jandryuk@gmail.com> wrote:
> Commit ac75a041048b ("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.
>
> Reported-by: John Smith <john-s-84@gmx.net>
> Cc: stable@vger.kernel.org
> Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
> ---
> John Smith originally reported this, but his post did not include a git
> formatted patch nor a Signed-off-by.
> https://www.spinics.net/lists/linux-input/msg56171.html
> https://patchwork.kernel.org/patch/10374383/
>
> When ret_size is 2, hid_input_report is passed 0 and returns early.  ret_size
> == 2 seems to be a header size saying there is no content.  Should
> i2c_hid_get_input just return early in that case?
>
> Also, should this condition be noted to stop an interrupt from firing to
> avoid the ~50 bogus messages?
>
>  drivers/hid/i2c-hid/i2c-hid.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
> index c1652bb7bd15..eae0cb3ddec6 100644
> --- a/drivers/hid/i2c-hid/i2c-hid.c
> +++ b/drivers/hid/i2c-hid/i2c-hid.c
> @@ -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;
> --
> 2.17.1
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] i2c-hid: Fix "incomplete report" noise
  2018-06-22 16:25 [PATCH] i2c-hid: Fix "incomplete report" noise Jason Andryuk
  2018-07-09 12:14 ` Jason Andryuk
@ 2018-07-09 12:29 ` Jiri Kosina
  1 sibling, 0 replies; 3+ messages in thread
From: Jiri Kosina @ 2018-07-09 12:29 UTC (permalink / raw)
  To: Jason Andryuk
  Cc: linux-kernel, john-s-84, stable, Benjamin Tissoires, linux-input

On Fri, 22 Jun 2018, Jason Andryuk wrote:

> Commit ac75a041048b ("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.
> 
> Reported-by: John Smith <john-s-84@gmx.net>
> Cc: stable@vger.kernel.org
> Signed-off-by: Jason Andryuk <jandryuk@gmail.com>

Applied, thanks.

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-07-09 12:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-22 16:25 [PATCH] i2c-hid: Fix "incomplete report" noise Jason Andryuk
2018-07-09 12:14 ` Jason Andryuk
2018-07-09 12:29 ` Jiri Kosina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).