public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: Jiri Kosina <jkosina@suse.cz>,
	Mark Rutland <mark.rutland@arm.com>,
	sb@m-labs.hk, linux-input@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] HID: i2c-hid: Read wMaxInputLength of input report instead of bufsize
Date: Tue, 24 Feb 2015 09:05:22 +0200	[thread overview]
Message-ID: <20150224070522.GE1758@lahna.fi.intel.com> (raw)
In-Reply-To: <20150223152630.GE27578@mail.corp.redhat.com>

On Mon, Feb 23, 2015 at 10:26:35AM -0500, Benjamin Tissoires wrote:
> On Feb 23 2015 or thereabouts, Mika Westerberg wrote:
> > Wacom digitizer (WCOM0008) on Lenovo Thinkpad 10 seems to allow reading of
> > subsequent reports (or part of them) if we read more than wMaxInputLength
> > of data at the time. This data is not always aligned so that the next
> > report would start right after another.
> > 
> > For example we might get following sequence:
> > 
> >  i2c_hid i2c-WCOM0008:00: input: 0a 00 02 21 20 17 ad 22 11 03
> >  i2c_hid i2c-WCOM0008:00: input: ad 22 11 03 0a 00 02 21 20 17
> >                                  ad 22 11 03 0a 00 02 21 20 17
> >                                  ad 22 11 03 0a 00 02 21 20 17
> >                                  ad 22 11 03 0a 00 02 21 20 17
> >                                  ad 22 11 03 0a 00 02 21 20 17
> >                                  ad 22 11 03 0a 00 02 21 20 17
> >                                  ad 22 11 03
> >  i2c_hid i2c-WCOM0008:00: input: 02 21 20 17 ad 22 11 03 0a 00
> >                                  02 21 20 17 ad 22 11 03 0a 00
> >                                  02 21 20 17 ad 22 11 03 0a 00
> >                                  02 21 20 17 ad 22 11 03 0a 00
> >                                  02 21 20 17 ad 22 11 03 0a 00
> >                                  02 21 20 17 ad 22 11 03 0a 00
> >                                  02 21 20 17
> >  i2c_hid i2c-WCOM0008:00: i2c_hid_get_input: incomplete report (76/8450)
> > 
> > The bufsize is 76 and wMaxInputLength is 10. In above example the first
> > read gets right amount of data. The second and third reads get full bufsize
> > (76 bytes) but the report is missing a start already. This causes the
> > driver to reject the report because we got less than was expected by the
> > report length (0x2102 = 8450).
> > 
> > If we read only wMaxInputLength at the time this does not happen at all and
> > the digitizer works fine.
> > 
> > Based on this change the driver to read wMaxInputLength bytes instead of
> > bufsize if the value looks sane.
> > 
> > Reported-by: Sébastien Bourdeauducq <sb@m-labs.hk>
> > Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> > ---
> 
> We can actually drop this one. Jiri already applied a patch sent last
> week which does the exact same thing:
> https://patchwork.kernel.org/patch/5857521/ (should appear shortly in
> Jiri's tree I guess).

Indeed looks like it does the same. Thanks for letting me know.

> But thanks for confirming that it was really needed for other devices.

No problem :-)

  reply	other threads:[~2015-02-24  7:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-23 13:52 [PATCH 0/3] HID: Support for Lenovo Thinkpad 10 digitizer Mika Westerberg
2015-02-23 13:52 ` [PATCH 1/3] HID: wacom: Add support for I2C connected devices Mika Westerberg
2015-02-23 15:22   ` Benjamin Tissoires
2015-02-24 10:31   ` Jiri Kosina
2015-02-23 13:52 ` [PATCH 2/3] HID: i2c-hid: Read wMaxInputLength of input report instead of bufsize Mika Westerberg
2015-02-23 15:26   ` Benjamin Tissoires
2015-02-24  7:05     ` Mika Westerberg [this message]
2015-02-23 13:52 ` [PATCH 3/3] HID: i2c-hid: Add support for ACPI GPIO interrupts Mika Westerberg
2015-02-23 15:35   ` Benjamin Tissoires
2015-02-24  7:42     ` Mika Westerberg
2015-02-24 20:02   ` Jiri Kosina
2015-02-24 21:27   ` Antonio Ospite
2015-02-25  8:02     ` Mika Westerberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150224070522.GE1758@lahna.fi.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=jkosina@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=sb@m-labs.hk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox