[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJZ5v0ifhK_Or1h20taM79qLXBHhe3BNObDHg3K56SRnG250Gw@mail.gmail.com>
Date: Mon, 25 Aug 2025 16:27:35 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: "Maciej S. Szmigiero" <mail@...iej.szmigiero.name>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>, Len Brown <lenb@...nel.org>, linux-acpi@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 0/2] HP EliteBook 855 G7 WWAN modem power resource quirk
On Sun, Aug 3, 2025 at 9:18 PM Maciej S. Szmigiero
<mail@...iej.szmigiero.name> wrote:
>
> This laptop (and possibly similar models too) has power resource called
> "GP12.PXP_" for its Intel XMM7360 WWAN modem.
>
> For this power resource to turn ON power for the modem it needs certain
> internal flag called "ONEN" to be set:
> Method (_ON, 0, NotSerialized) // _ON_: Power On
> {
> If (^^^LPCB.EC0.ECRG)
> {
> If ((ONEN == Zero))
> {
> Return (Zero)
> }
> (..)
> }
> }
>
> This flag only gets set from this power resource "_OFF" method, while the
> actual modem power gets turned off during suspend by "GP12.PTS" method
> called from the global "_PTS" (Prepare To Sleep) method.
>
> In fact, this power resource "_OFF" method implementation just sets the
> aforementioned flag:
> Method (_OFF, 0, NotSerialized) // _OFF: Power Off
> {
> OFEN = Zero
> ONEN = One
> }
>
> Upon hibernation finish we try to set this power resource back ON since its
> "_STA" method returns 0 and the resource is still considered in use as it
> is declared as required for D0 for both the modem ACPI device (GP12.PWAN)
> and its parent PCIe port ACPI device (GP12).
> But the "_ON" method won't do anything since that "ONEN" flag is not set.
>
> Overall, this means the modem is dead after hibernation finish until the
> laptop is rebooted since the modem power has been cut by "_PTS" and its PCI
> configuration was lost and not able to be restored.
>
> The easiest way to workaround this issue is to call this power resource
> "_OFF" method before calling the "_ON" method to make sure the "ONEN"
> flag gets properly set.
>
> This makes the modem alive once again after hibernation finish - with
> properly restored PCI configuration space.
>
> Since this platform does *not* support S3 the fact that
> acpi_resume_power_resources() is also called during resume from S3 is
> not a problem there.
>
> Do the DMI based quirk matching and quirk flag initialization just
> once - in acpi_power_resources_init() function similar to existing
> acpi_*_init() functions.
>
> This way the whole resume path overhead of this change on other systems
> amounts to simple hp_eb_gp12pxp_quirk flag comparison.
>
> Opportunistically convert the single already existing DMI match-based
> quirk in this ACPI power resource handler ("leave unused power
> resources on" quirk) to the same one-time initialization in
> acpi_power_resources_init() function instead of re-running that DMI
> match each time acpi_turn_off_unused_power_resources() gets called.
>
>
> This Intel WWAN modem in general has *a lot* of issues with
> suspend/resume on various laptop platforms (not only HP).
>
> More patches are needed for these, hopefully they can be mainlined
> too so suspend/resume work out of the box for users (that's
> important functionality on a laptop).
>
> See the following ModemManager issue containing patches also for
> Thinkpad T14 G1 and Dell Precision 3561:
> https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/992
>
>
> Changes from v2:
> * Split out the change adding power resource init function and converting
> existing DMI-based quirk into a separate preparatory patch.
>
> * Create a replacement __acpi_power_on() method for the affected power
> resource (including the power OFF and delay part) and call it from
> acpi_resume_power_resources() instead of ordinary __acpi_power_on()
> on the affected platform.
>
> * Rename leave_unused_power_resources_on_quirk into suggested shorter
> unused_power_resources_quirk.
>
>
> Maciej S. Szmigiero (2):
> ACPI: PM: Add power resource init function
> ACPI: PM: Add HP EliteBook 855 G7 WWAN modem power resource quirk
>
> drivers/acpi/internal.h | 1 +
> drivers/acpi/power.c | 90 +++++++++++++++++++++++++++++++++++++++--
> drivers/acpi/scan.c | 1 +
> 3 files changed, 89 insertions(+), 3 deletions(-)
Both patches applied as 6.18 material with some minor edits in the
changelog of the second patch.
Thanks!
Powered by blists - more mailing lists