Message ID | 20201001132623.172-1-kuldip.dwivedi@puresoftware.com |
---|---|
State | New |
Headers | show |
Series | [v1] acpi: processor_throttling: Add supprt for System Memory | expand |
Hi kuldip, Thank you for the patch! Yet something to improve: [auto build test ERROR on pm/linux-next] [also build test ERROR on v5.9-rc7 next-20201001] [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/0day-ci/linux/commits/kuldip-dwivedi/acpi-processor_throttling-Add-supprt-for-System-Memory/20201001-212807 base: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next config: x86_64-randconfig-s021-20200930 (attached as .config) compiler: gcc-9 (Debian 9.3.0-15) 9.3.0 reproduce: # apt-get install sparse # sparse version: v0.6.2-201-g24bdaac6-dirty # https://github.com/0day-ci/linux/commit/c9fca3508dc7664cf0e8728f3902e9b8f88cd1d8 git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review kuldip-dwivedi/acpi-processor_throttling-Add-supprt-for-System-Memory/20201001-212807 git checkout c9fca3508dc7664cf0e8728f3902e9b8f88cd1d8 # save the attached .config to linux build tree make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <lkp@intel.com> All errors (new ones prefixed by >>, old ones prefixed by <<): >> ERROR: modpost: "acpi_os_write_memory" [drivers/acpi/processor.ko] undefined! >> ERROR: modpost: "acpi_os_read_memory" [drivers/acpi/processor.ko] undefined! --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 7540a5179a47..78b3e45f05e0 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -274,7 +274,7 @@ config ACPI_PROCESSOR tristate "Processor" depends on X86 || IA64 || ARM64 select ACPI_PROCESSOR_IDLE - select ACPI_CPU_FREQ_PSS if X86 || IA64 + select ACPI_CPU_FREQ_PSS if X86 || IA64 || ARM64 default y help This driver adds support for the ACPI Processor package. It is required diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c index a0bd56ece3ff..8ace1fb76712 100644 --- a/drivers/acpi/processor_throttling.c +++ b/drivers/acpi/processor_throttling.c @@ -767,6 +767,7 @@ static int acpi_read_throttling_status(struct acpi_processor *pr, { u32 bit_width, bit_offset; u32 ptc_value; + u64 ptc_value_64; u64 ptc_mask; struct acpi_processor_throttling *throttling; int ret = -1; @@ -784,6 +785,17 @@ static int acpi_read_throttling_status(struct acpi_processor *pr, *value = (u64) ((ptc_value >> bit_offset) & ptc_mask); ret = 0; break; + case ACPI_ADR_SPACE_SYSTEM_MEMORY: + bit_width = throttling->status_register.bit_width; + bit_offset = throttling->status_register.bit_offset; + + acpi_os_read_memory((acpi_physical_address) + throttling->status_register.address, + &ptc_value_64, (u32) (bit_width + bit_offset)); + ptc_mask = (1UL << bit_width) - 1; + *value = (u64) ((ptc_value_64 >> bit_offset) & ptc_mask); + ret = 0; + break; case ACPI_ADR_SPACE_FIXED_HARDWARE: ret = acpi_throttling_rdmsr(value); break; @@ -817,6 +829,18 @@ static int acpi_write_throttling_state(struct acpi_processor *pr, (u32) (bit_width + bit_offset)); ret = 0; break; + case ACPI_ADR_SPACE_SYSTEM_MEMORY: + bit_width = throttling->control_register.bit_width; + bit_offset = throttling->control_register.bit_offset; + ptc_mask = (1UL << bit_width) - 1; + ptc_value = value & ptc_mask; + + acpi_os_write_memory((acpi_physical_address) + throttling->control_register.address, + (u64) (ptc_value << bit_offset), + (u32) (bit_width + bit_offset)); + ret = 0; + break; case ACPI_ADR_SPACE_FIXED_HARDWARE: ret = acpi_throttling_wrmsr(value); break;