public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Hui Wang <hui.wang@canonical.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	Rafael Wysocki <rafael.j.wysocki@intel.com>,
	manuelkrause@netscape.net
Subject: Re: [PATCH] ACPI: resources: add legacy irq override exception by DMI info
Date: Tue, 14 Sep 2021 12:39:01 +0800	[thread overview]
Message-ID: <583e76f8-a30b-eb52-18a8-c83ffe48886d@canonical.com> (raw)
In-Reply-To: <CAJZ5v0gocDX_XFDkUQuYkEEjkxFjPW_u0mf1ZzaHd6FWwAn+bQ@mail.gmail.com>


On 9/14/21 1:10 AM, Rafael J. Wysocki wrote:
> On Sat, Sep 4, 2021 at 3:44 AM Hui Wang <hui.wang@canonical.com> wrote:
>> After the commit 0ec4e55e9f57 ("ACPI: resources: Add checks for ACPI
>> IRQ override") is reverted, the keyboard of those Medion laptops can't
>> work again.
>>
>> To fix the keyboard issue, here adding an override check by DMI info,
>> this will not affect other machines and this design refers to
>> the prt_quirks[] in the drivers/acpi/pci_irq.c.
>>
>> If we meet similar issues on other platforms, we could expand the
>> table of skip_override_table[] or medion_laptop[].
>>
>> BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=213031
>> BugLink: http://bugs.launchpad.net/bugs/1909814
>> Reported-by: Manuel Krause <manuelkrause@netscape.net>
>> Tested-by: Manuel Krause <manuelkrause@netscape.net>
[...]
>> +                                        u8 shareable)
>> +{
>> +       int i;
>> +       const struct irq_override_cmp *en;
> This can be declared inside the for () loop.  Also, if "en" means
> "entry", please call the variable "entry".
OK, got it.
>
>> +
>> +       for (i = 0; i < ARRAY_SIZE(skip_override_table); i++) {
>> +               en = &skip_override_table[i];
>> +
>> +               if (dmi_check_system(en->system) &&
>> +                   en->irq == gsi &&
>> +                   en->triggering == triggering &&
>> +                   en->polarity == polarity &&
>> +                   en->shareable == shareable)
>> +                       return false;
>> +       }
>> +
>> +       return true;
>> +}
>> +
>>   /**
>>    * acpi_dev_resource_interrupt - Extract ACPI interrupt resource information.
>>    * @ares: Input ACPI resource object.
>> @@ -447,6 +491,7 @@ bool acpi_dev_resource_interrupt(struct acpi_resource *ares, int index,
>>   {
>>          struct acpi_resource_irq *irq;
>>          struct acpi_resource_extended_irq *ext_irq;
>> +       bool is_legacy;
>>
>>          switch (ares->type) {
>>          case ACPI_RESOURCE_TYPE_IRQ:
>> @@ -459,9 +504,14 @@ bool acpi_dev_resource_interrupt(struct acpi_resource *ares, int index,
>>                          irqresource_disabled(res, 0);
>>                          return false;
>>                  }
>> +
>> +               is_legacy = acpi_dev_legacy_irq_override(irq->interrupts[index],
>> +                                                        irq->triggering, irq->polarity,
>> +                                                        irq->shareable);
>> +
>>                  acpi_dev_get_irqresource(res, irq->interrupts[index],
>>                                           irq->triggering, irq->polarity,
>> -                                        irq->shareable, true);
>> +                                        irq->shareable, is_legacy);
> Maybe we can rename the last argument of acpi_dev_get_irqresource() to
> check_override (or similar) and do the check in there when that is
> set?

OK will change it as the suggestion.

Thanks.

>>                  break;
>>          case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
>>                  ext_irq = &ares->data.extended_irq;
>> --

      reply	other threads:[~2021-09-14  4:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-04  1:43 [PATCH] ACPI: resources: add legacy irq override exception by DMI info Hui Wang
2021-09-04 16:04 ` Manuel Krause
2021-09-13 13:14   ` Hui Wang
2021-09-13 17:10 ` Rafael J. Wysocki
2021-09-14  4:39   ` Hui Wang [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=583e76f8-a30b-eb52-18a8-c83ffe48886d@canonical.com \
    --to=hui.wang@canonical.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=manuelkrause@netscape.net \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rafael@kernel.org \
    /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