public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Alex Deucher <alexander.deucher@amd.com>
To: amd-gfx@lists.freedesktop.org, linux-acpi@vger.kernel.org,
	rjw@rjwysocki.net, lenb@kernel.org
Cc: hdegoede@redhat.com, Prike.Liang@amd.com,
	Shyam-sundar.S-k@amd.com,
	Alex Deucher <alexander.deucher@amd.com>,
	Marcin Bachry <hegel666@gmail.com>
Subject: [PATCH 2/2 V2] platform/x86: force LPS0 functions for AMD
Date: Wed, 17 Mar 2021 10:38:42 -0400	[thread overview]
Message-ID: <20210317143842.786380-2-alexander.deucher@amd.com> (raw)
In-Reply-To: <20210317143842.786380-1-alexander.deucher@amd.com>

ACPI_LPS0_ENTRY_AMD/ACPI_LPS0_EXIT_AMD are supposedly not
required for AMD platforms, and on some platforms they are
not even listed in the function mask but at least some HP
laptops seem to require it to properly support s0ix.

Based on a patch from Marcin Bachry <hegel666@gmail.com>.

Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1230
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Marcin Bachry <hegel666@gmail.com>
---

V2: rework the patch to just fix up the specific problematic
    case by setting the function flags that are missing.

 drivers/acpi/x86/s2idle.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/acpi/x86/s2idle.c b/drivers/acpi/x86/s2idle.c
index 2d7ddb8a8cb6..482e6b23b21a 100644
--- a/drivers/acpi/x86/s2idle.c
+++ b/drivers/acpi/x86/s2idle.c
@@ -368,6 +368,13 @@ static int lps0_device_attach(struct acpi_device *adev,
 
 	ACPI_FREE(out_obj);
 
+	/*
+	 * Some HP laptops require ACPI_LPS0_ENTRY_AMD/ACPI_LPS0_EXIT_AMD for proper
+	 * S0ix, but don't set the function mask correctly.  Fix that up here.
+	 */
+	if (acpi_s2idle_vendor_amd())
+		lps0_dsm_func_mask |= (1 << ACPI_LPS0_ENTRY_AMD) | (1 << ACPI_LPS0_EXIT_AMD);
+
 	acpi_handle_debug(adev->handle, "_DSM function mask: 0x%x\n",
 			  lps0_dsm_func_mask);
 
-- 
2.30.2


  reply	other threads:[~2021-03-17 14:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-17 14:38 [PATCH 1/2] platform/x86: Add missing LPS0 functions for AMD Alex Deucher
2021-03-17 14:38 ` Alex Deucher [this message]
2021-03-17 17:36   ` [PATCH 2/2 V2] platform/x86: force " Hans de Goede
2021-03-18 12:59   ` Alex Deucher

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=20210317143842.786380-2-alexander.deucher@amd.com \
    --to=alexander.deucher@amd.com \
    --cc=Prike.Liang@amd.com \
    --cc=Shyam-sundar.S-k@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=hdegoede@redhat.com \
    --cc=hegel666@gmail.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /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