Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'acpi-5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI updates from Rafael Wysocki:
"These add support for generic initiator-only proximity domains to the
ACPI NUMA code and the architectures using it, clean up some
non-ACPICA code referring to debug facilities from ACPICA, reduce the
overhead related to accessing GPE registers, add a new DPTF (Dynamic
Power and Thermal Framework) participant driver, update the ACPICA
code in the kernel to upstream revision 20200925, add a new ACPI
backlight whitelist entry, fix a few assorted issues and clean up some
code.

Specifics:

- Add support for generic initiator-only proximity domains to the
ACPI NUMA code and the architectures using it (Jonathan Cameron)

- Clean up some non-ACPICA code referring to debug facilities from
ACPICA that are not actually used in there (Hanjun Guo)

- Add new DPTF driver for the PCH FIVR participant (Srinivas
Pandruvada)

- Reduce overhead related to accessing GPE registers in ACPICA and
the OS interface layer and make it possible to access GPE registers
using logical addresses if they are memory-mapped (Rafael Wysocki)

- Update the ACPICA code in the kernel to upstream revision 20200925
including changes as follows:
+ Add predefined names from the SMBus sepcification (Bob Moore)
+ Update acpi_help UUID list (Bob Moore)
+ Return exceptions for string-to-integer conversions in iASL (Bob
Moore)
+ Add a new "ALL <NameSeg>" debugger command (Bob Moore)
+ Add support for 64 bit risc-v compilation (Colin Ian King)
+ Do assorted cleanups (Bob Moore, Colin Ian King, Randy Dunlap)

- Add new ACPI backlight whitelist entry for HP 635 Notebook (Alex
Hung)

- Move TPS68470 OpRegion driver to drivers/acpi/pmic/ and split out
Kconfig and Makefile specific for ACPI PMIC (Andy Shevchenko)

- Clean up the ACPI SoC driver for AMD SoCs (Hanjun Guo)

- Add missing config_item_put() to fix refcount leak (Hanjun Guo)

- Drop lefrover field from struct acpi_memory_device (Hanjun Guo)

- Make the ACPI extlog driver check for RDMSR failures (Ben
Hutchings)

- Fix handling of lid state changes in the ACPI button driver when
input device is closed (Dmitry Torokhov)

- Fix several assorted build issues (Barnabás Pőcze, John Garry,
Nathan Chancellor, Tian Tao)

- Drop unused inline functions and reduce code duplication by using
kobj_to_dev() in the NFIT parsing code (YueHaibing, Wang Qing)

- Serialize tools/power/acpi Makefile (Thomas Renninger)"

* tag 'acpi-5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (64 commits)
ACPICA: Update version to 20200925 Version 20200925
ACPICA: Remove unnecessary semicolon
ACPICA: Debugger: Add a new command: "ALL <NameSeg>"
ACPICA: iASL: Return exceptions for string-to-integer conversions
ACPICA: acpi_help: Update UUID list
ACPICA: Add predefined names found in the SMBus sepcification
ACPICA: Tree-wide: fix various typos and spelling mistakes
ACPICA: Drop the repeated word "an" in a comment
ACPICA: Add support for 64 bit risc-v compilation
ACPI: button: fix handling lid state changes when input device closed
tools/power/acpi: Serialize Makefile
ACPI: scan: Replace ACPI_DEBUG_PRINT() with pr_debug()
ACPI: memhotplug: Remove 'state' from struct acpi_memory_device
ACPI / extlog: Check for RDMSR failure
ACPI: Make acpi_evaluate_dsm() prototype consistent
docs: mm: numaperf.rst Add brief description for access class 1.
node: Add access1 class to represent CPU to memory characteristics
ACPI: HMAT: Fix handling of changes from ACPI 6.2 to ACPI 6.3
ACPI: Let ACPI know we support Generic Initiator Affinity Structures
x86: Support Generic Initiator only proximity domains
...

+953 -328
+16
Documentation/ABI/testing/sysfs-platform-dptf
··· 92 92 Description: 93 93 (RO) The battery discharge current capability obtained from battery fuel gauge in 94 94 milli Amps. 95 + 96 + What: /sys/bus/platform/devices/INTC1045:00/pch_fivr_switch_frequency/freq_mhz_low_clock 97 + Date: November, 2020 98 + KernelVersion: v5.10 99 + Contact: linux-acpi@vger.kernel.org 100 + Description: 101 + (RW) The PCH FIVR (Fully Integrated Voltage Regulator) switching frequency in MHz, 102 + when FIVR clock is 19.2MHz or 24MHz. 103 + 104 + What: /sys/bus/platform/devices/INTC1045:00/pch_fivr_switch_frequency/freq_mhz_high_clock 105 + Date: November, 2020 106 + KernelVersion: v5.10 107 + Contact: linux-acpi@vger.kernel.org 108 + Description: 109 + (RW) The PCH FIVR (Fully Integrated Voltage Regulator) switching frequency in MHz, 110 + when FIVR clock is 38.4MHz.
+8
Documentation/admin-guide/mm/numaperf.rst
··· 56 56 linked initiator nodes. Each target within an initiator's access class, 57 57 though, do not necessarily perform the same as each other. 58 58 59 + The access class "1" is used to allow differentiation between initiators 60 + that are CPUs and hence suitable for generic task scheduling, and 61 + IO initiators such as GPUs and NICs. Unlike access class 0, only 62 + nodes containing CPUs are considered. 63 + 59 64 ================ 60 65 NUMA Performance 61 66 ================ ··· 92 87 93 88 The values reported here correspond to the rated latency and bandwidth 94 89 for the platform. 90 + 91 + Access class 1 takes the same form but only includes values for CPU to 92 + memory activity. 95 93 96 94 ========== 97 95 NUMA Cache
+2 -2
MAINTAINERS
··· 405 405 ACPI PMIC DRIVERS 406 406 M: "Rafael J. Wysocki" <rjw@rjwysocki.net> 407 407 M: Len Brown <lenb@kernel.org> 408 - R: Andy Shevchenko <andriy.shevchenko@linux.intel.com> 408 + R: Andy Shevchenko <andy@kernel.org> 409 409 R: Mika Westerberg <mika.westerberg@linux.intel.com> 410 410 L: linux-acpi@vger.kernel.org 411 411 S: Supported ··· 8953 8953 F: drivers/gpio/gpio-msic.c 8954 8954 8955 8955 INTEL PMIC MULTIFUNCTION DEVICE DRIVERS 8956 - R: Andy Shevchenko <andriy.shevchenko@linux.intel.com> 8956 + M: Andy Shevchenko <andy@kernel.org> 8957 8957 S: Maintained 8958 8958 F: drivers/mfd/intel_msic.c 8959 8959 F: drivers/mfd/intel_soc_pmic*
+2
arch/x86/include/asm/numa.h
··· 63 63 extern void __init init_cpu_to_node(void); 64 64 extern void numa_add_cpu(int cpu); 65 65 extern void numa_remove_cpu(int cpu); 66 + extern void init_gi_nodes(void); 66 67 #else /* CONFIG_NUMA */ 67 68 static inline void numa_set_node(int cpu, int node) { } 68 69 static inline void numa_clear_node(int cpu) { } 69 70 static inline void init_cpu_to_node(void) { } 70 71 static inline void numa_add_cpu(int cpu) { } 71 72 static inline void numa_remove_cpu(int cpu) { } 73 + static inline void init_gi_nodes(void) { } 72 74 #endif /* CONFIG_NUMA */ 73 75 74 76 #ifdef CONFIG_DEBUG_PER_CPU_MAPS
+1
arch/x86/kernel/setup.c
··· 1199 1199 prefill_possible_map(); 1200 1200 1201 1201 init_cpu_to_node(); 1202 + init_gi_nodes(); 1202 1203 1203 1204 io_apic_init_mappings(); 1204 1205
+21
arch/x86/mm/numa.c
··· 746 746 } 747 747 748 748 /* 749 + * A node may exist which has one or more Generic Initiators but no CPUs and no 750 + * memory. 751 + * 752 + * This function must be called after init_cpu_to_node(), to ensure that any 753 + * memoryless CPU nodes have already been brought online, and before the 754 + * node_data[nid] is needed for zone list setup in build_all_zonelists(). 755 + * 756 + * When this function is called, any nodes containing either memory and/or CPUs 757 + * will already be online and there is no need to do anything extra, even if 758 + * they also contain one or more Generic Initiators. 759 + */ 760 + void __init init_gi_nodes(void) 761 + { 762 + int nid; 763 + 764 + for_each_node_state(nid, N_GENERIC_INITIATOR) 765 + if (!node_online(nid)) 766 + init_memory_less_node(nid); 767 + } 768 + 769 + /* 749 770 * Setup early cpu_to_node. 750 771 * 751 772 * Populate cpu_to_node[] only if x86_cpu_to_apicid[],
+1 -64
drivers/acpi/Kconfig
··· 504 504 config ACPI_ADXL 505 505 bool 506 506 507 - menuconfig PMIC_OPREGION 508 - bool "PMIC (Power Management Integrated Circuit) operation region support" 509 - help 510 - Select this option to enable support for ACPI operation 511 - region of the PMIC chip. The operation region can be used 512 - to control power rails and sensor reading/writing on the 513 - PMIC chip. 514 - 515 - if PMIC_OPREGION 516 - config BYTCRC_PMIC_OPREGION 517 - bool "ACPI operation region support for Bay Trail Crystal Cove PMIC" 518 - depends on INTEL_SOC_PMIC 519 - help 520 - This config adds ACPI operation region support for the Bay Trail 521 - version of the Crystal Cove PMIC. 522 - 523 - config CHTCRC_PMIC_OPREGION 524 - bool "ACPI operation region support for Cherry Trail Crystal Cove PMIC" 525 - depends on INTEL_SOC_PMIC 526 - help 527 - This config adds ACPI operation region support for the Cherry Trail 528 - version of the Crystal Cove PMIC. 529 - 530 - config XPOWER_PMIC_OPREGION 531 - bool "ACPI operation region support for XPower AXP288 PMIC" 532 - depends on MFD_AXP20X_I2C && IOSF_MBI=y 533 - help 534 - This config adds ACPI operation region support for XPower AXP288 PMIC. 535 - 536 - config BXT_WC_PMIC_OPREGION 537 - bool "ACPI operation region support for BXT WhiskeyCove PMIC" 538 - depends on INTEL_SOC_PMIC_BXTWC 539 - help 540 - This config adds ACPI operation region support for BXT WhiskeyCove PMIC. 541 - 542 - config CHT_WC_PMIC_OPREGION 543 - bool "ACPI operation region support for CHT Whiskey Cove PMIC" 544 - depends on INTEL_SOC_PMIC_CHTWC 545 - help 546 - This config adds ACPI operation region support for CHT Whiskey Cove PMIC. 547 - 548 - config CHT_DC_TI_PMIC_OPREGION 549 - bool "ACPI operation region support for Dollar Cove TI PMIC" 550 - depends on INTEL_SOC_PMIC_CHTDC_TI 551 - help 552 - This config adds ACPI operation region support for Dollar Cove TI PMIC. 553 - 554 - endif 555 - 556 507 config ACPI_CONFIGFS 557 508 tristate "ACPI configfs support" 558 509 select CONFIGFS_FS ··· 519 568 bool 520 569 endif 521 570 522 - config TPS68470_PMIC_OPREGION 523 - bool "ACPI operation region support for TPS68470 PMIC" 524 - depends on MFD_TPS68470 525 - help 526 - This config adds ACPI operation region support for TI TPS68470 PMIC. 527 - TPS68470 device is an advanced power management unit that powers 528 - a Compact Camera Module (CCM), generates clocks for image sensors, 529 - drives a dual LED for flash and incorporates two LED drivers for 530 - general purpose indicators. 531 - This driver enables ACPI operation region support control voltage 532 - regulators and clocks. 533 - 534 - This option is a bool as it provides an ACPI operation 535 - region, which must be available before any of the devices 536 - using this, are probed. 571 + source "drivers/acpi/pmic/Kconfig" 537 572 538 573 endif # ACPI 539 574
+1 -9
drivers/acpi/Makefile
··· 107 107 108 108 obj-$(CONFIG_ACPI_EXTLOG) += acpi_extlog.o 109 109 110 - obj-$(CONFIG_PMIC_OPREGION) += pmic/intel_pmic.o 111 - obj-$(CONFIG_BYTCRC_PMIC_OPREGION) += pmic/intel_pmic_bytcrc.o 112 - obj-$(CONFIG_CHTCRC_PMIC_OPREGION) += pmic/intel_pmic_chtcrc.o 113 - obj-$(CONFIG_XPOWER_PMIC_OPREGION) += pmic/intel_pmic_xpower.o 114 - obj-$(CONFIG_BXT_WC_PMIC_OPREGION) += pmic/intel_pmic_bxtwc.o 115 - obj-$(CONFIG_CHT_WC_PMIC_OPREGION) += pmic/intel_pmic_chtwc.o 116 - obj-$(CONFIG_CHT_DC_TI_PMIC_OPREGION) += pmic/intel_pmic_chtdc_ti.o 117 - 118 110 obj-$(CONFIG_ACPI_CONFIGFS) += acpi_configfs.o 119 111 120 - obj-$(CONFIG_TPS68470_PMIC_OPREGION) += pmic/tps68470_pmic.o 112 + obj-y += pmic/ 121 113 122 114 video-objs += acpi_video.o video_detect.o 123 115 obj-y += dptf/
+8 -24
drivers/acpi/acpi_apd.c
··· 7 7 * Wu, Jeff <Jeff.Wu@amd.com> 8 8 */ 9 9 10 - #include <linux/clk-provider.h> 11 - #include <linux/platform_data/clk-fch.h> 12 - #include <linux/platform_device.h> 13 - #include <linux/pm_domain.h> 14 - #include <linux/clkdev.h> 15 10 #include <linux/acpi.h> 11 + #include <linux/clkdev.h> 12 + #include <linux/clk-provider.h> 16 13 #include <linux/err.h> 17 14 #include <linux/io.h> 18 - #include <linux/pm.h> 15 + #include <linux/platform_data/clk-fch.h> 16 + #include <linux/platform_device.h> 19 17 20 18 #include "internal.h" 21 19 22 - ACPI_MODULE_NAME("acpi_apd"); 23 20 struct apd_private_data; 24 21 25 22 /** 26 - * ACPI_APD_SYSFS : add device attributes in sysfs 27 - * ACPI_APD_PM : attach power domain to device 28 - */ 29 - #define ACPI_APD_SYSFS BIT(0) 30 - #define ACPI_APD_PM BIT(1) 31 - 32 - /** 33 23 * struct apd_device_desc - a descriptor for apd device 34 - * @flags: device flags like %ACPI_APD_SYSFS, %ACPI_APD_PM 35 24 * @fixed_clk_rate: fixed rate input clock source for acpi device; 36 25 * 0 means no fixed rate input clock source 26 + * @properties: build-in properties of the device such as UART 37 27 * @setup: a hook routine to set device resource during create platform device 38 28 * 39 29 * Device description defined as acpi_device_id.driver_data 40 30 */ 41 31 struct apd_device_desc { 42 - unsigned int flags; 43 32 unsigned int fixed_clk_rate; 44 33 struct property_entry *properties; 45 34 int (*setup)(struct apd_private_data *pdata); ··· 60 71 } 61 72 62 73 #ifdef CONFIG_X86_AMD_PLATFORM_DEVICE 63 - 64 74 static int misc_check_res(struct acpi_resource *ares, void *data) 65 75 { 66 76 struct resource res; ··· 130 142 static const struct apd_device_desc fch_misc_desc = { 131 143 .setup = fch_misc_setup, 132 144 }; 133 - #endif 145 + #endif /* CONFIG_X86_AMD_PLATFORM_DEVICE */ 134 146 135 147 #ifdef CONFIG_ARM64 136 148 static const struct apd_device_desc xgene_i2c_desc = { ··· 172 184 .setup = acpi_apd_setup, 173 185 .fixed_clk_rate = 250000000, 174 186 }; 187 + #endif /* CONFIG_ARM64 */ 188 + 175 189 #endif 176 - 177 - #else 178 - 179 - #define APD_ADDR(desc) (0UL) 180 - 181 - #endif /* CONFIG_X86_AMD_PLATFORM_DEVICE */ 182 190 183 191 /** 184 192 * Create platform device during acpi scan attach handle.
-2
drivers/acpi/acpi_cmos_rtc.c
··· 15 15 16 16 #include "internal.h" 17 17 18 - ACPI_MODULE_NAME("cmos rtc"); 19 - 20 18 static const struct acpi_device_id acpi_cmos_rtc_ids[] = { 21 19 { "PNP0B00" }, 22 20 { "PNP0B01" },
+1
drivers/acpi/acpi_configfs.c
··· 228 228 229 229 ACPI_INFO(("Host-directed Dynamic ACPI Table Unload")); 230 230 acpi_unload_table(table->index); 231 + config_item_put(cfg); 231 232 } 232 233 233 234 static struct configfs_group_operations acpi_table_group_ops = {
+3 -3
drivers/acpi/acpi_extlog.c
··· 222 222 u64 cap; 223 223 int rc; 224 224 225 - rdmsrl(MSR_IA32_MCG_CAP, cap); 226 - 227 - if (!(cap & MCG_ELOG_P) || !extlog_get_l1addr()) 225 + if (rdmsrl_safe(MSR_IA32_MCG_CAP, &cap) || 226 + !(cap & MCG_ELOG_P) || 227 + !extlog_get_l1addr()) 228 228 return -ENODEV; 229 229 230 230 rc = -EINVAL;
-2
drivers/acpi/acpi_lpss.c
··· 26 26 27 27 #include "internal.h" 28 28 29 - ACPI_MODULE_NAME("acpi_lpss"); 30 - 31 29 #ifdef CONFIG_X86_INTEL_LPSS 32 30 33 31 #include <asm/cpu_device_id.h>
+1 -18
drivers/acpi/acpi_memhotplug.c
··· 22 22 #define ACPI_MEMORY_DEVICE_HID "PNP0C80" 23 23 #define ACPI_MEMORY_DEVICE_NAME "Hotplug Mem Device" 24 24 25 - #define _COMPONENT ACPI_MEMORY_DEVICE_COMPONENT 26 - 27 - #undef PREFIX 28 - #define PREFIX "ACPI:memory_hp:" 29 - 30 - ACPI_MODULE_NAME("acpi_memhotplug"); 31 - 32 25 static const struct acpi_device_id memory_device_ids[] = { 33 26 {ACPI_MEMORY_DEVICE_HID, 0}, 34 27 {"", 0}, 35 28 }; 36 29 37 30 #ifdef CONFIG_ACPI_HOTPLUG_MEMORY 38 - 39 - /* Memory Device States */ 40 - #define MEMORY_INVALID_STATE 0 41 - #define MEMORY_POWER_ON_STATE 1 42 - #define MEMORY_POWER_OFF_STATE 2 43 31 44 32 static int acpi_memory_device_add(struct acpi_device *device, 45 33 const struct acpi_device_id *not_used); ··· 52 64 }; 53 65 54 66 struct acpi_memory_device { 55 - struct acpi_device * device; 56 - unsigned int state; /* State of the memory device */ 67 + struct acpi_device *device; 57 68 struct list_head res_list; 58 69 }; 59 70 ··· 220 233 } 221 234 if (!num_enabled) { 222 235 dev_err(&mem_device->device->dev, "add_memory failed\n"); 223 - mem_device->state = MEMORY_INVALID_STATE; 224 236 return -EINVAL; 225 237 } 226 238 /* ··· 289 303 kfree(mem_device); 290 304 return result; 291 305 } 292 - 293 - /* Set the device state */ 294 - mem_device->state = MEMORY_POWER_ON_STATE; 295 306 296 307 result = acpi_memory_check_device(mem_device); 297 308 if (result) {
-2
drivers/acpi/acpi_platform.c
··· 19 19 20 20 #include "internal.h" 21 21 22 - ACPI_MODULE_NAME("platform"); 23 - 24 22 static const struct acpi_device_id forbidden_id_list[] = { 25 23 {"PNP0000", 0}, /* PIC */ 26 24 {"PNP0100", 0}, /* Timer */
+4
drivers/acpi/acpica/acdebug.h
··· 37 37 struct acpi_db_execute_walk { 38 38 u32 count; 39 39 u32 max_count; 40 + char name_seg[ACPI_NAMESEG_SIZE + 1]; 40 41 }; 41 42 42 43 #define PARAM_LIST(pl) pl 43 44 44 45 #define EX_NO_SINGLE_STEP 1 45 46 #define EX_SINGLE_STEP 2 47 + #define EX_ALL 4 46 48 47 49 /* 48 50 * dbxface - external debugger interfaces ··· 125 123 void acpi_db_disassemble_aml(char *statements, union acpi_parse_object *op); 126 124 127 125 void acpi_db_evaluate_predefined_names(void); 126 + 127 + void acpi_db_evaluate_all(char *name_seg); 128 128 129 129 /* 130 130 * dbnames - namespace commands
+6
drivers/acpi/acpica/acglobal.h
··· 42 42 ACPI_GLOBAL(struct acpi_generic_address, acpi_gbl_xpm1b_status); 43 43 ACPI_GLOBAL(struct acpi_generic_address, acpi_gbl_xpm1b_enable); 44 44 45 + #ifdef ACPI_GPE_USE_LOGICAL_ADDRESSES 46 + ACPI_GLOBAL(unsigned long, acpi_gbl_xgpe0_block_logical_address); 47 + ACPI_GLOBAL(unsigned long, acpi_gbl_xgpe1_block_logical_address); 48 + 49 + #endif /* ACPI_GPE_USE_LOGICAL_ADDRESSES */ 50 + 45 51 /* 46 52 * Handle both ACPI 1.0 and ACPI 2.0+ Integer widths. The integer width is 47 53 * determined by the revision of the DSDT: If the DSDT revision is less than
+6
drivers/acpi/acpica/achware.h
··· 73 73 74 74 acpi_status acpi_hw_write_port(acpi_io_address address, u32 value, u32 width); 75 75 76 + acpi_status acpi_hw_validate_io_block(u64 address, u32 bit_width, u32 count); 77 + 76 78 /* 77 79 * hwgpe - GPE support 78 80 */ 81 + acpi_status acpi_hw_gpe_read(u64 *value, struct acpi_gpe_address *reg); 82 + 83 + acpi_status acpi_hw_gpe_write(u64 value, struct acpi_gpe_address *reg); 84 + 79 85 u32 acpi_hw_get_gpe_register_bit(struct acpi_gpe_event_info *gpe_event_info); 80 86 81 87 acpi_status
+9 -2
drivers/acpi/acpica/aclocal.h
··· 454 454 u8 disable_for_dispatch; /* Masked during dispatching */ 455 455 }; 456 456 457 + /* GPE register address */ 458 + 459 + struct acpi_gpe_address { 460 + u8 space_id; /* Address space where the register exists */ 461 + u64 address; /* 64-bit address of the register */ 462 + }; 463 + 457 464 /* Information about a GPE register pair, one per each status/enable pair in an array */ 458 465 459 466 struct acpi_gpe_register_info { 460 - struct acpi_generic_address status_address; /* Address of status reg */ 461 - struct acpi_generic_address enable_address; /* Address of enable reg */ 467 + struct acpi_gpe_address status_address; /* Address of status reg */ 468 + struct acpi_gpe_address enable_address; /* Address of enable reg */ 462 469 u16 base_gpe_number; /* Base GPE number for this register */ 463 470 u8 enable_for_wake; /* GPEs to keep enabled when sleeping */ 464 471 u8 enable_for_run; /* GPEs to keep enabled when running */
+32 -1
drivers/acpi/acpica/acpredef.h
··· 101 101 102 102 /* Support macros for users of the predefined info table */ 103 103 104 - #define METHOD_PREDEF_ARGS_MAX 4 104 + #define METHOD_PREDEF_ARGS_MAX 5 105 105 #define METHOD_ARG_BIT_WIDTH 3 106 106 #define METHOD_ARG_MASK 0x0007 107 107 #define ARG_COUNT_IS_MINIMUM 0x8000 ··· 117 117 #define METHOD_2ARGS(a1,a2) (2 | (a1 << 3) | (a2 << 6)) 118 118 #define METHOD_3ARGS(a1,a2,a3) (3 | (a1 << 3) | (a2 << 6) | (a3 << 9)) 119 119 #define METHOD_4ARGS(a1,a2,a3,a4) (4 | (a1 << 3) | (a2 << 6) | (a3 << 9) | (a4 << 12)) 120 + #define METHOD_5ARGS(a1,a2,a3,a4,a5) (5 | (a1 << 3) | (a2 << 6) | (a3 << 9) | (a4 << 12) | (a5 << 15)) 120 121 121 122 #define METHOD_RETURNS(type) (type) 122 123 #define METHOD_NO_RETURN_VALUE 0 ··· 903 902 {{"_S4W", METHOD_0ARGS, 904 903 METHOD_RETURNS(ACPI_RTYPE_INTEGER)}}, 905 904 905 + {{"_SBA", METHOD_0ARGS, 906 + METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (4 Int) */ 907 + PACKAGE_INFO(ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 4, 0, 0, 0), 908 + 909 + {{"_SBI", METHOD_0ARGS, 910 + METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (1 Int, 1 Buf) */ 911 + PACKAGE_INFO(ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 1, 912 + ACPI_RTYPE_BUFFER, 1, 0), 913 + 914 + {{"_SBR", 915 + METHOD_3ARGS(ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, 916 + ACPI_TYPE_INTEGER), 917 + METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (2 Int) */ 918 + PACKAGE_INFO(ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 2, 919 + ACPI_RTYPE_BUFFER | ACPI_RTYPE_INTEGER, 1, 0), 920 + 906 921 {{"_SBS", METHOD_0ARGS, 907 922 METHOD_RETURNS(ACPI_RTYPE_INTEGER)}}, 923 + 924 + {{"_SBT", 925 + METHOD_4ARGS(ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, 926 + ACPI_TYPE_ANY), 927 + METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (2 Int, 1 Buf | Int) */ 928 + PACKAGE_INFO(ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 2, 929 + ACPI_RTYPE_BUFFER | ACPI_RTYPE_INTEGER, 1, 0), 930 + 931 + {{"_SBW", 932 + METHOD_5ARGS(ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, 933 + ACPI_TYPE_INTEGER, ACPI_TYPE_ANY), 934 + METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}}, 935 + PACKAGE_INFO(ACPI_PTYPE1_FIXED, ACPI_RTYPE_BUFFER | ACPI_RTYPE_INTEGER, 936 + 1, 0, 0, 0), 908 937 909 938 {{"_SCP", METHOD_1ARGS(ACPI_TYPE_INTEGER) | ARG_COUNT_IS_MINIMUM, 910 939 METHOD_NO_RETURN_VALUE}}, /* Acpi 1.0 allowed 1 integer arg. Acpi 3.0 expanded to 3 args. Allow both. */
+30 -9
drivers/acpi/acpica/dbexec.c
··· 86 86 * 87 87 * RETURN: Status 88 88 * 89 - * DESCRIPTION: Execute a control method. 89 + * DESCRIPTION: Execute a control method. Used to evaluate objects via the 90 + * "EXECUTE" or "EVALUATE" commands. 90 91 * 91 92 ******************************************************************************/ 92 93 ··· 315 314 316 315 status = acpi_evaluate_object(node, NULL, NULL, &return_obj); 317 316 317 + acpi_gbl_method_executing = FALSE; 318 + 318 319 acpi_os_printf("Evaluation of [%4.4s] returned %s\n", 319 320 acpi_ut_get_node_name(node), 320 321 acpi_format_exception(status)); 321 322 322 - acpi_gbl_method_executing = FALSE; 323 323 return (AE_OK); 324 324 } 325 325 ··· 336 334 * RETURN: None 337 335 * 338 336 * DESCRIPTION: Execute a control method. Name is relative to the current 339 - * scope. 337 + * scope. Function used for the "EXECUTE", "EVALUATE", and 338 + * "ALL" commands 340 339 * 341 340 ******************************************************************************/ 342 341 ··· 375 372 return; 376 373 } 377 374 375 + if ((flags & EX_ALL) && (strlen(name) > 4)) { 376 + acpi_os_printf("Input name (%s) must be a 4-char NameSeg\n", 377 + name); 378 + return; 379 + } 380 + 378 381 name_string = ACPI_ALLOCATE(strlen(name) + 1); 379 382 if (!name_string) { 380 383 return; ··· 398 389 return; 399 390 } 400 391 401 - acpi_gbl_db_method_info.name = name_string; 402 - acpi_gbl_db_method_info.args = args; 403 - acpi_gbl_db_method_info.types = types; 404 - acpi_gbl_db_method_info.flags = flags; 392 + /* Command (ALL <nameseg>) to execute all methods of a particular name */ 405 393 406 - return_obj.pointer = NULL; 407 - return_obj.length = ACPI_ALLOCATE_BUFFER; 394 + else if (flags & EX_ALL) { 395 + acpi_gbl_db_method_info.name = name_string; 396 + return_obj.pointer = NULL; 397 + return_obj.length = ACPI_ALLOCATE_BUFFER; 398 + acpi_db_evaluate_all(name_string); 399 + ACPI_FREE(name_string); 400 + return; 401 + } else { 402 + acpi_gbl_db_method_info.name = name_string; 403 + acpi_gbl_db_method_info.args = args; 404 + acpi_gbl_db_method_info.types = types; 405 + acpi_gbl_db_method_info.flags = flags; 406 + 407 + return_obj.pointer = NULL; 408 + return_obj.length = ACPI_ALLOCATE_BUFFER; 409 + } 408 410 409 411 status = acpi_db_execute_setup(&acpi_gbl_db_method_info); 410 412 if (ACPI_FAILURE(status)) { ··· 470 450 (u32)return_obj.length); 471 451 472 452 acpi_db_dump_external_object(return_obj.pointer, 1); 453 + acpi_os_printf("\n"); 473 454 474 455 /* Dump a _PLD buffer if present */ 475 456
+13 -1
drivers/acpi/acpica/dbinput.c
··· 37 37 enum acpi_ex_debugger_commands { 38 38 CMD_NOT_FOUND = 0, 39 39 CMD_NULL, 40 + CMD_ALL, 40 41 CMD_ALLOCATIONS, 41 42 CMD_ARGS, 42 43 CMD_ARGUMENTS, ··· 116 115 static const struct acpi_db_command_info acpi_gbl_db_commands[] = { 117 116 {"<NOT FOUND>", 0}, 118 117 {"<NULL>", 0}, 118 + {"ALL", 1}, 119 119 {"ALLOCATIONS", 0}, 120 120 {"ARGS", 0}, 121 121 {"ARGUMENTS", 0}, ··· 224 222 {1, " Type <Object>", "Display object type\n"}, 225 223 226 224 {0, "\nControl Method Execution:", "\n"}, 225 + {1, " All <NameSeg>", "Evaluate all objects named NameSeg\n"}, 227 226 {1, " Evaluate <Namepath> [Arguments]", 228 227 "Evaluate object or control method\n"}, 229 228 {1, " Execute <Namepath> [Arguments]", "Synonym for Evaluate\n"}, ··· 439 436 acpi_os_printf("\n"); 440 437 441 438 } else { 442 - /* Display help for all commands that match the subtring */ 439 + /* Display help for all commands that match the substring */ 443 440 444 441 acpi_db_display_command_info(command, TRUE); 445 442 } ··· 741 738 if (op) { 742 739 return (AE_OK); 743 740 } 741 + break; 742 + 743 + case CMD_ALL: 744 + 745 + acpi_os_printf("Executing all objects with NameSeg: %s\n", 746 + acpi_gbl_db_args[1]); 747 + acpi_db_execute(acpi_gbl_db_args[1], &acpi_gbl_db_args[2], 748 + &acpi_gbl_db_arg_types[2], 749 + EX_NO_SINGLE_STEP | EX_ALL); 744 750 break; 745 751 746 752 case CMD_ALLOCATIONS:
+142 -25
drivers/acpi/acpica/dbmethod.c
··· 21 21 acpi_db_walk_for_execute(acpi_handle obj_handle, 22 22 u32 nesting_level, void *context, void **return_value); 23 23 24 + static acpi_status acpi_db_evaluate_object(struct acpi_namespace_node *node); 25 + 24 26 /******************************************************************************* 25 27 * 26 28 * FUNCTION: acpi_db_set_method_breakpoint ··· 348 346 349 347 /******************************************************************************* 350 348 * 351 - * FUNCTION: acpi_db_walk_for_execute 349 + * FUNCTION: acpi_db_evaluate_object 352 350 * 353 - * PARAMETERS: Callback from walk_namespace 351 + * PARAMETERS: node - Namespace node for the object 354 352 * 355 353 * RETURN: Status 356 354 * 357 - * DESCRIPTION: Batch execution module. Currently only executes predefined 358 - * ACPI names. 355 + * DESCRIPTION: Main execution function for the Evaluate/Execute/All debugger 356 + * commands. 359 357 * 360 358 ******************************************************************************/ 361 359 362 - static acpi_status 363 - acpi_db_walk_for_execute(acpi_handle obj_handle, 364 - u32 nesting_level, void *context, void **return_value) 360 + static acpi_status acpi_db_evaluate_object(struct acpi_namespace_node *node) 365 361 { 366 - struct acpi_namespace_node *node = 367 - (struct acpi_namespace_node *)obj_handle; 368 - struct acpi_db_execute_walk *info = 369 - (struct acpi_db_execute_walk *)context; 370 - struct acpi_buffer return_obj; 371 - acpi_status status; 372 362 char *pathname; 373 363 u32 i; 374 364 struct acpi_device_info *obj_info; 375 365 struct acpi_object_list param_objects; 376 366 union acpi_object params[ACPI_METHOD_NUM_ARGS]; 377 - const union acpi_predefined_info *predefined; 378 - 379 - predefined = acpi_ut_match_predefined_method(node->name.ascii); 380 - if (!predefined) { 381 - return (AE_OK); 382 - } 383 - 384 - if (node->type == ACPI_TYPE_LOCAL_SCOPE) { 385 - return (AE_OK); 386 - } 367 + struct acpi_buffer return_obj; 368 + acpi_status status; 387 369 388 370 pathname = acpi_ns_get_external_pathname(node); 389 371 if (!pathname) { ··· 376 390 377 391 /* Get the object info for number of method parameters */ 378 392 379 - status = acpi_get_object_info(obj_handle, &obj_info); 393 + status = acpi_get_object_info(node, &obj_info); 380 394 if (ACPI_FAILURE(status)) { 381 395 ACPI_FREE(pathname); 382 396 return (status); ··· 407 421 acpi_gbl_method_executing = TRUE; 408 422 409 423 status = acpi_evaluate_object(node, NULL, &param_objects, &return_obj); 424 + acpi_gbl_method_executing = FALSE; 410 425 411 426 acpi_os_printf("%-32s returned %s\n", pathname, 412 427 acpi_format_exception(status)); 413 - acpi_gbl_method_executing = FALSE; 428 + if (return_obj.length) { 429 + acpi_os_printf("Evaluation of %s returned object %p, " 430 + "external buffer length %X\n", 431 + pathname, return_obj.pointer, 432 + (u32)return_obj.length); 433 + 434 + acpi_db_dump_external_object(return_obj.pointer, 1); 435 + acpi_os_printf("\n"); 436 + } 437 + 414 438 ACPI_FREE(pathname); 415 439 416 440 /* Ignore status from method execution */ 441 + 442 + return (AE_OK); 443 + 444 + /* Update count, check if we have executed enough methods */ 445 + 446 + } 447 + 448 + /******************************************************************************* 449 + * 450 + * FUNCTION: acpi_db_walk_for_execute 451 + * 452 + * PARAMETERS: Callback from walk_namespace 453 + * 454 + * RETURN: Status 455 + * 456 + * DESCRIPTION: Batch execution function. Evaluates all "predefined" objects -- 457 + * the nameseg begins with an underscore. 458 + * 459 + ******************************************************************************/ 460 + 461 + static acpi_status 462 + acpi_db_walk_for_execute(acpi_handle obj_handle, 463 + u32 nesting_level, void *context, void **return_value) 464 + { 465 + struct acpi_namespace_node *node = 466 + (struct acpi_namespace_node *)obj_handle; 467 + struct acpi_db_execute_walk *info = 468 + (struct acpi_db_execute_walk *)context; 469 + acpi_status status; 470 + const union acpi_predefined_info *predefined; 471 + 472 + predefined = acpi_ut_match_predefined_method(node->name.ascii); 473 + if (!predefined) { 474 + return (AE_OK); 475 + } 476 + 477 + if (node->type == ACPI_TYPE_LOCAL_SCOPE) { 478 + return (AE_OK); 479 + } 480 + 481 + acpi_db_evaluate_object(node); 482 + 483 + /* Ignore status from object evaluation */ 417 484 418 485 status = AE_OK; 419 486 ··· 477 438 status = AE_CTRL_TERMINATE; 478 439 } 479 440 441 + return (status); 442 + } 443 + 444 + /******************************************************************************* 445 + * 446 + * FUNCTION: acpi_db_walk_for_execute_all 447 + * 448 + * PARAMETERS: Callback from walk_namespace 449 + * 450 + * RETURN: Status 451 + * 452 + * DESCRIPTION: Batch execution function. Evaluates all objects whose path ends 453 + * with the nameseg "Info->NameSeg". Used for the "ALL" command. 454 + * 455 + ******************************************************************************/ 456 + 457 + static acpi_status 458 + acpi_db_walk_for_execute_all(acpi_handle obj_handle, 459 + u32 nesting_level, 460 + void *context, void **return_value) 461 + { 462 + struct acpi_namespace_node *node = 463 + (struct acpi_namespace_node *)obj_handle; 464 + struct acpi_db_execute_walk *info = 465 + (struct acpi_db_execute_walk *)context; 466 + acpi_status status; 467 + 468 + if (!ACPI_COMPARE_NAMESEG(node->name.ascii, info->name_seg)) { 469 + return (AE_OK); 470 + } 471 + 472 + if (node->type == ACPI_TYPE_LOCAL_SCOPE) { 473 + return (AE_OK); 474 + } 475 + 476 + /* Now evaluate the input object (node) */ 477 + 478 + acpi_db_evaluate_object(node); 479 + 480 + /* Ignore status from method execution */ 481 + 482 + status = AE_OK; 483 + 484 + /* Update count of executed methods/objects */ 485 + 486 + info->count++; 480 487 return (status); 481 488 } 482 489 ··· 554 469 555 470 acpi_os_printf("Evaluated %u predefined names in the namespace\n", 556 471 info.count); 472 + } 473 + 474 + /******************************************************************************* 475 + * 476 + * FUNCTION: acpi_db_evaluate_all 477 + * 478 + * PARAMETERS: none_acpi_gbl_db_method_info 479 + * 480 + * RETURN: None 481 + * 482 + * DESCRIPTION: Namespace batch execution. Implements the "ALL" command. 483 + * Execute all namepaths whose final nameseg matches the 484 + * input nameseg. 485 + * 486 + ******************************************************************************/ 487 + 488 + void acpi_db_evaluate_all(char *name_seg) 489 + { 490 + struct acpi_db_execute_walk info; 491 + 492 + info.count = 0; 493 + info.max_count = ACPI_UINT32_MAX; 494 + ACPI_COPY_NAMESEG(info.name_seg, name_seg); 495 + info.name_seg[ACPI_NAMESEG_SIZE] = 0; 496 + 497 + /* Search all nodes in namespace */ 498 + 499 + (void)acpi_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, 500 + ACPI_UINT32_MAX, acpi_db_walk_for_execute_all, 501 + NULL, (void *)&info, NULL); 502 + 503 + acpi_os_printf("Evaluated %u names in the namespace\n", info.count); 557 504 }
+2 -2
drivers/acpi/acpica/evgpe.c
··· 656 656 657 657 /* GPE currently enabled (enable bit == 1)? */ 658 658 659 - status = acpi_hw_read(&enable_reg, &gpe_register_info->enable_address); 659 + status = acpi_hw_gpe_read(&enable_reg, &gpe_register_info->enable_address); 660 660 if (ACPI_FAILURE(status)) { 661 661 goto error_exit; 662 662 } 663 663 664 664 /* GPE currently active (status bit == 1)? */ 665 665 666 - status = acpi_hw_read(&status_reg, &gpe_register_info->status_address); 666 + status = acpi_hw_gpe_read(&status_reg, &gpe_register_info->status_address); 667 667 if (ACPI_FAILURE(status)) { 668 668 goto error_exit; 669 669 }
+19 -8
drivers/acpi/acpica/evgpeblk.c
··· 233 233 234 234 this_register->status_address.space_id = gpe_block->space_id; 235 235 this_register->enable_address.space_id = gpe_block->space_id; 236 - this_register->status_address.bit_width = 237 - ACPI_GPE_REGISTER_WIDTH; 238 - this_register->enable_address.bit_width = 239 - ACPI_GPE_REGISTER_WIDTH; 240 - this_register->status_address.bit_offset = 0; 241 - this_register->enable_address.bit_offset = 0; 242 236 243 237 /* Init the event_info for each GPE within this register */ 244 238 ··· 245 251 246 252 /* Disable all GPEs within this register */ 247 253 248 - status = acpi_hw_write(0x00, &this_register->enable_address); 254 + status = acpi_hw_gpe_write(0x00, &this_register->enable_address); 249 255 if (ACPI_FAILURE(status)) { 250 256 goto error_exit; 251 257 } 252 258 253 259 /* Clear any pending GPE events within this register */ 254 260 255 - status = acpi_hw_write(0xFF, &this_register->status_address); 261 + status = acpi_hw_gpe_write(0xFF, &this_register->status_address); 256 262 if (ACPI_FAILURE(status)) { 257 263 goto error_exit; 258 264 } ··· 309 315 310 316 if (!register_count) { 311 317 return_ACPI_STATUS(AE_OK); 318 + } 319 + 320 + /* Validate the space_ID */ 321 + 322 + if ((space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) && 323 + (space_id != ACPI_ADR_SPACE_SYSTEM_IO)) { 324 + ACPI_ERROR((AE_INFO, 325 + "Unsupported address space: 0x%X", space_id)); 326 + return_ACPI_STATUS(AE_SUPPORT); 327 + } 328 + 329 + if (space_id == ACPI_ADR_SPACE_SYSTEM_IO) { 330 + status = acpi_hw_validate_io_block(address, 331 + ACPI_GPE_REGISTER_WIDTH, 332 + register_count); 333 + if (ACPI_FAILURE(status)) 334 + return_ACPI_STATUS(status); 312 335 } 313 336 314 337 /* Allocate a new GPE block */
+17 -6
drivers/acpi/acpica/evgpeinit.c
··· 32 32 * kernel boot time as well. 33 33 */ 34 34 35 + #ifdef ACPI_GPE_USE_LOGICAL_ADDRESSES 36 + #define ACPI_FADT_GPE_BLOCK_ADDRESS(N) \ 37 + acpi_gbl_FADT.xgpe##N##_block.space_id == \ 38 + ACPI_ADR_SPACE_SYSTEM_MEMORY ? \ 39 + (u64)acpi_gbl_xgpe##N##_block_logical_address : \ 40 + acpi_gbl_FADT.xgpe##N##_block.address 41 + #else 42 + #define ACPI_FADT_GPE_BLOCK_ADDRESS(N) acpi_gbl_FADT.xgpe##N##_block.address 43 + #endif /* ACPI_GPE_USE_LOGICAL_ADDRESSES */ 44 + 35 45 /******************************************************************************* 36 46 * 37 47 * FUNCTION: acpi_ev_gpe_initialize ··· 59 49 u32 register_count1 = 0; 60 50 u32 gpe_number_max = 0; 61 51 acpi_status status; 52 + u64 address; 62 53 63 54 ACPI_FUNCTION_TRACE(ev_gpe_initialize); 64 55 ··· 96 85 * If EITHER the register length OR the block address are zero, then that 97 86 * particular block is not supported. 98 87 */ 99 - if (acpi_gbl_FADT.gpe0_block_length && 100 - acpi_gbl_FADT.xgpe0_block.address) { 88 + address = ACPI_FADT_GPE_BLOCK_ADDRESS(0); 89 + 90 + if (acpi_gbl_FADT.gpe0_block_length && address) { 101 91 102 92 /* GPE block 0 exists (has both length and address > 0) */ 103 93 ··· 109 97 /* Install GPE Block 0 */ 110 98 111 99 status = acpi_ev_create_gpe_block(acpi_gbl_fadt_gpe_device, 112 - acpi_gbl_FADT.xgpe0_block. 113 100 address, 114 101 acpi_gbl_FADT.xgpe0_block. 115 102 space_id, register_count0, 0, ··· 121 110 } 122 111 } 123 112 124 - if (acpi_gbl_FADT.gpe1_block_length && 125 - acpi_gbl_FADT.xgpe1_block.address) { 113 + address = ACPI_FADT_GPE_BLOCK_ADDRESS(1); 114 + 115 + if (acpi_gbl_FADT.gpe1_block_length && address) { 126 116 127 117 /* GPE block 1 exists (has both length and address > 0) */ 128 118 ··· 149 137 150 138 status = 151 139 acpi_ev_create_gpe_block(acpi_gbl_fadt_gpe_device, 152 - acpi_gbl_FADT.xgpe1_block. 153 140 address, 154 141 acpi_gbl_FADT.xgpe1_block. 155 142 space_id, register_count1,
+86 -16
drivers/acpi/acpica/hwgpe.c
··· 26 26 27 27 /****************************************************************************** 28 28 * 29 + * FUNCTION: acpi_hw_gpe_read 30 + * 31 + * PARAMETERS: value - Where the value is returned 32 + * reg - GPE register structure 33 + * 34 + * RETURN: Status 35 + * 36 + * DESCRIPTION: Read from a GPE register in either memory or IO space. 37 + * 38 + * LIMITATIONS: <These limitations also apply to acpi_hw_gpe_write> 39 + * space_ID must be system_memory or system_IO. 40 + * 41 + ******************************************************************************/ 42 + 43 + acpi_status acpi_hw_gpe_read(u64 *value, struct acpi_gpe_address *reg) 44 + { 45 + acpi_status status; 46 + u32 value32; 47 + 48 + if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) { 49 + #ifdef ACPI_GPE_USE_LOGICAL_ADDRESSES 50 + *value = (u64)ACPI_GET8(reg->address); 51 + return_ACPI_STATUS(AE_OK); 52 + #else 53 + return acpi_os_read_memory((acpi_physical_address)reg->address, 54 + value, ACPI_GPE_REGISTER_WIDTH); 55 + #endif 56 + } 57 + 58 + status = acpi_os_read_port((acpi_io_address)reg->address, 59 + &value32, ACPI_GPE_REGISTER_WIDTH); 60 + if (ACPI_FAILURE(status)) 61 + return_ACPI_STATUS(status); 62 + 63 + *value = (u64)value32; 64 + 65 + return_ACPI_STATUS(AE_OK); 66 + } 67 + 68 + /****************************************************************************** 69 + * 70 + * FUNCTION: acpi_hw_gpe_write 71 + * 72 + * PARAMETERS: value - Value to be written 73 + * reg - GPE register structure 74 + * 75 + * RETURN: Status 76 + * 77 + * DESCRIPTION: Write to a GPE register in either memory or IO space. 78 + * 79 + ******************************************************************************/ 80 + 81 + acpi_status acpi_hw_gpe_write(u64 value, struct acpi_gpe_address *reg) 82 + { 83 + if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) { 84 + #ifdef ACPI_GPE_USE_LOGICAL_ADDRESSES 85 + ACPI_SET8(reg->address, value); 86 + return_ACPI_STATUS(AE_OK); 87 + #else 88 + return acpi_os_write_memory((acpi_physical_address)reg->address, 89 + value, ACPI_GPE_REGISTER_WIDTH); 90 + #endif 91 + } 92 + 93 + return acpi_os_write_port((acpi_io_address)reg->address, (u32)value, 94 + ACPI_GPE_REGISTER_WIDTH); 95 + } 96 + 97 + /****************************************************************************** 98 + * 29 99 * FUNCTION: acpi_hw_get_gpe_register_bit 30 100 * 31 101 * PARAMETERS: gpe_event_info - Info block for the GPE ··· 149 79 150 80 /* Get current value of the enable register that contains this GPE */ 151 81 152 - status = acpi_hw_read(&enable_mask, &gpe_register_info->enable_address); 82 + status = acpi_hw_gpe_read(&enable_mask, 83 + &gpe_register_info->enable_address); 153 84 if (ACPI_FAILURE(status)) { 154 85 return (status); 155 86 } ··· 189 118 190 119 /* Write the updated enable mask */ 191 120 192 - status = 193 - acpi_hw_write(enable_mask, 194 - &gpe_register_info->enable_address); 121 + status = acpi_hw_gpe_write(enable_mask, 122 + &gpe_register_info->enable_address); 195 123 } 196 124 return (status); 197 125 } ··· 228 158 */ 229 159 register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info); 230 160 231 - status = 232 - acpi_hw_write(register_bit, &gpe_register_info->status_address); 161 + status = acpi_hw_gpe_write(register_bit, 162 + &gpe_register_info->status_address); 233 163 return (status); 234 164 } 235 165 ··· 297 227 298 228 /* GPE currently enabled (enable bit == 1)? */ 299 229 300 - status = acpi_hw_read(&in_byte, &gpe_register_info->enable_address); 230 + status = acpi_hw_gpe_read(&in_byte, &gpe_register_info->enable_address); 301 231 if (ACPI_FAILURE(status)) { 302 232 return (status); 303 233 } ··· 308 238 309 239 /* GPE currently active (status bit == 1)? */ 310 240 311 - status = acpi_hw_read(&in_byte, &gpe_register_info->status_address); 241 + status = acpi_hw_gpe_read(&in_byte, &gpe_register_info->status_address); 312 242 if (ACPI_FAILURE(status)) { 313 243 return (status); 314 244 } ··· 344 274 345 275 gpe_register_info->enable_mask = enable_mask; 346 276 347 - status = acpi_hw_write(enable_mask, &gpe_register_info->enable_address); 277 + status = acpi_hw_gpe_write(enable_mask, 278 + &gpe_register_info->enable_address); 348 279 return (status); 349 280 } 350 281 ··· 412 341 413 342 /* Clear status on all GPEs in this register */ 414 343 415 - status = 416 - acpi_hw_write(0xFF, 417 - &gpe_block->register_info[i].status_address); 344 + status = acpi_hw_gpe_write(0xFF, 345 + &gpe_block->register_info[i].status_address); 418 346 if (ACPI_FAILURE(status)) { 419 347 return (status); 420 348 } ··· 551 481 for (i = 0; i < gpe_block->register_count; i++) { 552 482 gpe_register_info = &gpe_block->register_info[i]; 553 483 554 - status = acpi_hw_read(&in_enable, 555 - &gpe_register_info->enable_address); 484 + status = acpi_hw_gpe_read(&in_enable, 485 + &gpe_register_info->enable_address); 556 486 if (ACPI_FAILURE(status)) { 557 487 continue; 558 488 } 559 489 560 - status = acpi_hw_read(&in_status, 561 - &gpe_register_info->status_address); 490 + status = acpi_hw_gpe_read(&in_status, 491 + &gpe_register_info->status_address); 562 492 if (ACPI_FAILURE(status)) { 563 493 continue; 564 494 }
+30
drivers/acpi/acpica/hwvalid.c
··· 292 292 293 293 return (AE_OK); 294 294 } 295 + 296 + /****************************************************************************** 297 + * 298 + * FUNCTION: acpi_hw_validate_io_block 299 + * 300 + * PARAMETERS: Address Address of I/O port/register blobk 301 + * bit_width Number of bits (8,16,32) in each register 302 + * count Number of registers in the block 303 + * 304 + * RETURN: Status 305 + * 306 + * DESCRIPTION: Validates a block of I/O ports/registers. 307 + * 308 + ******************************************************************************/ 309 + 310 + acpi_status acpi_hw_validate_io_block(u64 address, u32 bit_width, u32 count) 311 + { 312 + acpi_status status; 313 + 314 + while (count--) { 315 + status = acpi_hw_validate_io_request((acpi_io_address)address, 316 + bit_width); 317 + if (ACPI_FAILURE(status)) 318 + return_ACPI_STATUS(status); 319 + 320 + address += ACPI_DIV_8(bit_width); 321 + } 322 + 323 + return_ACPI_STATUS(AE_OK); 324 + }
+1 -1
drivers/acpi/acpica/nsalloc.c
··· 294 294 node_to_delete = next_node; 295 295 next_node = next_node->peer; 296 296 acpi_ns_delete_node(node_to_delete); 297 - }; 297 + } 298 298 299 299 /* Clear the parent's child pointer */ 300 300
+3 -1
drivers/acpi/acpica/nsarguments.c
··· 55 55 arg_type = METHOD_GET_NEXT_TYPE(arg_type_list); 56 56 user_arg_type = info->parameters[i]->common.type; 57 57 58 - if (user_arg_type != arg_type) { 58 + /* No typechecking for ACPI_TYPE_ANY */ 59 + 60 + if ((user_arg_type != arg_type) && (arg_type != ACPI_TYPE_ANY)) { 59 61 ACPI_WARN_PREDEFINED((AE_INFO, info->full_pathname, 60 62 ACPI_WARN_ALWAYS, 61 63 "Argument #%u type mismatch - "
+2 -1
drivers/acpi/acpica/nsxfobj.c
··· 24 24 * 25 25 * RETURN: Status 26 26 * 27 - * DESCRIPTION: This routine returns the type associatd with a particular handle 27 + * DESCRIPTION: This routine returns the type associated with a particular 28 + * handle 28 29 * 29 30 ******************************************************************************/ 30 31 acpi_status acpi_get_type(acpi_handle handle, acpi_object_type *ret_type)
+2 -2
drivers/acpi/acpica/psparse.c
··· 508 508 } 509 509 510 510 /* 511 - * If the transfer to the new method method call worked 512 - *, a new walk state was created -- get it 511 + * If the transfer to the new method method call worked, 512 + * a new walk state was created -- get it 513 513 */ 514 514 walk_state = acpi_ds_get_current_walk_state(thread); 515 515 continue;
+2 -3
drivers/acpi/acpica/utpredef.c
··· 151 151 152 152 static const char *ut_external_type_names[] = /* Indexed by ACPI_TYPE_* */ 153 153 { 154 - ", UNSUPPORTED-TYPE", 154 + ", Type_ANY", 155 155 ", Integer", 156 156 ", String", 157 157 ", Buffer", ··· 311 311 for (i = 0; i < arg_count; i++) { 312 312 this_argument_type = METHOD_GET_NEXT_TYPE(argument_types); 313 313 314 - if (!this_argument_type 315 - || (this_argument_type > METHOD_MAX_ARG_TYPE)) { 314 + if (this_argument_type > METHOD_MAX_ARG_TYPE) { 316 315 printf("**** Invalid argument type (%u) " 317 316 "in predefined info structure\n", 318 317 this_argument_type);
+24 -9
drivers/acpi/acpica/utstrsuppt.c
··· 45 45 /* Convert each ASCII byte in the input string */ 46 46 47 47 while (*string) { 48 - 49 - /* Character must be ASCII 0-7, otherwise terminate with no error */ 50 - 48 + /* 49 + * Character must be ASCII 0-7, otherwise: 50 + * 1) Runtime: terminate with no error, per the ACPI spec 51 + * 2) Compiler: return an error 52 + */ 51 53 if (!(ACPI_IS_OCTAL_DIGIT(*string))) { 54 + #ifdef ACPI_ASL_COMPILER 55 + status = AE_BAD_OCTAL_CONSTANT; 56 + #endif 52 57 break; 53 58 } 54 59 ··· 99 94 /* Convert each ASCII byte in the input string */ 100 95 101 96 while (*string) { 102 - 103 - /* Character must be ASCII 0-9, otherwise terminate with no error */ 104 - 97 + /* 98 + * Character must be ASCII 0-9, otherwise: 99 + * 1) Runtime: terminate with no error, per the ACPI spec 100 + * 2) Compiler: return an error 101 + */ 105 102 if (!isdigit(*string)) { 103 + #ifdef ACPI_ASL_COMPILER 104 + status = AE_BAD_DECIMAL_CONSTANT; 105 + #endif 106 106 break; 107 107 } 108 108 ··· 153 143 /* Convert each ASCII byte in the input string */ 154 144 155 145 while (*string) { 156 - 157 - /* Must be ASCII A-F, a-f, or 0-9, otherwise terminate with no error */ 158 - 146 + /* 147 + * Character must be ASCII A-F, a-f, or 0-9, otherwise: 148 + * 1) Runtime: terminate with no error, per the ACPI spec 149 + * 2) Compiler: return an error 150 + */ 159 151 if (!isxdigit(*string)) { 152 + #ifdef ACPI_ASL_COMPILER 153 + status = AE_BAD_HEX_CONSTANT; 154 + #endif 160 155 break; 161 156 } 162 157
+5 -1
drivers/acpi/apei/apei-base.c
··· 632 632 rc = apei_check_gar(reg, &address, &access_bit_width); 633 633 if (rc) 634 634 return rc; 635 - return acpi_os_map_generic_address(reg); 635 + 636 + if (!acpi_os_map_generic_address(reg)) 637 + return -ENXIO; 638 + 639 + return 0; 636 640 } 637 641 EXPORT_SYMBOL_GPL(apei_map_generic_address); 638 642
+1 -1
drivers/acpi/arm64/iort.c
··· 1329 1329 1330 1330 smmu = (struct acpi_iort_smmu_v3 *)node->node_data; 1331 1331 if (smmu->flags & ACPI_IORT_SMMU_V3_PXM_VALID) { 1332 - int dev_node = acpi_map_pxm_to_node(smmu->pxm); 1332 + int dev_node = pxm_to_node(smmu->pxm); 1333 1333 1334 1334 if (dev_node != NUMA_NO_NODE && !node_online(dev_node)) 1335 1335 return -EINVAL;
+4
drivers/acpi/bus.c
··· 303 303 capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_HOTPLUG_OST_SUPPORT; 304 304 capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_PCLPI_SUPPORT; 305 305 306 + #ifdef CONFIG_ARM64 307 + capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_GENERIC_INITIATOR_SUPPORT; 308 + #endif 306 309 #ifdef CONFIG_X86 310 + capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_GENERIC_INITIATOR_SUPPORT; 307 311 if (boot_cpu_has(X86_FEATURE_HWP)) { 308 312 capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_CPC_SUPPORT; 309 313 capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_CPCV2_SUPPORT;
+7 -6
drivers/acpi/button.c
··· 153 153 int last_state; 154 154 ktime_t last_time; 155 155 bool suspended; 156 + bool lid_state_initialized; 156 157 }; 157 158 158 159 static struct acpi_device *lid_device; ··· 384 383 385 384 static void acpi_lid_initialize_state(struct acpi_device *device) 386 385 { 386 + struct acpi_button *button = acpi_driver_data(device); 387 + 387 388 switch (lid_init_state) { 388 389 case ACPI_BUTTON_LID_INIT_OPEN: 389 390 (void)acpi_lid_notify_state(device, 1); ··· 397 394 default: 398 395 break; 399 396 } 397 + 398 + button->lid_state_initialized = true; 400 399 } 401 400 402 401 static void acpi_button_notify(struct acpi_device *device, u32 event) 403 402 { 404 403 struct acpi_button *button = acpi_driver_data(device); 405 404 struct input_dev *input; 406 - int users; 407 405 408 406 switch (event) { 409 407 case ACPI_FIXED_HARDWARE_EVENT: ··· 413 409 case ACPI_BUTTON_NOTIFY_STATUS: 414 410 input = button->input; 415 411 if (button->type == ACPI_BUTTON_TYPE_LID) { 416 - mutex_lock(&button->input->mutex); 417 - users = button->input->users; 418 - mutex_unlock(&button->input->mutex); 419 - if (users) 412 + if (button->lid_state_initialized) 420 413 acpi_lid_update_state(device, true); 421 414 } else { 422 415 int keycode; ··· 458 457 struct acpi_button *button = acpi_driver_data(device); 459 458 460 459 button->suspended = false; 461 - if (button->type == ACPI_BUTTON_TYPE_LID && button->input->users) { 460 + if (button->type == ACPI_BUTTON_TYPE_LID) { 462 461 button->last_state = !!acpi_lid_evaluate_state(device); 463 462 button->last_time = ktime_get(); 464 463 acpi_lid_initialize_state(device);
-3
drivers/acpi/container.c
··· 14 14 15 15 #include "internal.h" 16 16 17 - #define _COMPONENT ACPI_CONTAINER_COMPONENT 18 - ACPI_MODULE_NAME("container"); 19 - 20 17 static const struct acpi_device_id container_device_ids[] = { 21 18 {"ACPI0004", 0}, 22 19 {"PNP0A05", 0},
-2
drivers/acpi/custom_method.c
··· 13 13 14 14 #include "internal.h" 15 15 16 - #define _COMPONENT ACPI_SYSTEM_COMPONENT 17 - ACPI_MODULE_NAME("custom_method"); 18 16 MODULE_LICENSE("GPL"); 19 17 20 18 static struct dentry *cm_dentry;
-3
drivers/acpi/debugfs.c
··· 10 10 11 11 #include "internal.h" 12 12 13 - #define _COMPONENT ACPI_SYSTEM_COMPONENT 14 - ACPI_MODULE_NAME("debugfs"); 15 - 16 13 struct dentry *acpi_debugfs_dir; 17 14 EXPORT_SYMBOL_GPL(acpi_debugfs_dir); 18 15
-2
drivers/acpi/dock.c
··· 20 20 21 21 #include "internal.h" 22 22 23 - ACPI_MODULE_NAME("dock"); 24 - 25 23 static bool immediate_undock = 1; 26 24 module_param(immediate_undock, bool, 0644); 27 25 MODULE_PARM_DESC(immediate_undock, "1 (default) will cause the driver to "
+14
drivers/acpi/dptf/Kconfig
··· 14 14 15 15 To compile this driver as a module, choose M here: 16 16 the module will be called dptf_power. 17 + 18 + config DPTF_PCH_FIVR 19 + tristate "DPTF PCH FIVR Participant" 20 + depends on X86 21 + help 22 + This driver adds support for Dynamic Platform and Thermal Framework 23 + (DPTF) PCH FIVR Participant device support. This driver allows to 24 + switch PCH FIVR (Fully Integrated Voltage Regulator) frequency. 25 + This participant is responsible for exposing: 26 + freq_mhz_low_clock 27 + freq_mhz_high_clock 28 + 29 + To compile this driver as a module, choose M here: 30 + the module will be called dptf_pch_fivr.
+1
drivers/acpi/dptf/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 2 obj-$(CONFIG_ACPI) += int340x_thermal.o 3 3 obj-$(CONFIG_DPTF_POWER) += dptf_power.o 4 + obj-$(CONFIG_DPTF_PCH_FIVR) += dptf_pch_fivr.o
+126
drivers/acpi/dptf/dptf_pch_fivr.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + /* 3 + * dptf_pch_fivr: DPTF PCH FIVR Participant driver 4 + * Copyright (c) 2020, Intel Corporation. 5 + */ 6 + 7 + #include <linux/acpi.h> 8 + #include <linux/kernel.h> 9 + #include <linux/module.h> 10 + #include <linux/platform_device.h> 11 + 12 + /* 13 + * Presentation of attributes which are defined for INT1045 14 + * They are: 15 + * freq_mhz_low_clock : Set PCH FIVR switching freq for 16 + * FIVR clock 19.2MHz and 24MHz 17 + * freq_mhz_high_clock : Set PCH FIVR switching freq for 18 + * FIVR clock 38.4MHz 19 + */ 20 + #define PCH_FIVR_SHOW(name, method) \ 21 + static ssize_t name##_show(struct device *dev,\ 22 + struct device_attribute *attr,\ 23 + char *buf)\ 24 + {\ 25 + struct acpi_device *acpi_dev = dev_get_drvdata(dev);\ 26 + unsigned long long val;\ 27 + acpi_status status;\ 28 + \ 29 + status = acpi_evaluate_integer(acpi_dev->handle, #method,\ 30 + NULL, &val);\ 31 + if (ACPI_SUCCESS(status))\ 32 + return sprintf(buf, "%d\n", (int)val);\ 33 + else\ 34 + return -EINVAL;\ 35 + } 36 + 37 + #define PCH_FIVR_STORE(name, method) \ 38 + static ssize_t name##_store(struct device *dev,\ 39 + struct device_attribute *attr,\ 40 + const char *buf, size_t count)\ 41 + {\ 42 + struct acpi_device *acpi_dev = dev_get_drvdata(dev);\ 43 + acpi_status status;\ 44 + u32 val;\ 45 + \ 46 + if (kstrtouint(buf, 0, &val) < 0)\ 47 + return -EINVAL;\ 48 + \ 49 + status = acpi_execute_simple_method(acpi_dev->handle, #method, val);\ 50 + if (ACPI_SUCCESS(status))\ 51 + return count;\ 52 + \ 53 + return -EINVAL;\ 54 + } 55 + 56 + PCH_FIVR_SHOW(freq_mhz_low_clock, GFC0) 57 + PCH_FIVR_SHOW(freq_mhz_high_clock, GFC1) 58 + PCH_FIVR_STORE(freq_mhz_low_clock, RFC0) 59 + PCH_FIVR_STORE(freq_mhz_high_clock, RFC1) 60 + 61 + static DEVICE_ATTR_RW(freq_mhz_low_clock); 62 + static DEVICE_ATTR_RW(freq_mhz_high_clock); 63 + 64 + static struct attribute *fivr_attrs[] = { 65 + &dev_attr_freq_mhz_low_clock.attr, 66 + &dev_attr_freq_mhz_high_clock.attr, 67 + NULL 68 + }; 69 + 70 + static const struct attribute_group pch_fivr_attribute_group = { 71 + .attrs = fivr_attrs, 72 + .name = "pch_fivr_switch_frequency" 73 + }; 74 + 75 + static int pch_fivr_add(struct platform_device *pdev) 76 + { 77 + struct acpi_device *acpi_dev; 78 + unsigned long long ptype; 79 + acpi_status status; 80 + int result; 81 + 82 + acpi_dev = ACPI_COMPANION(&(pdev->dev)); 83 + if (!acpi_dev) 84 + return -ENODEV; 85 + 86 + status = acpi_evaluate_integer(acpi_dev->handle, "PTYP", NULL, &ptype); 87 + if (ACPI_FAILURE(status) || ptype != 0x05) 88 + return -ENODEV; 89 + 90 + result = sysfs_create_group(&pdev->dev.kobj, 91 + &pch_fivr_attribute_group); 92 + if (result) 93 + return result; 94 + 95 + platform_set_drvdata(pdev, acpi_dev); 96 + 97 + return 0; 98 + } 99 + 100 + static int pch_fivr_remove(struct platform_device *pdev) 101 + { 102 + sysfs_remove_group(&pdev->dev.kobj, &pch_fivr_attribute_group); 103 + 104 + return 0; 105 + } 106 + 107 + static const struct acpi_device_id pch_fivr_device_ids[] = { 108 + {"INTC1045", 0}, 109 + {"", 0}, 110 + }; 111 + MODULE_DEVICE_TABLE(acpi, pch_fivr_device_ids); 112 + 113 + static struct platform_driver pch_fivr_driver = { 114 + .probe = pch_fivr_add, 115 + .remove = pch_fivr_remove, 116 + .driver = { 117 + .name = "DPTF PCH FIVR", 118 + .acpi_match_table = pch_fivr_device_ids, 119 + }, 120 + }; 121 + 122 + module_platform_driver(pch_fivr_driver); 123 + 124 + MODULE_AUTHOR("Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>"); 125 + MODULE_LICENSE("GPL v2"); 126 + MODULE_DESCRIPTION("ACPI DPTF PCH FIVR driver");
+1
drivers/acpi/dptf/int340x_thermal.c
··· 27 27 {"INTC1040"}, 28 28 {"INTC1043"}, 29 29 {"INTC1044"}, 30 + {"INTC1045"}, 30 31 {"INTC1047"}, 31 32 {""}, 32 33 };
-3
drivers/acpi/event.c
··· 19 19 20 20 #include "internal.h" 21 21 22 - #define _COMPONENT ACPI_SYSTEM_COMPONENT 23 - ACPI_MODULE_NAME("event"); 24 - 25 22 /* ACPI notifier chain */ 26 23 static BLOCKING_NOTIFIER_HEAD(acpi_chain_head); 27 24
+4 -6
drivers/acpi/nfit/core.c
··· 1389 1389 1390 1390 static umode_t nfit_visible(struct kobject *kobj, struct attribute *a, int n) 1391 1391 { 1392 - struct device *dev = container_of(kobj, struct device, kobj); 1392 + struct device *dev = kobj_to_dev(kobj); 1393 1393 struct nvdimm_bus *nvdimm_bus = to_nvdimm_bus(dev); 1394 1394 1395 1395 if (a == &dev_attr_scrub.attr) ··· 1679 1679 static umode_t acpi_nfit_dimm_attr_visible(struct kobject *kobj, 1680 1680 struct attribute *a, int n) 1681 1681 { 1682 - struct device *dev = container_of(kobj, struct device, kobj); 1682 + struct device *dev = kobj_to_dev(kobj); 1683 1683 struct nvdimm *nvdimm = to_nvdimm(dev); 1684 1684 struct nfit_mem *nfit_mem = nvdimm_provider_data(nvdimm); 1685 1685 ··· 3006 3006 ndr_desc->provider_data = nfit_spa; 3007 3007 ndr_desc->attr_groups = acpi_nfit_region_attribute_groups; 3008 3008 if (spa->flags & ACPI_NFIT_PROXIMITY_VALID) { 3009 - ndr_desc->numa_node = acpi_map_pxm_to_online_node( 3010 - spa->proximity_domain); 3011 - ndr_desc->target_node = acpi_map_pxm_to_node( 3012 - spa->proximity_domain); 3009 + ndr_desc->numa_node = pxm_to_online_node(spa->proximity_domain); 3010 + ndr_desc->target_node = pxm_to_node(spa->proximity_domain); 3013 3011 } else { 3014 3012 ndr_desc->numa_node = NUMA_NO_NODE; 3015 3013 ndr_desc->target_node = NUMA_NO_NODE;
+72 -21
drivers/acpi/numa/hmat.c
··· 63 63 unsigned int memory_pxm; 64 64 unsigned int processor_pxm; 65 65 struct resource memregions; 66 - struct node_hmem_attrs hmem_attrs; 66 + struct node_hmem_attrs hmem_attrs[2]; 67 67 struct list_head caches; 68 68 struct node_cache_attrs cache_attrs; 69 69 bool registered; ··· 72 72 struct memory_initiator { 73 73 struct list_head node; 74 74 unsigned int processor_pxm; 75 + bool has_cpu; 75 76 }; 76 77 77 78 struct memory_locality { ··· 116 115 return; 117 116 118 117 initiator->processor_pxm = cpu_pxm; 118 + initiator->has_cpu = node_state(pxm_to_node(cpu_pxm), N_CPU); 119 119 list_add_tail(&initiator->node, &initiators); 120 120 } 121 121 ··· 224 222 } 225 223 226 224 static void hmat_update_target_access(struct memory_target *target, 227 - u8 type, u32 value) 225 + u8 type, u32 value, int access) 228 226 { 229 227 switch (type) { 230 228 case ACPI_HMAT_ACCESS_LATENCY: 231 - target->hmem_attrs.read_latency = value; 232 - target->hmem_attrs.write_latency = value; 229 + target->hmem_attrs[access].read_latency = value; 230 + target->hmem_attrs[access].write_latency = value; 233 231 break; 234 232 case ACPI_HMAT_READ_LATENCY: 235 - target->hmem_attrs.read_latency = value; 233 + target->hmem_attrs[access].read_latency = value; 236 234 break; 237 235 case ACPI_HMAT_WRITE_LATENCY: 238 - target->hmem_attrs.write_latency = value; 236 + target->hmem_attrs[access].write_latency = value; 239 237 break; 240 238 case ACPI_HMAT_ACCESS_BANDWIDTH: 241 - target->hmem_attrs.read_bandwidth = value; 242 - target->hmem_attrs.write_bandwidth = value; 239 + target->hmem_attrs[access].read_bandwidth = value; 240 + target->hmem_attrs[access].write_bandwidth = value; 243 241 break; 244 242 case ACPI_HMAT_READ_BANDWIDTH: 245 - target->hmem_attrs.read_bandwidth = value; 243 + target->hmem_attrs[access].read_bandwidth = value; 246 244 break; 247 245 case ACPI_HMAT_WRITE_BANDWIDTH: 248 - target->hmem_attrs.write_bandwidth = value; 246 + target->hmem_attrs[access].write_bandwidth = value; 249 247 break; 250 248 default: 251 249 break; ··· 338 336 339 337 if (mem_hier == ACPI_HMAT_MEMORY) { 340 338 target = find_mem_target(targs[targ]); 341 - if (target && target->processor_pxm == inits[init]) 342 - hmat_update_target_access(target, type, value); 339 + if (target && target->processor_pxm == inits[init]) { 340 + hmat_update_target_access(target, type, value, 0); 341 + /* If the node has a CPU, update access 1 */ 342 + if (node_state(pxm_to_node(inits[init]), N_CPU)) 343 + hmat_update_target_access(target, type, value, 1); 344 + } 343 345 } 344 346 } 345 347 } ··· 437 431 pr_info("HMAT: Memory Flags:%04x Processor Domain:%u Memory Domain:%u\n", 438 432 p->flags, p->processor_PD, p->memory_PD); 439 433 440 - if (p->flags & ACPI_HMAT_MEMORY_PD_VALID && hmat_revision == 1) { 434 + if ((hmat_revision == 1 && p->flags & ACPI_HMAT_MEMORY_PD_VALID) || 435 + hmat_revision > 1) { 441 436 target = find_mem_target(p->memory_PD); 442 437 if (!target) { 443 438 pr_debug("HMAT: Memory Domain missing from SRAT\n"); ··· 580 573 unsigned int mem_nid, cpu_nid; 581 574 struct memory_locality *loc = NULL; 582 575 u32 best = 0; 576 + bool access0done = false; 583 577 int i; 584 578 585 579 mem_nid = pxm_to_node(target->memory_pxm); ··· 592 584 if (target->processor_pxm != PXM_INVAL) { 593 585 cpu_nid = pxm_to_node(target->processor_pxm); 594 586 register_memory_node_under_compute_node(mem_nid, cpu_nid, 0); 595 - return; 587 + access0done = true; 588 + if (node_state(cpu_nid, N_CPU)) { 589 + register_memory_node_under_compute_node(mem_nid, cpu_nid, 1); 590 + return; 591 + } 596 592 } 597 593 598 594 if (list_empty(&localities)) ··· 610 598 */ 611 599 bitmap_zero(p_nodes, MAX_NUMNODES); 612 600 list_sort(p_nodes, &initiators, initiator_cmp); 601 + if (!access0done) { 602 + for (i = WRITE_LATENCY; i <= READ_BANDWIDTH; i++) { 603 + loc = localities_types[i]; 604 + if (!loc) 605 + continue; 606 + 607 + best = 0; 608 + list_for_each_entry(initiator, &initiators, node) { 609 + u32 value; 610 + 611 + if (!test_bit(initiator->processor_pxm, p_nodes)) 612 + continue; 613 + 614 + value = hmat_initiator_perf(target, initiator, 615 + loc->hmat_loc); 616 + if (hmat_update_best(loc->hmat_loc->data_type, value, &best)) 617 + bitmap_clear(p_nodes, 0, initiator->processor_pxm); 618 + if (value != best) 619 + clear_bit(initiator->processor_pxm, p_nodes); 620 + } 621 + if (best) 622 + hmat_update_target_access(target, loc->hmat_loc->data_type, 623 + best, 0); 624 + } 625 + 626 + for_each_set_bit(i, p_nodes, MAX_NUMNODES) { 627 + cpu_nid = pxm_to_node(i); 628 + register_memory_node_under_compute_node(mem_nid, cpu_nid, 0); 629 + } 630 + } 631 + 632 + /* Access 1 ignores Generic Initiators */ 633 + bitmap_zero(p_nodes, MAX_NUMNODES); 634 + list_sort(p_nodes, &initiators, initiator_cmp); 635 + best = 0; 613 636 for (i = WRITE_LATENCY; i <= READ_BANDWIDTH; i++) { 614 637 loc = localities_types[i]; 615 638 if (!loc) ··· 654 607 list_for_each_entry(initiator, &initiators, node) { 655 608 u32 value; 656 609 610 + if (!initiator->has_cpu) { 611 + clear_bit(initiator->processor_pxm, p_nodes); 612 + continue; 613 + } 657 614 if (!test_bit(initiator->processor_pxm, p_nodes)) 658 615 continue; 659 616 ··· 668 617 clear_bit(initiator->processor_pxm, p_nodes); 669 618 } 670 619 if (best) 671 - hmat_update_target_access(target, loc->hmat_loc->data_type, best); 620 + hmat_update_target_access(target, loc->hmat_loc->data_type, best, 1); 672 621 } 673 - 674 622 for_each_set_bit(i, p_nodes, MAX_NUMNODES) { 675 623 cpu_nid = pxm_to_node(i); 676 - register_memory_node_under_compute_node(mem_nid, cpu_nid, 0); 624 + register_memory_node_under_compute_node(mem_nid, cpu_nid, 1); 677 625 } 678 626 } 679 627 ··· 685 635 node_add_cache(mem_nid, &tcache->cache_attrs); 686 636 } 687 637 688 - static void hmat_register_target_perf(struct memory_target *target) 638 + static void hmat_register_target_perf(struct memory_target *target, int access) 689 639 { 690 640 unsigned mem_nid = pxm_to_node(target->memory_pxm); 691 - node_set_perf_attrs(mem_nid, &target->hmem_attrs, 0); 641 + node_set_perf_attrs(mem_nid, &target->hmem_attrs[access], access); 692 642 } 693 643 694 644 static void hmat_register_target_devices(struct memory_target *target) ··· 703 653 return; 704 654 705 655 for (res = target->memregions.child; res; res = res->sibling) { 706 - int target_nid = acpi_map_pxm_to_node(target->memory_pxm); 656 + int target_nid = pxm_to_node(target->memory_pxm); 707 657 708 658 hmem_register_device(target_nid, res); 709 659 } ··· 733 683 if (!target->registered) { 734 684 hmat_register_target_initiators(target); 735 685 hmat_register_target_cache(target); 736 - hmat_register_target_perf(target); 686 + hmat_register_target_perf(target, 0); 687 + hmat_register_target_perf(target, 1); 737 688 target->registered = true; 738 689 } 739 690 mutex_unlock(&target_lock);
+70 -3
drivers/acpi/numa/srat.c
··· 36 36 37 37 int pxm_to_node(int pxm) 38 38 { 39 - if (pxm < 0) 39 + if (pxm < 0 || pxm >= MAX_PXM_DOMAINS || numa_off) 40 40 return NUMA_NO_NODE; 41 41 return pxm_to_node_map[pxm]; 42 42 } ··· 135 135 } 136 136 break; 137 137 138 + case ACPI_SRAT_TYPE_GENERIC_AFFINITY: 139 + { 140 + struct acpi_srat_generic_affinity *p = 141 + (struct acpi_srat_generic_affinity *)header; 142 + 143 + if (p->device_handle_type == 0) { 144 + /* 145 + * For pci devices this may be the only place they 146 + * are assigned a proximity domain 147 + */ 148 + pr_debug("SRAT Generic Initiator(Seg:%u BDF:%u) in proximity domain %d %s\n", 149 + *(u16 *)(&p->device_handle[0]), 150 + *(u16 *)(&p->device_handle[2]), 151 + p->proximity_domain, 152 + (p->flags & ACPI_SRAT_GENERIC_AFFINITY_ENABLED) ? 153 + "enabled" : "disabled"); 154 + } else { 155 + /* 156 + * In this case we can rely on the device having a 157 + * proximity domain reference 158 + */ 159 + pr_debug("SRAT Generic Initiator(HID=%.8s UID=%.4s) in proximity domain %d %s\n", 160 + (char *)(&p->device_handle[0]), 161 + (char *)(&p->device_handle[8]), 162 + p->proximity_domain, 163 + (p->flags & ACPI_SRAT_GENERIC_AFFINITY_ENABLED) ? 164 + "enabled" : "disabled"); 165 + } 166 + } 167 + break; 138 168 default: 139 169 pr_warn("Found unsupported SRAT entry (type = 0x%x)\n", 140 170 header->type); ··· 367 337 return 0; 368 338 } 369 339 340 + #if defined(CONFIG_X86) || defined(CONFIG_ARM64) 341 + static int __init 342 + acpi_parse_gi_affinity(union acpi_subtable_headers *header, 343 + const unsigned long end) 344 + { 345 + struct acpi_srat_generic_affinity *gi_affinity; 346 + int node; 347 + 348 + gi_affinity = (struct acpi_srat_generic_affinity *)header; 349 + if (!gi_affinity) 350 + return -EINVAL; 351 + acpi_table_print_srat_entry(&header->common); 352 + 353 + if (!(gi_affinity->flags & ACPI_SRAT_GENERIC_AFFINITY_ENABLED)) 354 + return -EINVAL; 355 + 356 + node = acpi_map_pxm_to_node(gi_affinity->proximity_domain); 357 + if (node == NUMA_NO_NODE || node >= MAX_NUMNODES) { 358 + pr_err("SRAT: Too many proximity domains.\n"); 359 + return -EINVAL; 360 + } 361 + node_set(node, numa_nodes_parsed); 362 + node_set_state(node, N_GENERIC_INITIATOR); 363 + 364 + return 0; 365 + } 366 + #else 367 + static int __init 368 + acpi_parse_gi_affinity(union acpi_subtable_headers *header, 369 + const unsigned long end) 370 + { 371 + return 0; 372 + } 373 + #endif /* defined(CONFIG_X86) || defined (CONFIG_ARM64) */ 374 + 370 375 static int __initdata parsed_numa_memblks; 371 376 372 377 static int __init ··· 455 390 456 391 /* SRAT: System Resource Affinity Table */ 457 392 if (!acpi_table_parse(ACPI_SIG_SRAT, acpi_parse_srat)) { 458 - struct acpi_subtable_proc srat_proc[3]; 393 + struct acpi_subtable_proc srat_proc[4]; 459 394 460 395 memset(srat_proc, 0, sizeof(srat_proc)); 461 396 srat_proc[0].id = ACPI_SRAT_TYPE_CPU_AFFINITY; ··· 464 399 srat_proc[1].handler = acpi_parse_x2apic_affinity; 465 400 srat_proc[2].id = ACPI_SRAT_TYPE_GICC_AFFINITY; 466 401 srat_proc[2].handler = acpi_parse_gicc_affinity; 402 + srat_proc[3].id = ACPI_SRAT_TYPE_GENERIC_AFFINITY; 403 + srat_proc[3].handler = acpi_parse_gi_affinity; 467 404 468 405 acpi_table_parse_entries_array(ACPI_SIG_SRAT, 469 406 sizeof(struct acpi_table_srat), ··· 508 441 509 442 pxm = acpi_get_pxm(handle); 510 443 511 - return acpi_map_pxm_to_node(pxm); 444 + return pxm_to_node(pxm); 512 445 } 513 446 EXPORT_SYMBOL(acpi_get_node);
+17 -13
drivers/acpi/osl.c
··· 447 447 } 448 448 EXPORT_SYMBOL_GPL(acpi_os_unmap_memory); 449 449 450 - int acpi_os_map_generic_address(struct acpi_generic_address *gas) 450 + void __iomem *acpi_os_map_generic_address(struct acpi_generic_address *gas) 451 451 { 452 452 u64 addr; 453 - void __iomem *virt; 454 453 455 454 if (gas->space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) 456 - return 0; 455 + return NULL; 457 456 458 457 /* Handle possible alignment issues */ 459 458 memcpy(&addr, &gas->address, sizeof(addr)); 460 459 if (!addr || !gas->bit_width) 461 - return -EINVAL; 460 + return NULL; 462 461 463 - virt = acpi_os_map_iomem(addr, gas->bit_width / 8); 464 - if (!virt) 465 - return -EIO; 466 - 467 - return 0; 462 + return acpi_os_map_iomem(addr, gas->bit_width / 8); 468 463 } 469 464 EXPORT_SYMBOL(acpi_os_map_generic_address); 470 465 ··· 1744 1749 { 1745 1750 acpi_os_map_generic_address(&acpi_gbl_FADT.xpm1a_event_block); 1746 1751 acpi_os_map_generic_address(&acpi_gbl_FADT.xpm1b_event_block); 1747 - acpi_os_map_generic_address(&acpi_gbl_FADT.xgpe0_block); 1748 - acpi_os_map_generic_address(&acpi_gbl_FADT.xgpe1_block); 1752 + 1753 + acpi_gbl_xgpe0_block_logical_address = 1754 + (unsigned long)acpi_os_map_generic_address(&acpi_gbl_FADT.xgpe0_block); 1755 + acpi_gbl_xgpe1_block_logical_address = 1756 + (unsigned long)acpi_os_map_generic_address(&acpi_gbl_FADT.xgpe1_block); 1757 + 1749 1758 if (acpi_gbl_FADT.flags & ACPI_FADT_RESET_REGISTER) { 1750 1759 /* 1751 1760 * Use acpi_os_map_generic_address to pre-map the reset 1752 1761 * register if it's in system memory. 1753 1762 */ 1754 - int rv; 1763 + void *rv; 1755 1764 1756 1765 rv = acpi_os_map_generic_address(&acpi_gbl_FADT.reset_register); 1757 - pr_debug(PREFIX "%s: map reset_reg status %d\n", __func__, rv); 1766 + pr_debug(PREFIX "%s: map reset_reg %s\n", __func__, 1767 + rv ? "successful" : "failed"); 1758 1768 } 1759 1769 acpi_os_initialized = true; 1760 1770 ··· 1787 1787 1788 1788 acpi_os_unmap_generic_address(&acpi_gbl_FADT.xgpe1_block); 1789 1789 acpi_os_unmap_generic_address(&acpi_gbl_FADT.xgpe0_block); 1790 + acpi_gbl_xgpe0_block_logical_address = 0UL; 1791 + acpi_gbl_xgpe1_block_logical_address = 0UL; 1792 + 1790 1793 acpi_os_unmap_generic_address(&acpi_gbl_FADT.xpm1b_event_block); 1791 1794 acpi_os_unmap_generic_address(&acpi_gbl_FADT.xpm1a_event_block); 1795 + 1792 1796 if (acpi_gbl_FADT.flags & ACPI_FADT_RESET_REGISTER) 1793 1797 acpi_os_unmap_generic_address(&acpi_gbl_FADT.reset_register); 1794 1798
+1 -3
drivers/acpi/pci_root.c
··· 24 24 25 25 #include "internal.h" 26 26 27 - #define _COMPONENT ACPI_PCI_COMPONENT 28 - ACPI_MODULE_NAME("pci_root"); 29 27 #define ACPI_PCI_ROOT_CLASS "pci_bridge" 30 28 #define ACPI_PCI_ROOT_DEVICE_NAME "PCI Root Bridge" 31 29 static int acpi_pci_root_add(struct acpi_device *device, ··· 60 62 61 63 /** 62 64 * acpi_is_root_bridge - determine whether an ACPI CA node is a PCI root bridge 63 - * @handle - the ACPI CA node in question. 65 + * @handle: the ACPI CA node in question. 64 66 * 65 67 * Note: we could make this API take a struct acpi_device * instead, but 66 68 * for now, it's more convenient to operate on an acpi_handle.
-3
drivers/acpi/pci_slot.c
··· 28 28 29 29 static int check_sta_before_sun; 30 30 31 - #define _COMPONENT ACPI_PCI_COMPONENT 32 - ACPI_MODULE_NAME("pci_slot"); 33 - 34 31 #define SLOT_NAME_SIZE 21 /* Inspired by #define in acpiphp.h */ 35 32 36 33 struct acpi_pci_slot {
+67
drivers/acpi/pmic/Kconfig
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + 3 + menuconfig PMIC_OPREGION 4 + bool "PMIC (Power Management Integrated Circuit) operation region support" 5 + help 6 + Select this option to enable support for ACPI operation 7 + region of the PMIC chip. The operation region can be used 8 + to control power rails and sensor reading/writing on the 9 + PMIC chip. 10 + 11 + if PMIC_OPREGION 12 + 13 + config BYTCRC_PMIC_OPREGION 14 + bool "ACPI operation region support for Bay Trail Crystal Cove PMIC" 15 + depends on INTEL_SOC_PMIC 16 + help 17 + This config adds ACPI operation region support for the Bay Trail 18 + version of the Crystal Cove PMIC. 19 + 20 + config CHTCRC_PMIC_OPREGION 21 + bool "ACPI operation region support for Cherry Trail Crystal Cove PMIC" 22 + depends on INTEL_SOC_PMIC 23 + help 24 + This config adds ACPI operation region support for the Cherry Trail 25 + version of the Crystal Cove PMIC. 26 + 27 + config XPOWER_PMIC_OPREGION 28 + bool "ACPI operation region support for XPower AXP288 PMIC" 29 + depends on MFD_AXP20X_I2C && IOSF_MBI=y 30 + help 31 + This config adds ACPI operation region support for XPower AXP288 PMIC. 32 + 33 + config BXT_WC_PMIC_OPREGION 34 + bool "ACPI operation region support for BXT WhiskeyCove PMIC" 35 + depends on INTEL_SOC_PMIC_BXTWC 36 + help 37 + This config adds ACPI operation region support for BXT WhiskeyCove PMIC. 38 + 39 + config CHT_WC_PMIC_OPREGION 40 + bool "ACPI operation region support for CHT Whiskey Cove PMIC" 41 + depends on INTEL_SOC_PMIC_CHTWC 42 + help 43 + This config adds ACPI operation region support for CHT Whiskey Cove PMIC. 44 + 45 + config CHT_DC_TI_PMIC_OPREGION 46 + bool "ACPI operation region support for Dollar Cove TI PMIC" 47 + depends on INTEL_SOC_PMIC_CHTDC_TI 48 + help 49 + This config adds ACPI operation region support for Dollar Cove TI PMIC. 50 + 51 + endif # PMIC_OPREGION 52 + 53 + config TPS68470_PMIC_OPREGION 54 + bool "ACPI operation region support for TPS68470 PMIC" 55 + depends on MFD_TPS68470 56 + help 57 + This config adds ACPI operation region support for TI TPS68470 PMIC. 58 + TPS68470 device is an advanced power management unit that powers 59 + a Compact Camera Module (CCM), generates clocks for image sensors, 60 + drives a dual LED for flash and incorporates two LED drivers for 61 + general purpose indicators. 62 + This driver enables ACPI operation region support control voltage 63 + regulators and clocks. 64 + 65 + This option is a bool as it provides an ACPI operation 66 + region, which must be available before any of the devices 67 + using this, are probed.
+10
drivers/acpi/pmic/Makefile
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + 3 + obj-$(CONFIG_PMIC_OPREGION) += intel_pmic.o 4 + obj-$(CONFIG_BYTCRC_PMIC_OPREGION) += intel_pmic_bytcrc.o 5 + obj-$(CONFIG_CHTCRC_PMIC_OPREGION) += intel_pmic_chtcrc.o 6 + obj-$(CONFIG_XPOWER_PMIC_OPREGION) += intel_pmic_xpower.o 7 + obj-$(CONFIG_BXT_WC_PMIC_OPREGION) += intel_pmic_bxtwc.o 8 + obj-$(CONFIG_CHT_WC_PMIC_OPREGION) += intel_pmic_chtwc.o 9 + obj-$(CONFIG_CHT_DC_TI_PMIC_OPREGION) += intel_pmic_chtdc_ti.o 10 + obj-$(CONFIG_TPS68470_PMIC_OPREGION) += tps68470_pmic.o
-4
drivers/acpi/proc.c
··· 10 10 #include "sleep.h" 11 11 #include "internal.h" 12 12 13 - #define _COMPONENT ACPI_SYSTEM_COMPONENT 14 - 15 13 /* 16 14 * this file provides support for: 17 15 * /proc/acpi/wakeup 18 16 */ 19 - 20 - ACPI_MODULE_NAME("sleep") 21 17 22 18 static int 23 19 acpi_system_wakeup_device_seq_show(struct seq_file *seq, void *offset)
-3
drivers/acpi/processor_core.c
··· 14 14 #include <linux/acpi.h> 15 15 #include <acpi/processor.h> 16 16 17 - #define _COMPONENT ACPI_PROCESSOR_COMPONENT 18 - ACPI_MODULE_NAME("processor_core"); 19 - 20 17 static struct acpi_table_madt *get_madt_table(void) 21 18 { 22 19 static struct acpi_table_madt *madt;
-2
drivers/acpi/processor_thermal.c
··· 20 20 #define PREFIX "ACPI: " 21 21 22 22 #define ACPI_PROCESSOR_CLASS "processor" 23 - #define _COMPONENT ACPI_PROCESSOR_COMPONENT 24 - ACPI_MODULE_NAME("processor_thermal"); 25 23 26 24 #ifdef CONFIG_CPU_FREQ 27 25
+1 -2
drivers/acpi/scan.c
··· 898 898 */ 899 899 err = acpi_device_sleep_wake(device, 0, 0, 0); 900 900 if (err) 901 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 902 - "error in _DSW or _PSW evaluation\n")); 901 + pr_debug("error in _DSW or _PSW evaluation\n"); 903 902 } 904 903 905 904 static void acpi_bus_init_power_state(struct acpi_device *device, int state)
-1
drivers/acpi/tiny-power-button.c
··· 4 4 #include <linux/acpi.h> 5 5 #include <acpi/button.h> 6 6 7 - ACPI_MODULE_NAME("tiny-power-button"); 8 7 MODULE_AUTHOR("Josh Triplett"); 9 8 MODULE_DESCRIPTION("ACPI Tiny Power Button Driver"); 10 9 MODULE_LICENSE("GPL");
+9 -3
drivers/acpi/video_detect.c
··· 35 35 #include <linux/workqueue.h> 36 36 #include <acpi/video.h> 37 37 38 - ACPI_MODULE_NAME("video"); 39 - #define _COMPONENT ACPI_VIDEO_COMPONENT 40 - 41 38 void acpi_video_unregister_backlight(void); 42 39 43 40 static bool backlight_notifier_registered; ··· 277 280 .matches = { 278 281 DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), 279 282 DMI_MATCH(DMI_PRODUCT_NAME, "530U4E/540U4E"), 283 + }, 284 + }, 285 + /* https://bugs.launchpad.net/bugs/1894667 */ 286 + { 287 + .callback = video_detect_force_video, 288 + .ident = "HP 635 Notebook", 289 + .matches = { 290 + DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), 291 + DMI_MATCH(DMI_PRODUCT_NAME, "HP 635 Notebook PC"), 280 292 }, 281 293 }, 282 294
-2
drivers/acpi/wakeup.c
··· 26 26 * suspend/resume and isn't really required as this is called in S-state. At 27 27 * that time, there is no device hotplug 28 28 **/ 29 - #define _COMPONENT ACPI_SYSTEM_COMPONENT 30 - ACPI_MODULE_NAME("wakeup_devices") 31 29 32 30 /** 33 31 * acpi_enable_wakeup_devices - Enable wake-up device GPEs.
+3
drivers/base/node.c
··· 1005 1005 #endif 1006 1006 [N_MEMORY] = _NODE_ATTR(has_memory, N_MEMORY), 1007 1007 [N_CPU] = _NODE_ATTR(has_cpu, N_CPU), 1008 + [N_GENERIC_INITIATOR] = _NODE_ATTR(has_generic_initiator, 1009 + N_GENERIC_INITIATOR), 1008 1010 }; 1009 1011 1010 1012 static struct attribute *node_state_attrs[] = { ··· 1018 1016 #endif 1019 1017 &node_state_attr[N_MEMORY].attr.attr, 1020 1018 &node_state_attr[N_CPU].attr.attr, 1019 + &node_state_attr[N_GENERIC_INITIATOR].attr.attr, 1021 1020 NULL 1022 1021 }; 1023 1022
+1 -1
drivers/iommu/intel/dmar.c
··· 476 476 rhsa = (struct acpi_dmar_rhsa *)header; 477 477 for_each_drhd_unit(drhd) { 478 478 if (drhd->reg_base_addr == rhsa->base_address) { 479 - int node = acpi_map_pxm_to_node(rhsa->proximity_domain); 479 + int node = pxm_to_node(rhsa->proximity_domain); 480 480 481 481 if (!node_online(node)) 482 482 node = NUMA_NO_NODE;
+6 -1
drivers/irqchip/irq-gic-v3-its.c
··· 5269 5269 return -EINVAL; 5270 5270 } 5271 5271 5272 - node = acpi_map_pxm_to_node(its_affinity->proximity_domain); 5272 + /* 5273 + * Note that in theory a new proximity node could be created by this 5274 + * entry as it is an SRAT resource allocation structure. 5275 + * We do not currently support doing so. 5276 + */ 5277 + node = pxm_to_node(its_affinity->proximity_domain); 5273 5278 5274 5279 if (node == NUMA_NO_NODE || node >= MAX_NUMNODES) { 5275 5280 pr_err("SRAT: Invalid NUMA node %d in ITS affinity\n", node);
+1 -1
include/acpi/acconfig.h
··· 121 121 * 122 122 *****************************************************************************/ 123 123 124 - /* Method info (in WALK_STATE), containing local variables and argumetns */ 124 + /* Method info (in WALK_STATE), containing local variables and arguments */ 125 125 126 126 #define ACPI_METHOD_NUM_LOCALS 8 127 127 #define ACPI_METHOD_MAX_LOCAL 7
+2 -2
include/acpi/acexcep.h
··· 40 40 struct acpi_exception_info { 41 41 char *name; 42 42 43 - #ifdef ACPI_HELP_APP 43 + #if defined (ACPI_HELP_APP) || defined (ACPI_ASL_COMPILER) 44 44 char *description; 45 45 #endif 46 46 }; 47 47 48 - #ifdef ACPI_HELP_APP 48 + #if defined (ACPI_HELP_APP) || defined (ACPI_ASL_COMPILER) 49 49 #define EXCEP_TXT(name,description) {name, description} 50 50 #else 51 51 #define EXCEP_TXT(name,description) {name}
+1 -1
include/acpi/acpi_io.h
··· 21 21 void __ref acpi_os_unmap_iomem(void __iomem *virt, acpi_size size); 22 22 void __iomem *acpi_os_get_iomem(acpi_physical_address phys, unsigned int size); 23 23 24 - int acpi_os_map_generic_address(struct acpi_generic_address *addr); 24 + void __iomem *acpi_os_map_generic_address(struct acpi_generic_address *addr); 25 25 void acpi_os_unmap_generic_address(struct acpi_generic_address *addr); 26 26 27 27 #endif
+4
include/acpi/acpi_numa.h
··· 26 26 static inline void disable_srat(void) 27 27 { 28 28 } 29 + static inline int pxm_to_node(int pxm) 30 + { 31 + return 0; 32 + } 29 33 #endif /* CONFIG_ACPI_NUMA */ 30 34 31 35 #ifdef CONFIG_ACPI_HMAT
+1 -1
include/acpi/acpixf.h
··· 12 12 13 13 /* Current ACPICA subsystem version in YYYYMMDD format */ 14 14 15 - #define ACPI_CA_VERSION 0x20200717 15 + #define ACPI_CA_VERSION 0x20200925 16 16 17 17 #include <acpi/acconfig.h> 18 18 #include <acpi/actypes.h>
+1 -1
include/acpi/actypes.h
··· 824 824 * 825 825 * Note: A Data Table region is a special type of operation region 826 826 * that has its own AML opcode. However, internally, the AML 827 - * interpreter simply creates an operation region with an an address 827 + * interpreter simply creates an operation region with an address 828 828 * space type of ACPI_ADR_SPACE_DATA_TABLE. 829 829 */ 830 830 #define ACPI_ADR_SPACE_DATA_TABLE (acpi_adr_space_type) 0x7E /* Internal to ACPICA only */
+7
include/acpi/acuuid.h
··· 27 27 #define UUID_PCI_HOST_BRIDGE "33db4d5b-1ff7-401c-9657-7441c03dd766" 28 28 #define UUID_I2C_DEVICE "3cdff6f7-4267-4555-ad05-b30a3d8938de" 29 29 #define UUID_POWER_BUTTON "dfbcf3c5-e7a5-44e6-9c1f-29c76f6e059c" 30 + #define UUID_MEMORY_DEVICE "03b19910-f473-11dd-87af-0800200c9a66" 31 + #define UUID_GENERIC_BUTTONS_DEVICE "fa6bd625-9ce8-470d-a2c7-b3ca36c4282e" 32 + #define UUID_NVDIMM_ROOT_DEVICE "2f10e7a4-9e91-11e4-89d3-123b93f75cba" 33 + #define UUID_CONTROL_METHOD_BATTERY "f18fc78b-0f15-4978-b793-53f833a1d35b" 30 34 31 35 /* Interfaces */ 32 36 ··· 60 56 #define UUID_BATTERY_THERMAL_LIMIT "4c2067e3-887d-475c-9720-4af1d3ed602e" 61 57 #define UUID_THERMAL_EXTENSIONS "14d399cd-7a27-4b18-8fb4-7cb7b9f4e500" 62 58 #define UUID_DEVICE_PROPERTIES "daffd814-6eba-4d8c-8a91-bc9bbf4aa301" 59 + #define UUID_DEVICE_GRAPHS "ab02a46b-74c7-45a2-bd68-f7d344ef2153" 60 + #define UUID_HIERARCHICAL_DATA_EXTENSION "dbb8e3e6-5886-4ba6-8795-1319f52a966b" 61 + #define UUID_CORESIGHT_GRAPH "3ecbc8b6-1d0e-4fb3-8107-e627f805c6cd" 63 62 64 63 #endif /* __ACUUID_H__ */
+2
include/acpi/battery.h
··· 2 2 #ifndef __ACPI_BATTERY_H 3 3 #define __ACPI_BATTERY_H 4 4 5 + #include <linux/power_supply.h> 6 + 5 7 #define ACPI_BATTERY_CLASS "battery" 6 8 7 9 #define ACPI_BATTERY_NOTIFY_STATUS 0x80
+6 -1
include/acpi/platform/aclinux.h
··· 118 118 119 119 #define USE_NATIVE_ALLOCATE_ZEROED 120 120 121 + /* Use logical addresses for accessing GPE registers in system memory */ 122 + 123 + #define ACPI_GPE_USE_LOGICAL_ADDRESSES 124 + 121 125 /* 122 126 * Overrides for in-kernel ACPICA 123 127 */ ··· 194 190 195 191 #if defined(__ia64__) || (defined(__x86_64__) && !defined(__ILP32__)) ||\ 196 192 defined(__aarch64__) || defined(__PPC64__) ||\ 197 - defined(__s390x__) 193 + defined(__s390x__) ||\ 194 + (defined(__riscv) && (defined(__LP64__) || defined(_LP64))) 198 195 #define ACPI_MACHINE_WIDTH 64 199 196 #define COMPILER_DEPENDENT_INT64 long 200 197 #define COMPILER_DEPENDENT_UINT64 unsigned long
+9 -18
include/linux/acpi.h
··· 420 420 int acpi_get_node(acpi_handle handle); 421 421 422 422 /** 423 - * acpi_map_pxm_to_online_node - Map proximity ID to online node 423 + * pxm_to_online_node - Map proximity ID to online node 424 424 * @pxm: ACPI proximity ID 425 425 * 426 - * This is similar to acpi_map_pxm_to_node(), but always returns an online 426 + * This is similar to pxm_to_node(), but always returns an online 427 427 * node. When the mapped node from a given proximity ID is offline, it 428 428 * looks up the node distance table and returns the nearest online node. 429 429 * 430 430 * ACPI device drivers, which are called after the NUMA initialization has 431 431 * completed in the kernel, can call this interface to obtain their device 432 432 * NUMA topology from ACPI tables. Such drivers do not have to deal with 433 - * offline nodes. A node may be offline when a device proximity ID is 434 - * unique, SRAT memory entry does not exist, or NUMA is disabled, ex. 435 - * "numa=off" on x86. 433 + * offline nodes. A node may be offline when SRAT memory entry does not exist, 434 + * or NUMA is disabled, ex. "numa=off" on x86. 436 435 */ 437 - static inline int acpi_map_pxm_to_online_node(int pxm) 436 + static inline int pxm_to_online_node(int pxm) 438 437 { 439 - int node = acpi_map_pxm_to_node(pxm); 438 + int node = pxm_to_node(pxm); 440 439 441 440 return numa_map_to_online_node(node); 442 441 } 443 442 #else 444 - static inline int acpi_map_pxm_to_online_node(int pxm) 443 + static inline int pxm_to_online_node(int pxm) 445 444 { 446 445 return 0; 447 446 } ··· 545 546 #define OSC_SB_PCLPI_SUPPORT 0x00000080 546 547 #define OSC_SB_OSLPI_SUPPORT 0x00000100 547 548 #define OSC_SB_CPC_DIVERSE_HIGH_SUPPORT 0x00001000 549 + #define OSC_SB_GENERIC_INITIATOR_SUPPORT 0x00002000 548 550 549 551 extern bool osc_sb_apei_support_acked; 550 552 extern bool osc_pc_lpi_support_confirmed; ··· 867 867 868 868 static inline union acpi_object *acpi_evaluate_dsm(acpi_handle handle, 869 869 const guid_t *guid, 870 - int rev, int func, 870 + u64 rev, u64 func, 871 871 union acpi_object *argv4) 872 872 { 873 873 return NULL; ··· 979 979 int acpi_subsys_runtime_resume(struct device *dev); 980 980 int acpi_dev_pm_attach(struct device *dev, bool power_on); 981 981 #else 982 - static inline int acpi_dev_runtime_suspend(struct device *dev) { return 0; } 983 - static inline int acpi_dev_runtime_resume(struct device *dev) { return 0; } 984 982 static inline int acpi_subsys_runtime_suspend(struct device *dev) { return 0; } 985 983 static inline int acpi_subsys_runtime_resume(struct device *dev) { return 0; } 986 984 static inline int acpi_dev_pm_attach(struct device *dev, bool power_on) ··· 1212 1214 static inline int acpi_node_prop_get(const struct fwnode_handle *fwnode, 1213 1215 const char *propname, 1214 1216 void **valptr) 1215 - { 1216 - return -ENXIO; 1217 - } 1218 - 1219 - static inline int acpi_dev_prop_get(const struct acpi_device *adev, 1220 - const char *propname, 1221 - void **valptr) 1222 1217 { 1223 1218 return -ENXIO; 1224 1219 }
+1
include/linux/nodemask.h
··· 399 399 #endif 400 400 N_MEMORY, /* The node has memory(regular, high, movable) */ 401 401 N_CPU, /* The node has one or more cpus */ 402 + N_GENERIC_INITIATOR, /* The node has one or more Generic Initiators */ 402 403 NR_NODE_STATES 403 404 }; 404 405
+2
tools/power/acpi/Makefile
··· 7 7 8 8 include ../../scripts/Makefile.include 9 9 10 + .NOTPARALLEL: 11 + 10 12 all: acpidbg acpidump ec 11 13 clean: acpidbg_clean acpidump_clean ec_clean 12 14 install: acpidbg_install acpidump_install ec_install
+1 -1
tools/power/acpi/os_specific/service_layers/oslinuxtbl.c
··· 110 110 * 111 111 * RETURN: Status; Converted from errno. 112 112 * 113 - * DESCRIPTION: Get last errno and conver it to acpi_status. 113 + * DESCRIPTION: Get last errno and convert it to acpi_status. 114 114 * 115 115 *****************************************************************************/ 116 116