[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJZ5v0hxDDrN8DyKws1R-3GabjHcQ4eua2wyTQsueqnqa6Y4+Q@mail.gmail.com>
Date: Thu, 16 May 2024 12:26:34 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: "Rafael J. Wysocki" <rjw@...ysocki.net>, Linux ACPI <linux-acpi@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>, Hans de Goede <hdegoede@...hat.com>,
Mario Limonciello <mario.limonciello@....com>, Armin Wolf <w_armin@....de>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>
Subject: Re: [PATCH v2 1/2] ACPI: EC: Install address space handler at the
namespace root
On Thu, May 16, 2024 at 12:22 PM Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> wrote:
>
> On Wed, May 15, 2024 at 09:40:54PM +0200, Rafael J. Wysocki wrote:
> > From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> >
> > It is reported that _DSM evaluation fails in ucsi_acpi_dsm() on Lenovo
> > IdeaPad Pro 5 due to a missing address space handler for the EC address
> > space:
> >
> > ACPI Error: No handler for Region [ECSI] (000000007b8176ee) [EmbeddedControl] (20230628/evregion-130)
> >
> > This happens because if there is no ECDT, the EC driver only registers
> > the EC address space handler for operation regions defined in the EC
> > device scope of the ACPI namespace while the operation region being
> > accessed by the _DSM in question is located beyond that scope.
> >
> > To address this, modify the ACPI EC driver to install the EC address
> > space handler at the root of the ACPI namespace for the first EC that
> > can be found regardless of whether or not an ECDT is present.
> >
> > Note that this change is consistent with some examples in the ACPI
> > specification in which EC operation regions located outside the EC
> > device scope are used (for example, see Section 9.17.15 in ACPI 6.5),
> > so the current behavior of the EC driver is arguably questionable.
>
> ...
>
> > - status = acpi_install_address_space_handler_no_reg(ec->handle,
> > + status = acpi_install_address_space_handler_no_reg(scope_handle,
> > ACPI_ADR_SPACE_EC,
> > &acpi_ec_space_handler,
> > NULL, ec);
>
> Looking at this...
>
> > if (ACPI_FAILURE(acpi_remove_address_space_handler(
> > + scope_handle,
> > + ACPI_ADR_SPACE_EC,
> > + &acpi_ec_space_handler)))
>
> ...and this, I believe you can move scope_handle to the previous line and align
> the rest for the sake of consistency and slightly better readability.
Well, I prefer to cut a separate cleanup patch to make this more consistent.
Powered by blists - more mailing lists