From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Hui Wang <hui.wang@canonical.com>
Cc: ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
Rafael Wysocki <rafael.j.wysocki@intel.com>,
Len Brown <lenb@kernel.org>
Subject: Re: [PATCH v4] ACPI / PNP: compare the string length in the matching_id
Date: Tue, 15 Dec 2020 19:32:15 +0100 [thread overview]
Message-ID: <CAJZ5v0jaL9ZyaDSV-QMaZgM+ppta90O0=MFdevJdhDnJ5yU2eA@mail.gmail.com> (raw)
In-Reply-To: <20201211021814.36193-1-hui.wang@canonical.com>
On Fri, Dec 11, 2020 at 3:19 AM Hui Wang <hui.wang@canonical.com> wrote:
>
> Recently we met a touchscreen problem on some Thinkpad machines, the
> touchscreen driver (i2c-hid) is not loaded and the touchscreen can't
> work.
>
> An i2c ACPI device with the name WACF2200 is defined in the BIOS, with
> the current rule in matching_id(), this device will be regarded as
> a PNP device since there is WACFXXX in the acpi_pnp_device_ids[] and
> this PNP device is attached to the acpi device as the 1st
> physical_node, this will make the i2c bus match fail when i2c bus
> calls acpi_companion_match() to match the acpi_id_table in the i2c-hid
> driver.
>
> WACF2200 is an i2c device instead of a PNP device, after adding the
> string length comparing, the matching_id() will return false when
> matching WACF2200 and WACFXXX, and it is reasonable to compare the
> string length when matching two ids.
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Hui Wang <hui.wang@canonical.com>
> ---
> Sorry, the v3 patch has mis-spelling word in the commit header, so fix
> it and send the v4 patch.
>
> drivers/acpi/acpi_pnp.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/acpi/acpi_pnp.c b/drivers/acpi/acpi_pnp.c
> index 4ed755a963aa..8f2dc176bb41 100644
> --- a/drivers/acpi/acpi_pnp.c
> +++ b/drivers/acpi/acpi_pnp.c
> @@ -319,6 +319,9 @@ static bool matching_id(const char *idstr, const char *list_id)
> {
> int i;
>
> + if (strlen(idstr) != strlen(list_id))
> + return false;
> +
> if (memcmp(idstr, list_id, 3))
> return false;
>
> --
Applied as 5.11-rc material, thanks!
prev parent reply other threads:[~2020-12-15 18:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-11 2:18 [PATCH v4] ACPI / PNP: compare the string length in the matching_id Hui Wang
2020-12-15 18:32 ` Rafael J. Wysocki [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='CAJZ5v0jaL9ZyaDSV-QMaZgM+ppta90O0=MFdevJdhDnJ5yU2eA@mail.gmail.com' \
--to=rafael@kernel.org \
--cc=hui.wang@canonical.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=rafael.j.wysocki@intel.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).