[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0guHdbZTsU5e7KDAHDy9Gnh67JwtSSCeDaK8mUwAk1d3g@mail.gmail.com>
Date: Fri, 15 May 2020 18:32:14 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Ard Biesheuvel <ardb@...nel.org>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
Len Brown <lenb@...nel.org>,
ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
Stable <stable@...r.kernel.org>
Subject: Re: [PATCH] ACPI: GED: add support for _Exx / _Lxx handler methods
On Fri, May 15, 2020 at 11:37 AM Ard Biesheuvel <ardb@...nel.org> wrote:
>
> Per the ACPI spec, interrupts in the range [0, 255] may be handled
> in AML using individual methods whose naming is based on the format
> _Exx or _Lxx, where xx is the hex representation of the interrupt
> index.
>
> Add support for this missing feature to our ACPI GED driver.
>
> Cc: "Rafael J. Wysocki" <rjw@...ysocki.net>
> Cc: Len Brown <lenb@...nel.org>
> Cc: linux-acpi@...r.kernel.org
> Cc: <stable@...r.kernel.org> # v4.9+
> Signed-off-by: Ard Biesheuvel <ardb@...nel.org>
> ---
> drivers/acpi/evged.c | 22 +++++++++++++++++---
> 1 file changed, 19 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/acpi/evged.c b/drivers/acpi/evged.c
> index aba0d0027586..6d7a522952bf 100644
> --- a/drivers/acpi/evged.c
> +++ b/drivers/acpi/evged.c
> @@ -79,6 +79,8 @@ static acpi_status acpi_ged_request_interrupt(struct acpi_resource *ares,
> struct resource r;
> struct acpi_resource_irq *p = &ares->data.irq;
> struct acpi_resource_extended_irq *pext = &ares->data.extended_irq;
> + char ev_name[5];
> + u8 trigger;
>
> if (ares->type == ACPI_RESOURCE_TYPE_END_TAG)
> return AE_OK;
> @@ -87,14 +89,28 @@ static acpi_status acpi_ged_request_interrupt(struct acpi_resource *ares,
> dev_err(dev, "unable to parse IRQ resource\n");
> return AE_ERROR;
> }
> - if (ares->type == ACPI_RESOURCE_TYPE_IRQ)
> + if (ares->type == ACPI_RESOURCE_TYPE_IRQ) {
> gsi = p->interrupts[0];
> - else
> + trigger = p->triggering;
> + } else {
> gsi = pext->interrupts[0];
> + trigger = p->triggering;
> + }
>
> irq = r.start;
>
> - if (ACPI_FAILURE(acpi_get_handle(handle, "_EVT", &evt_handle))) {
> + switch (gsi) {
> + case 0 ... 255:
> + sprintf(ev_name, "_%c%02hhX",
> + trigger == ACPI_EDGE_SENSITIVE ? 'E' : 'L', gsi);
> +
> + if (ACPI_SUCCESS(acpi_get_handle(handle, ev_name, &evt_handle)))
> + break;
> + /* fall through */
> + default:
> + if (ACPI_SUCCESS(acpi_get_handle(handle, "_EVT", &evt_handle)))
> + break;
> +
> dev_err(dev, "cannot locate _EVT method\n");
> return AE_ERROR;
> }
> --
Applied as 5.8 material, thanks!
Powered by blists - more mailing lists