lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220503012700.1273-1-mario.limonciello@amd.com>
Date:   Mon, 2 May 2022 20:27:00 -0500
From:   Mario Limonciello <mario.limonciello@....com>
To:     Hans de Goede <hdegoede@...hat.com>,
        Mark Pearson <markpearson@...ovo.com>
CC:     Henrique de Moraes Holschuh <hmh@....eng.br>,
        Mark Gross <mgross@...ux.intel.com>,
        "open list:THINKPAD ACPI EXTRAS DRIVER" 
        <ibm-acpi-devel@...ts.sourceforge.net>,
        "open list:THINKPAD ACPI EXTRAS DRIVER" 
        <platform-driver-x86@...r.kernel.org>,
        open list <linux-kernel@...r.kernel.org>,
        Mario Limonciello <mario.limonciello@....com>,
        kernel test robot <lkp@...el.com>
Subject: [PATCH] platform/x86: thinkpad_acpi: Fix compilation without CONFIG_SUSPEND

When compiled without `CONFIG_SUSPEND` the extra s2idle quirk handling
doesn't make any sense and causes a kernel build failure.

Disable the new code with `CONFIG_SUSPEND` not set.

Reported-by: kernel test robot <lkp@...el.com>
Signed-off-by: Mario Limonciello <mario.limonciello@....com>
---
 drivers/platform/x86/thinkpad_acpi.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index f385450af864..2833609fade7 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -4482,6 +4482,7 @@ static const struct dmi_system_id fwbug_list[] __initconst = {
 	{}
 };
 
+#ifdef CONFIG_SUSPEND
 /*
  * Lenovo laptops from a variety of generations run a SMI handler during the D3->D0
  * transition that occurs specifically when exiting suspend to idle which can cause
@@ -4517,6 +4518,7 @@ static void thinkpad_acpi_amd_s2idle_restore(void)
 static struct acpi_s2idle_dev_ops thinkpad_acpi_s2idle_dev_ops = {
 	.restore = thinkpad_acpi_amd_s2idle_restore,
 };
+#endif
 
 static const struct pci_device_id fwbug_cards_ids[] __initconst = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x24F3) },
@@ -11569,8 +11571,10 @@ static void thinkpad_acpi_module_exit(void)
 
 	tpacpi_lifecycle = TPACPI_LIFE_EXITING;
 
+#ifdef CONFIG_SUSPEND
 	if (tp_features.quirks && tp_features.quirks->s2idle_bug_mmio)
 		acpi_unregister_lps0_dev(&thinkpad_acpi_s2idle_dev_ops);
+#endif
 	if (tpacpi_hwmon)
 		hwmon_device_unregister(tpacpi_hwmon);
 	if (tp_features.sensors_pdrv_registered)
@@ -11743,11 +11747,13 @@ static int __init thinkpad_acpi_module_init(void)
 	dmi_id = dmi_first_match(fwbug_list);
 	if (dmi_id) {
 		tp_features.quirks = dmi_id->driver_data;
+#ifdef CONFIG_SUSPEND
 		if (tp_features.quirks->s2idle_bug_mmio) {
 			if (!acpi_register_lps0_dev(&thinkpad_acpi_s2idle_dev_ops))
 				pr_info("Using s2idle quirk to avoid %s platform firmware bug\n",
 					dmi_id->ident ? dmi_id->ident : "");
 		}
+#endif
 	}
 
 	return 0;
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ