stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Kosina <jikos@kernel.org>
To: Mark Pearson <mpearson@squebb.ca>
Cc: "Hans de Goede" <hdegoede@redhat.com>,
	"Benjamin Tissoires" <benjamin.tissoires@redhat.com>,
	"Kenny Levinsen" <kl@kl.wtf>, "Philip Müller" <philm@manjaro.org>,
	"Douglas Anderson" <dianders@chromium.org>,
	"Julian Sax" <jsbc@gmx.de>,
	ahormann@gmx.net, "Bruno Jesus" <bruno.fl.jesus@gmail.com>,
	Dietrich <enaut.w@googlemail.com>,
	kloxdami@yahoo.com, "Tim Aldridge" <taldridge@mac.com>,
	"Rene Wagner" <redhatbugzilla@callerid.de>,
	"Federico Ricchiuto" <fed.ricchiuto@gmail.com>,
	linux-input@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH v3] HID: i2c-hid: Revert to await reset ACK before reading report descriptor
Date: Wed, 3 Apr 2024 14:02:04 +0200 (CEST)	[thread overview]
Message-ID: <nycvar.YFH.7.76.2404031401411.20263@cbobk.fhfr.pm> (raw)
In-Reply-To: <e941980b-5efb-4ba7-aaf9-f0ed694fb39d@app.fastmail.com>

On Tue, 2 Apr 2024, Mark Pearson wrote:

> On Tue, Apr 2, 2024, at 7:10 AM, Hans de Goede wrote:
> > From: Kenny Levinsen <kl@kl.wtf>
> >
> > In af93a167eda9, i2c_hid_parse was changed to continue with reading the
> > report descriptor before waiting for reset to be acknowledged.
> >
> > This has lead to two regressions:
> >
> > 1. We fail to handle reset acknowledgment if it happens while reading
> >    the report descriptor. The transfer sets I2C_HID_READ_PENDING, which
> >    causes the IRQ handler to return without doing anything.
> >
> >    This affects both a Wacom touchscreen and a Sensel touchpad.
> >
> > 2. On a Sensel touchpad, reading the report descriptor this quickly
> >    after reset results in all zeroes or partial zeroes.
> >
> > The issues were observed on the Lenovo Thinkpad Z16 Gen 2.
> >
> > The change in question was made based on a Microsoft article[0] stating
> > that Windows 8 *may* read the report descriptor in parallel with
> > awaiting reset acknowledgment, intended as a slight reset performance
> > optimization. Perhaps they only do this if reset is not completing
> > quickly enough for their tastes?
> >
> > As the code is not currently ready to read registers in parallel with a
> > pending reset acknowledgment, and as reading quickly breaks the report
> > descriptor on the Sensel touchpad, revert to waiting for reset
> > acknowledgment before proceeding to read the report descriptor.
> >
> > [0]: 
> > https://learn.microsoft.com/en-us/windows-hardware/drivers/hid/plug-and-play-support-and-power-management
> >
> > Fixes: af93a167eda9 ("HID: i2c-hid: Move i2c_hid_finish_hwreset() to 
> > after reading the report-descriptor")
> > Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2271136
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Kenny Levinsen <kl@kl.wtf>
> > Link: https://lore.kernel.org/r/20240331182440.14477-1-kl@kl.wtf
> > [hdegoede@redhat.com Drop no longer necessary abort_reset error exit 
> > path]
> > Signed-off-by: Hans de Goede <hdegoede@redhat.com>
[ .. snip .. ]
> Tested on my Z13 G2 system and confirmed this fixes the issue.
> 
> Tested-by: Mark Pearson <mpearson-lenovo@squebb.ca>

Applied to hid.git#for-6.9/upstream-fixes. Thanks,

-- 
Jiri Kosina
SUSE Labs


      reply	other threads:[~2024-04-03 12:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-02 11:10 [PATCH v3] HID: i2c-hid: Revert to await reset ACK before reading report descriptor Hans de Goede
2024-04-02 18:09 ` Mark Pearson
2024-04-03 12:02   ` Jiri Kosina [this message]

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=nycvar.YFH.7.76.2404031401411.20263@cbobk.fhfr.pm \
    --to=jikos@kernel.org \
    --cc=ahormann@gmx.net \
    --cc=benjamin.tissoires@redhat.com \
    --cc=bruno.fl.jesus@gmail.com \
    --cc=dianders@chromium.org \
    --cc=enaut.w@googlemail.com \
    --cc=fed.ricchiuto@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=jsbc@gmx.de \
    --cc=kl@kl.wtf \
    --cc=kloxdami@yahoo.com \
    --cc=linux-input@vger.kernel.org \
    --cc=mpearson@squebb.ca \
    --cc=philm@manjaro.org \
    --cc=redhatbugzilla@callerid.de \
    --cc=stable@vger.kernel.org \
    --cc=taldridge@mac.com \
    /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;
as well as URLs for NNTP newsgroup(s).