Re: [PATCH] ACPI / bus: skip the primary physical pnp device in companion_match

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 12/10/20 12:56 AM, Rafael J. Wysocki wrote:
On Wed, Dec 9, 2020 at 4:08 AM Hui Wang <hui.wang@xxxxxxxxxxxxx> wrote:

On 12/8/20 10:01 PM, Rafael J. Wysocki wrote:
On Tue, Dec 8, 2020 at 3:02 AM Hui Wang <hui.wang@xxxxxxxxxxxxx> wrote:
On 12/7/20 9:11 PM, Rafael J. Wysocki wrote:
On Fri, Dec 4, 2020 at 8:51 AM Hui Wang <hui.wang@xxxxxxxxxxxxx> wrote:
[cut]

Would dropping the device ID in question from acpi_pnp_device_ids[]
make the problem go away?

If so, why don't you do just that?
Yes, if remove "WACFXXX" from acpi_pnp_device_ids[], could fix this
issue. I planned to do so, but I found the pnp_driver in the
drivers/tty/serial/8250/8250_pnp.c still handle this ID, maybe it could
introduce regression on old machines if removing it.
Well, "WACFXXX" is not a proper device ID, it is a wild card possibly
matching too many devices.

What device ID specifically is used in the ACPI tables for the device
in question?
It is "WACF2200", how about the change as below, is it safe to say the
length of a pnp device id is 7?

diff --git a/drivers/acpi/acpi_pnp.c b/drivers/acpi/acpi_pnp.c
index 4ed755a963aa..1e828378238c 100644
--- a/drivers/acpi/acpi_pnp.c
+++ b/drivers/acpi/acpi_pnp.c
@@ -336,6 +336,10 @@ static bool acpi_pnp_match(const char *idstr, const
struct acpi_device_id **matc
   {
          const struct acpi_device_id *devid;

+       /* Expect the pnp device id has CCCdddd format (C character, d
digital) */
+       if (strlen(idstr) != 7)
+               return false;
+
          for (devid = acpi_pnp_device_ids; devid->id[0]; devid++)
                  if (matching_id(idstr, (char *)devid->id)) {
                          if (matchid)
Alternatively, matching_id() can be updated to compare the length
(which arguably it should be doing).

OK, got it, will do the change in the matching_id().

(putting the length checking in acpi_pnp_match() at least has one benefit, it could reduce some meaningless loops)





[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux