All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] platform/x86: thinkpad_acpi: Fix compilation without CONFIG_SUSPEND
@ 2022-05-03  1:27 Mario Limonciello
  2022-05-06 10:04 ` Hans de Goede
  0 siblings, 1 reply; 2+ messages in thread
From: Mario Limonciello @ 2022-05-03  1:27 UTC (permalink / raw)
  To: Hans de Goede, Mark Pearson
  Cc: Henrique de Moraes Holschuh, Mark Gross,
	open list:THINKPAD ACPI EXTRAS DRIVER,
	open list:THINKPAD ACPI EXTRAS DRIVER, open list,
	Mario Limonciello, kernel test robot

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@intel.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] platform/x86: thinkpad_acpi: Fix compilation without CONFIG_SUSPEND
  2022-05-03  1:27 [PATCH] platform/x86: thinkpad_acpi: Fix compilation without CONFIG_SUSPEND Mario Limonciello
@ 2022-05-06 10:04 ` Hans de Goede
  0 siblings, 0 replies; 2+ messages in thread
From: Hans de Goede @ 2022-05-06 10:04 UTC (permalink / raw)
  To: Mario Limonciello, Mark Pearson
  Cc: Henrique de Moraes Holschuh, Mark Gross,
	open list:THINKPAD ACPI EXTRAS DRIVER,
	open list:THINKPAD ACPI EXTRAS DRIVER, open list,
	kernel test robot

Hi,

On 5/3/22 03:27, Mario Limonciello wrote:
> 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@intel.com>
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>

Thanks, since the original patch was still in my review-hans
branch (and not yet in for-next) I've squashed this fix into
the original patch.

Regards,

Hans




> ---
>  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;


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-06 10:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-03  1:27 [PATCH] platform/x86: thinkpad_acpi: Fix compilation without CONFIG_SUSPEND Mario Limonciello
2022-05-06 10:04 ` Hans de Goede

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.