diff mbox series

[v3,03/10] ACPI: LPIT: Use new `pm_suspend_preferred_s2idle`

Message ID 20220701023328.2783-3-mario.limonciello@amd.com
State New
Headers show
Series None | expand

Commit Message

Mario Limonciello July 1, 2022, 2:33 a.m. UTC
Drop the direct check from the FADT and use the helper instead.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
 drivers/acpi/acpi_lpit.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

kernel test robot July 1, 2022, 1:01 p.m. UTC | #1
Hi Mario,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on rafael-pm/linux-next]
[also build test ERROR on drm-misc/drm-misc-next hid/for-next linus/master v5.19-rc4 next-20220701]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/intel-lab-lkp/linux/commits/Mario-Limonciello/PM-suspend-Introduce-pm_suspend_preferred_s2idle/20220701-103534
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
config: x86_64-randconfig-a004 (https://download.01.org/0day-ci/archive/20220701/202207012033.3AjPSdQe-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
reproduce (this is a W=1 build):
        # https://github.com/intel-lab-lkp/linux/commit/9603006925839aeb40b8a65adc7be87f4e89813f
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Mario-Limonciello/PM-suspend-Introduce-pm_suspend_preferred_s2idle/20220701-103534
        git checkout 9603006925839aeb40b8a65adc7be87f4e89813f
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/acpi/acpi_lpit.c: In function 'lpit_update_residency':
>> drivers/acpi/acpi_lpit.c:113:22: error: implicit declaration of function 'pm_suspend_preferred_s2idle'; did you mean 'pm_suspend_default_s2idle'? [-Werror=implicit-function-declaration]
     113 |                 if (!pm_suspend_preferred_s2idle())
         |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
         |                      pm_suspend_default_s2idle
   drivers/acpi/acpi_lpit.c: At top level:
   drivers/acpi/acpi_lpit.c:149:6: warning: no previous prototype for 'acpi_init_lpit' [-Wmissing-prototypes]
     149 | void acpi_init_lpit(void)
         |      ^~~~~~~~~~~~~~
   cc1: some warnings being treated as errors


vim +113 drivers/acpi/acpi_lpit.c

    97	
    98	static void lpit_update_residency(struct lpit_residency_info *info,
    99					 struct acpi_lpit_native *lpit_native)
   100	{
   101		info->frequency = lpit_native->counter_frequency ?
   102					lpit_native->counter_frequency : tsc_khz * 1000;
   103		if (!info->frequency)
   104			info->frequency = 1;
   105	
   106		info->gaddr = lpit_native->residency_counter;
   107		if (info->gaddr.space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) {
   108			info->iomem_addr = ioremap(info->gaddr.address,
   109							   info->gaddr.bit_width / 8);
   110			if (!info->iomem_addr)
   111				return;
   112	
 > 113			if (!pm_suspend_preferred_s2idle())
   114				return;
   115	
   116			/* Silently fail, if cpuidle attribute group is not present */
   117			sysfs_add_file_to_group(&cpu_subsys.dev_root->kobj,
   118						&dev_attr_low_power_idle_system_residency_us.attr,
   119						"cpuidle");
   120		} else if (info->gaddr.space_id == ACPI_ADR_SPACE_FIXED_HARDWARE) {
   121			if (!pm_suspend_preferred_s2idle())
   122				return;
   123	
   124			/* Silently fail, if cpuidle attribute group is not present */
   125			sysfs_add_file_to_group(&cpu_subsys.dev_root->kobj,
   126						&dev_attr_low_power_idle_cpu_residency_us.attr,
   127						"cpuidle");
   128		}
   129	}
   130
diff mbox series

Patch

diff --git a/drivers/acpi/acpi_lpit.c b/drivers/acpi/acpi_lpit.c
index 48e5059d67ca..31c49107c579 100644
--- a/drivers/acpi/acpi_lpit.c
+++ b/drivers/acpi/acpi_lpit.c
@@ -6,6 +6,7 @@ 
  * Copyright (C) 2017 Intel Corporation. All rights reserved.
  */
 
+#include <linux/suspend.h>
 #include <linux/cpu.h>
 #include <linux/acpi.h>
 #include <asm/msr.h>
@@ -109,7 +110,7 @@  static void lpit_update_residency(struct lpit_residency_info *info,
 		if (!info->iomem_addr)
 			return;
 
-		if (!(acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0))
+		if (!pm_suspend_preferred_s2idle())
 			return;
 
 		/* Silently fail, if cpuidle attribute group is not present */
@@ -117,7 +118,7 @@  static void lpit_update_residency(struct lpit_residency_info *info,
 					&dev_attr_low_power_idle_system_residency_us.attr,
 					"cpuidle");
 	} else if (info->gaddr.space_id == ACPI_ADR_SPACE_FIXED_HARDWARE) {
-		if (!(acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0))
+		if (!pm_suspend_preferred_s2idle())
 			return;
 
 		/* Silently fail, if cpuidle attribute group is not present */