From: Mario Limonciello <mario.limonciello@amd.com>
To: <rafael@kernel.org>, <linux-kernel@vger.kernel.org>
Cc: <travisghansen@yahoo.com>, <catalin@antebit.com>,
<Shyam-sundar.S-k@amd.com>, <ruinairas1992@gmail.com>,
<philipp.zabel@gmail.com>, <iam@decentr.al>,
<hdegoede@redhat.com>, <davidedp91@gmail.com>,
<marko.cekrlic.26@gmail.com>,
Mario Limonciello <mario.limonciello@amd.com>,
Len Brown <lenb@kernel.org>, <linux-acpi@vger.kernel.org>
Subject: [PATCH v4 3/7] acpi/x86: s2idle: Add module parameter to prefer Microsoft GUID
Date: Wed, 21 Sep 2022 15:40:50 -0500 [thread overview]
Message-ID: <20220921204055.22889-4-mario.limonciello@amd.com> (raw)
In-Reply-To: <20220921204055.22889-1-mario.limonciello@amd.com>
OEMs have made some mistakes in the past for the AMD GUID support
and not populated the method properly. To add an escape hatch for
this problem introduce a module parameter that can force using
the Microsoft GUID.
This is intentionally introduced to both Intel and AMD codepaths
to allow using the parameter as a debugging tactic on either.
Reviewed-by: Philipp Zabel <philipp.zabel@gmail.com>
Tested-by: Philipp Zabel <philipp.zabel@gmail.com> # GA402RJ
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
v3->v4:
* Rename parameter and string per Rafael's request
v2->v3:
* Add tags
---
drivers/acpi/x86/s2idle.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/drivers/acpi/x86/s2idle.c b/drivers/acpi/x86/s2idle.c
index 2c5931d247a2..725d2a6c87ed 100644
--- a/drivers/acpi/x86/s2idle.c
+++ b/drivers/acpi/x86/s2idle.c
@@ -27,6 +27,10 @@ static bool sleep_no_lps0 __read_mostly;
module_param(sleep_no_lps0, bool, 0644);
MODULE_PARM_DESC(sleep_no_lps0, "Do not use the special LPS0 device interface");
+static bool prefer_microsoft_dsm_guid __read_mostly;
+module_param(prefer_microsoft_dsm_guid, bool, 0644);
+MODULE_PARM_DESC(prefer_microsoft_dsm_guid, "Prefer using Microsoft GUID in LPS0 device _DSM evaluation");
+
static const struct acpi_device_id lps0_device_ids[] = {
{"PNP0D80", },
{"", },
@@ -402,6 +406,9 @@ static int lps0_device_attach(struct acpi_device *adev,
if (lps0_device_handle)
return 0;
+ lps0_dsm_func_mask_microsoft = validate_dsm(adev->handle,
+ ACPI_LPS0_DSM_UUID_MICROSOFT, 0,
+ &lps0_dsm_guid_microsoft);
if (acpi_s2idle_vendor_amd()) {
static const struct acpi_device_id *dev_id;
const struct amd_lps0_hid_device_data *data;
@@ -416,16 +423,12 @@ static int lps0_device_attach(struct acpi_device *adev,
rev_id = data->rev_id;
lps0_dsm_func_mask = validate_dsm(adev->handle,
ACPI_LPS0_DSM_UUID_AMD, rev_id, &lps0_dsm_guid);
- lps0_dsm_func_mask_microsoft = validate_dsm(adev->handle,
- ACPI_LPS0_DSM_UUID_MICROSOFT, 0,
- &lps0_dsm_guid_microsoft);
if (lps0_dsm_func_mask > 0x3 && data->check_off_by_one) {
lps0_dsm_func_mask = (lps0_dsm_func_mask << 1) | 0x1;
acpi_handle_debug(adev->handle, "_DSM UUID %s: Adjusted function mask: 0x%x\n",
ACPI_LPS0_DSM_UUID_AMD, lps0_dsm_func_mask);
} else if (lps0_dsm_func_mask_microsoft > 0 && data->prefer_amd_guid &&
- (!strcmp(hid, "AMDI0007") ||
- !strcmp(hid, "AMDI0008"))) {
+ !prefer_microsoft_dsm_guid) {
lps0_dsm_func_mask_microsoft = -EINVAL;
acpi_handle_debug(adev->handle, "_DSM Using AMD method\n");
}
@@ -433,7 +436,8 @@ static int lps0_device_attach(struct acpi_device *adev,
rev_id = 1;
lps0_dsm_func_mask = validate_dsm(adev->handle,
ACPI_LPS0_DSM_UUID, rev_id, &lps0_dsm_guid);
- lps0_dsm_func_mask_microsoft = -EINVAL;
+ if (!prefer_microsoft_dsm_guid)
+ lps0_dsm_func_mask_microsoft = -EINVAL;
}
if (lps0_dsm_func_mask < 0 && lps0_dsm_func_mask_microsoft < 0)
--
2.34.1
next prev parent reply other threads:[~2022-09-21 20:41 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-21 20:40 [PATCH v4 0/7] Fixups for s2idle on various Rembrandt laptops Mario Limonciello
2022-09-21 20:40 ` [PATCH v4 1/7] acpi/x86: s2idle: Move _HID handling for AMD systems into structures Mario Limonciello
2022-09-21 20:40 ` [PATCH v4 2/7] acpi/x86: s2idle: If a new AMD _HID is missing assume Rembrandt Mario Limonciello
2022-09-21 20:40 ` Mario Limonciello [this message]
2022-09-21 20:40 ` [PATCH v4 4/7] acpi/x86: s2idle: Add a quirk for ASUS TUF Gaming A17 FA707RE Mario Limonciello
2022-09-21 20:40 ` [PATCH v4 5/7] acpi/x86: s2idle: Add a quirk for ASUS ROG Zephyrus G14 Mario Limonciello
2022-09-21 20:40 ` [PATCH v4 6/7] acpi/x86: s2idle: Add a quirk for Lenovo Slim 7 Pro 14ARH7 Mario Limonciello
2022-09-21 20:40 ` [PATCH v4 7/7] acpi/x86: s2idle: Add a quirk for ASUSTeK COMPUTER INC. ROG Flow X13 Mario Limonciello
2022-09-27 9:06 ` Luke Jones
2022-09-27 16:07 ` Limonciello, Mario
2022-09-27 20:00 ` Luke Jones
2022-09-24 17:07 ` [PATCH v4 0/7] Fixups for s2idle on various Rembrandt laptops Rafael J. Wysocki
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=20220921204055.22889-4-mario.limonciello@amd.com \
--to=mario.limonciello@amd.com \
--cc=Shyam-sundar.S-k@amd.com \
--cc=catalin@antebit.com \
--cc=davidedp91@gmail.com \
--cc=hdegoede@redhat.com \
--cc=iam@decentr.al \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marko.cekrlic.26@gmail.com \
--cc=philipp.zabel@gmail.com \
--cc=rafael@kernel.org \
--cc=ruinairas1992@gmail.com \
--cc=travisghansen@yahoo.com \
/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
all inboxes | Powered by JetHome®