Linux-ACPI Archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Linux ACPI <linux-acpi@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Hans de Goede <hdegoede@redhat.com>,
	Mario Limonciello <mario.limonciello@amd.com>,
	Armin Wolf <w_armin@gmx.de>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>
Subject: Re: [PATCH v2 1/2] ACPI: EC: Install address space handler at the namespace root
Date: Thu, 16 May 2024 13:22:35 +0300	[thread overview]
Message-ID: <ZkXea4fdJwgvu0Hm@smile.fi.intel.com> (raw)
In-Reply-To: <6046110.lOV4Wx5bFT@kreacher>

On Wed, May 15, 2024 at 09:40:54PM +0200, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.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.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2024-05-16 10:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-15 19:39 [PATCH v2 0/2] ACPI: EC: Install EC address space handler at the namespace root Rafael J. Wysocki
2024-05-15 19:40 ` [PATCH v2 1/2] ACPI: EC: Install " Rafael J. Wysocki
2024-05-16 10:22   ` Andy Shevchenko [this message]
2024-05-16 10:26     ` Rafael J. Wysocki
2024-05-15 19:43 ` [PATCH v2 2/2] platform/x86: wmi: Remove custom EC address space handler Rafael J. Wysocki
2024-05-16  8:35 ` [PATCH v2 0/2] ACPI: EC: Install EC address space handler at the namespace root Hans de Goede
2024-05-16  8:37   ` Rafael J. Wysocki
2024-05-16  9:50     ` Hans de Goede
2024-05-16  9:54       ` Hans de Goede
2024-05-16 10:09       ` Rafael J. Wysocki
2024-05-16 10:13         ` Hans de Goede
2024-05-16 10:21           ` Rafael J. Wysocki
2024-05-16  8:51 ` Limonciello, Mario
2024-05-16 10:24 ` Andy Shevchenko

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=ZkXea4fdJwgvu0Hm@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=hdegoede@redhat.com \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=rjw@rjwysocki.net \
    --cc=w_armin@gmx.de \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).