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

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

Pull ACPI updates from Rafael Wysocki:
"These update the ACPICA code in the kernel to the most recent upstream
revision including (but not limited to) new material introduced in the
6.4 version of the spec, update message printing in the ACPI-related
code, address a few issues and clean up code in a number of places.

Specifics:

- Update ACPICA code in the kernel to upstream revision 20210331
including the following changes:

* Add parsing for IVRS IVHD 40h and device entry F0h (Alexander
Monakov).

* Add new CEDT table for CXL 2.0 and iASL support for it (Ben
Widawsky, Bob Moore).

* NFIT: add Location Cookie field (Bob Moore).

* HMAT: add new fields/flags (Bob Moore).

* Add new flags in SRAT (Bob Moore).

* PMTT: add new fields/structures (Bob Moore).

* Add CSI2Bus resource template (Bob Moore).

* iASL: Decode subtable type field for VIOT (Bob Moore).

* Fix various typos and spelling mistakes (Colin Ian King).

* Add new predefined objects _BPC, _BPS, and _BPT (Erik Kaneda).

* Add USB4 capabilities UUID (Erik Kaneda).

* Add CXL ACPI device ID and _CBR object (Erik Kaneda).

* MADT: add Multiprocessor Wakeup Structure (Erik Kaneda).

* PCCT: add support for subtable type 5 (Erik Kaneda).

* PPTT: add new version of subtable type 1 (Erik Kaneda).

* Add SDEV secure access components (Erik Kaneda).

* Add support for PHAT table (Erik Kaneda).

* iASL: Add definitions for the VIOT table (Jean-Philippe
Brucker).

* acpisrc: Add missing conversion for VIOT support (Jean-Philippe
Brucker).

* IORT: Updates for revision E.b (Shameer Kolothum).

- Rearrange message printing in ACPI-related code to avoid using the
ACPICA's internal message printing macros outside ACPICA and do
some related code cleanups (Rafael Wysocki).

- Modify the device enumeration code to turn off all of the unused
ACPI power resources at the end (Rafael Wysocki).

- Change the ACPI power resources handling code to turn off unused
ACPI power resources without checking their status which should not
be necessary by the spec (Rafael Wysocki).

- Add empty stubs for CPPC-related functions to be used when
CONFIG_ACPI_CPPC_LIB is not set (Rafael Wysocki).

- Simplify device enumeration code (Rafael Wysocki).

- Change device enumeration code to use match_string() for string
matching (Andy Shevchenko).

- Modify irqresource_disabled() to retain the resouce flags that have
been set already (Angela Czubak).

- Add native backlight whitelist entry for GA401/GA502/GA503 (Luke
Jones).

- Modify the ACPI backlight driver to let the native backlight
handling take over on hardware-reduced systems (Hans de Goede).

- Introduce acpi_dev_get() and switch over the ACPI core code to
using it (Andy Shevchenko).

- Use kobj_attribute as callback argument instead of a local struct
type in the CPPC linrary code (Nathan Chancellor).

- Drop unneeded initializatio of a static variable from the ACPI
processor driver (Tian Tao).

- Drop unnecessary local variable assignment from the ACPI APEI code
(Colin Ian King).

- Document for_each_acpi_dev_match() macro (Andy Shevchenko).

- Address assorted coding style issues in multiple places (Xiaofei
Tan).

- Capitalize TLAs in a few comments (Andy Shevchenko).

- Correct assorted typos in comments (Tom Saeger)"

* tag 'acpi-5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (68 commits)
ACPI: video: use native backlight for GA401/GA502/GA503
ACPI: APEI: remove redundant assignment to variable rc
ACPI: utils: Capitalize abbreviations in the comments
ACPI: utils: Document for_each_acpi_dev_match() macro
ACPI: bus: Introduce acpi_dev_get() and reuse it in ACPI code
ACPI: scan: Utilize match_string() API
resource: Prevent irqresource_disabled() from erasing flags
ACPI: CPPC: Replace cppc_attr with kobj_attribute
ACPI: scan: Call acpi_get_object_info() from acpi_set_pnp_ids()
ACPI: scan: Drop sta argument from acpi_init_device_object()
ACPI: scan: Drop sta argument from acpi_add_single_object()
ACPI: scan: Rearrange checks in acpi_bus_check_add()
ACPI: scan: Fold acpi_bus_type_and_status() into its caller
ACPI: video: Check LCD flag on ACPI-reduced-hardware devices
ACPI: utils: Add acpi_reduced_hardware() helper
ACPI: dock: fix some coding style issues
ACPI: sysfs: fix some coding style issues
ACPI: PM: add a missed blank line after declarations
ACPI: custom_method: fix a coding style issue
ACPI: CPPC: fix some coding style issues
...

+1128 -647
+1 -3
Documentation/admin-guide/kernel-parameters.txt
··· 50 50 CONFIG_ACPI_DEBUG must be enabled to produce any ACPI 51 51 debug output. Bits in debug_layer correspond to a 52 52 _COMPONENT in an ACPI source file, e.g., 53 - #define _COMPONENT ACPI_PCI_COMPONENT 53 + #define _COMPONENT ACPI_EVENTS 54 54 Bits in debug_level correspond to a level in 55 55 ACPI_DEBUG_PRINT statements, e.g., 56 56 ACPI_DEBUG_PRINT((ACPI_DB_INFO, ... ··· 60 60 61 61 Enable processor driver info messages: 62 62 acpi.debug_layer=0x20000000 63 - Enable PCI/PCI interrupt routing info messages: 64 - acpi.debug_layer=0x400000 65 63 Enable AML "Debug" output, i.e., stores to the Debug 66 64 object while interpreting AML: 67 65 acpi.debug_layer=0xffffffff acpi.debug_level=0x2
+12 -24
Documentation/firmware-guide/acpi/debug.rst
··· 1 1 .. SPDX-License-Identifier: GPL-2.0 2 2 3 - ================= 4 - ACPI Debug Output 5 - ================= 3 + ==================== 4 + ACPI CA Debug Output 5 + ==================== 6 6 7 - The ACPI CA, the Linux ACPI core, and some ACPI drivers can generate debug 8 - output. This document describes how to use this facility. 7 + The ACPI CA can generate debug output. This document describes how to use this 8 + facility. 9 9 10 10 Compile-time configuration 11 11 ========================== 12 12 13 - ACPI debug output is globally enabled by CONFIG_ACPI_DEBUG. If this config 14 - option is turned off, the debug messages are not even built into the 15 - kernel. 13 + The ACPI CA debug output is globally enabled by CONFIG_ACPI_DEBUG. If this 14 + config option is not set, the debug messages are not even built into the kernel. 16 15 17 16 Boot- and run-time configuration 18 17 ================================ ··· 26 27 ======================= 27 28 28 29 The "debug_layer" is a mask that selects components of interest, e.g., a 29 - specific driver or part of the ACPI interpreter. To build the debug_layer 30 - bitmask, look for the "#define _COMPONENT" in an ACPI source file. 30 + specific part of the ACPI interpreter. To build the debug_layer bitmask, look 31 + for the "#define _COMPONENT" in an ACPI source file. 31 32 32 33 You can set the debug_layer mask at boot-time using the acpi.debug_layer 33 34 command line argument, and you can change it after boot by writing values 34 35 to /sys/module/acpi/parameters/debug_layer. 35 36 36 - The possible components are defined in include/acpi/acoutput.h and 37 - include/acpi/acpi_drivers.h. Reading /sys/module/acpi/parameters/debug_layer 38 - shows the supported mask values, currently these:: 37 + The possible components are defined in include/acpi/acoutput.h. 38 + 39 + Reading /sys/module/acpi/parameters/debug_layer shows the supported mask values:: 39 40 40 41 ACPI_UTILITIES 0x00000001 41 42 ACPI_HARDWARE 0x00000002 ··· 51 52 ACPI_CA_DISASSEMBLER 0x00000800 52 53 ACPI_COMPILER 0x00001000 53 54 ACPI_TOOLS 0x00002000 54 - ACPI_SBS_COMPONENT 0x00100000 55 - ACPI_FAN_COMPONENT 0x00200000 56 - ACPI_PCI_COMPONENT 0x00400000 57 - ACPI_CONTAINER_COMPONENT 0x01000000 58 - ACPI_SYSTEM_COMPONENT 0x02000000 59 - ACPI_MEMORY_DEVICE_COMPONENT 0x08000000 60 - ACPI_PROCESSOR_COMPONENT 0x20000000 61 55 62 56 debug_level 63 57 =========== ··· 118 126 AML) during boot:: 119 127 120 128 acpi.debug_layer=0xffffffff acpi.debug_level=0x2 121 - 122 - Enable PCI and PCI interrupt routing debug messages:: 123 - 124 - acpi.debug_layer=0x400000 acpi.debug_level=0x4 125 129 126 130 Enable all ACPI hardware-related messages:: 127 131
+9 -21
drivers/acpi/ac.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 2 /* 3 - * acpi_ac.c - ACPI AC Adapter Driver ($Revision: 27 $) 3 + * acpi_ac.c - ACPI AC Adapter Driver (Revision: 27) 4 4 * 5 5 * Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com> 6 6 * Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com> ··· 78 78 struct acpi_ac { 79 79 struct power_supply *charger; 80 80 struct power_supply_desc charger_desc; 81 - struct acpi_device * device; 81 + struct acpi_device *device; 82 82 unsigned long long state; 83 83 struct notifier_block battery_nb; 84 84 }; 85 85 86 86 #define to_acpi_ac(x) power_supply_get_drvdata(x) 87 87 88 - /* -------------------------------------------------------------------------- 89 - AC Adapter Management 90 - -------------------------------------------------------------------------- */ 91 - 88 + /* AC Adapter Management */ 92 89 static int acpi_ac_get_state(struct acpi_ac *ac) 93 90 { 94 91 acpi_status status = AE_OK; ··· 106 109 return 0; 107 110 } 108 111 109 - /* -------------------------------------------------------------------------- 110 - sysfs I/F 111 - -------------------------------------------------------------------------- */ 112 + /* sysfs I/F */ 112 113 static int get_ac_property(struct power_supply *psy, 113 114 enum power_supply_property psp, 114 115 union power_supply_propval *val) ··· 133 138 POWER_SUPPLY_PROP_ONLINE, 134 139 }; 135 140 136 - /* -------------------------------------------------------------------------- 137 - Driver Model 138 - -------------------------------------------------------------------------- */ 139 - 141 + /* Driver Model */ 140 142 static void acpi_ac_notify(struct acpi_device *device, u32 event) 141 143 { 142 144 struct acpi_ac *ac = acpi_driver_data(device); ··· 166 174 acpi_notifier_call_chain(device, event, (u32) ac->state); 167 175 kobject_uevent(&ac->charger->dev.kobj, KOBJ_CHANGE); 168 176 } 169 - 170 - return; 171 177 } 172 178 173 179 static int acpi_ac_battery_notify(struct notifier_block *nb, ··· 177 187 /* 178 188 * On HP Pavilion dv6-6179er AC status notifications aren't triggered 179 189 * when adapter is plugged/unplugged. However, battery status 180 - * notifcations are triggered when battery starts charging or 190 + * notifications are triggered when battery starts charging or 181 191 * discharging. Re-reading AC status triggers lost AC notifications, 182 192 * if AC status has changed. 183 193 */ ··· 272 282 ac->battery_nb.notifier_call = acpi_ac_battery_notify; 273 283 register_acpi_notifier(&ac->battery_nb); 274 284 end: 275 - if (result) { 285 + if (result) 276 286 kfree(ac); 277 - } 278 287 279 288 return result; 280 289 } ··· 282 293 static int acpi_ac_resume(struct device *dev) 283 294 { 284 295 struct acpi_ac *ac; 285 - unsigned old_state; 296 + unsigned int old_state; 286 297 287 298 if (!dev) 288 299 return -EINVAL; ··· 341 352 } 342 353 343 354 result = acpi_bus_register_driver(&acpi_ac_driver); 344 - if (result < 0) { 355 + if (result < 0) 345 356 return -ENODEV; 346 - } 347 357 348 358 return 0; 349 359 }
+4 -4
drivers/acpi/acpi_apd.c
··· 176 176 177 177 #endif 178 178 179 - /** 180 - * Create platform device during acpi scan attach handle. 181 - * Return value > 0 on success of creating device. 182 - */ 179 + /* 180 + * Create platform device during acpi scan attach handle. 181 + * Return value > 0 on success of creating device. 182 + */ 183 183 static int acpi_apd_create_device(struct acpi_device *adev, 184 184 const struct acpi_device_id *id) 185 185 {
-1
drivers/acpi/acpi_ipmi.c
··· 478 478 ipmi_dev_release(ipmi_device); 479 479 err_ref: 480 480 put_device(smi_data.dev); 481 - return; 482 481 } 483 482 484 483 static void ipmi_bmc_gone(int iface)
+2
drivers/acpi/acpi_lpss.c
··· 377 377 static int is_memory(struct acpi_resource *res, void *not_used) 378 378 { 379 379 struct resource r; 380 + 380 381 return !acpi_dev_resource_memory(res, &r); 381 382 } 382 383 ··· 1201 1200 if (pdata->dev_desc->resume_from_noirq) { 1202 1201 /* This is analogous to the acpi_lpss_suspend_noirq() case. */ 1203 1202 int ret = acpi_lpss_do_poweroff_late(dev); 1203 + 1204 1204 if (ret) 1205 1205 return ret; 1206 1206 }
+4
drivers/acpi/acpi_pad.c
··· 128 128 static void exit_round_robin(unsigned int tsk_index) 129 129 { 130 130 struct cpumask *pad_busy_cpus = to_cpumask(pad_busy_cpus_bits); 131 + 131 132 cpumask_clear_cpu(tsk_in_cpu[tsk_index], pad_busy_cpus); 132 133 tsk_in_cpu[tsk_index] = -1; 133 134 } ··· 266 265 struct device_attribute *attr, const char *buf, size_t count) 267 266 { 268 267 unsigned long num; 268 + 269 269 if (kstrtoul(buf, 0, &num)) 270 270 return -EINVAL; 271 271 if (num < 1 || num >= 100) ··· 288 286 struct device_attribute *attr, const char *buf, size_t count) 289 287 { 290 288 unsigned long num; 289 + 291 290 if (kstrtoul(buf, 0, &num)) 292 291 return -EINVAL; 293 292 if (num < 1 || num >= 100) ··· 310 307 struct device_attribute *attr, const char *buf, size_t count) 311 308 { 312 309 unsigned long num; 310 + 313 311 if (kstrtoul(buf, 0, &num)) 314 312 return -EINVAL; 315 313 mutex_lock(&isolated_cpus_lock);
+17 -34
drivers/acpi/acpi_processor.c
··· 22 22 23 23 #include "internal.h" 24 24 25 - #define _COMPONENT ACPI_PROCESSOR_COMPONENT 26 - 27 - ACPI_MODULE_NAME("processor"); 28 - 29 25 DEFINE_PER_CPU(struct acpi_processor *, processors); 30 26 EXPORT_PER_CPU_SYMBOL(processors); 31 27 32 - /* -------------------------------------------------------------------------- 33 - Errata Handling 34 - -------------------------------------------------------------------------- */ 35 - 28 + /* Errata Handling */ 36 29 struct acpi_processor_errata errata __read_mostly; 37 30 EXPORT_SYMBOL_GPL(errata); 38 31 ··· 44 51 45 52 switch (dev->revision) { 46 53 case 0: 47 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found PIIX4 A-step\n")); 54 + dev_dbg(&dev->dev, "Found PIIX4 A-step\n"); 48 55 break; 49 56 case 1: 50 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found PIIX4 B-step\n")); 57 + dev_dbg(&dev->dev, "Found PIIX4 B-step\n"); 51 58 break; 52 59 case 2: 53 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found PIIX4E\n")); 60 + dev_dbg(&dev->dev, "Found PIIX4E\n"); 54 61 break; 55 62 case 3: 56 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found PIIX4M\n")); 63 + dev_dbg(&dev->dev, "Found PIIX4M\n"); 57 64 break; 58 65 default: 59 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found unknown PIIX4\n")); 66 + dev_dbg(&dev->dev, "Found unknown PIIX4\n"); 60 67 break; 61 68 } 62 69 ··· 122 129 } 123 130 124 131 if (errata.piix4.bmisx) 125 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 126 - "Bus master activity detection (BM-IDE) erratum enabled\n")); 132 + dev_dbg(&dev->dev, "Bus master activity detection (BM-IDE) erratum enabled\n"); 127 133 if (errata.piix4.fdma) 128 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 129 - "Type-F DMA livelock erratum (C3 disabled)\n")); 134 + dev_dbg(&dev->dev, "Type-F DMA livelock erratum (C3 disabled)\n"); 130 135 131 136 return 0; 132 137 } ··· 148 157 return result; 149 158 } 150 159 151 - /* -------------------------------------------------------------------------- 152 - Initialization 153 - -------------------------------------------------------------------------- */ 154 - 160 + /* Initialization */ 155 161 #ifdef CONFIG_ACPI_HOTPLUG_CPU 156 162 int __weak acpi_map_cpu(acpi_handle handle, 157 163 phys_cpuid_t physid, u32 acpi_id, int *pcpu) ··· 232 244 */ 233 245 if (acpi_gbl_FADT.pm2_control_block && acpi_gbl_FADT.pm2_control_length) { 234 246 pr->flags.bm_control = 1; 235 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 236 - "Bus mastering arbitration control present\n")); 247 + dev_dbg(&device->dev, "Bus mastering arbitration control present\n"); 237 248 } else 238 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 239 - "No bus mastering arbitration control\n")); 249 + dev_dbg(&device->dev, "No bus mastering arbitration control\n"); 240 250 241 251 if (!strcmp(acpi_device_hid(device), ACPI_PROCESSOR_OBJECT_HID)) { 242 252 /* Declared with "Processor" statement; match ProcessorID */ ··· 277 291 pr->phys_id = acpi_get_phys_id(pr->handle, device_declaration, 278 292 pr->acpi_id); 279 293 if (invalid_phys_cpuid(pr->phys_id)) 280 - acpi_handle_debug(pr->handle, "failed to get CPU physical ID.\n"); 294 + dev_dbg(&device->dev, "Failed to get CPU physical ID.\n"); 281 295 282 296 pr->id = acpi_map_cpuid(pr->phys_id, pr->acpi_id); 283 297 if (!cpu0_initialized && !acpi_has_cpu_in_madt()) { ··· 300 314 */ 301 315 if (invalid_logical_cpuid(pr->id) || !cpu_present(pr->id)) { 302 316 int ret = acpi_processor_hotadd_init(pr); 317 + 303 318 if (ret) 304 319 return ret; 305 320 } ··· 315 328 * CPU+CPU ID. 316 329 */ 317 330 sprintf(acpi_device_bid(device), "CPU%X", pr->id); 318 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Processor [%d:%d]\n", pr->id, 319 - pr->acpi_id)); 331 + dev_dbg(&device->dev, "Processor [%d:%d]\n", pr->id, pr->acpi_id); 320 332 321 333 if (!object.processor.pblk_address) 322 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No PBLK (NULL address)\n")); 334 + dev_dbg(&device->dev, "No PBLK (NULL address)\n"); 323 335 else if (object.processor.pblk_length != 6) 324 336 dev_err(&device->dev, "Invalid PBLK length [%d]\n", 325 337 object.processor.pblk_length); ··· 426 440 } 427 441 428 442 #ifdef CONFIG_ACPI_HOTPLUG_CPU 429 - /* -------------------------------------------------------------------------- 430 - Removal 431 - -------------------------------------------------------------------------- */ 432 - 443 + /* Removal */ 433 444 static void acpi_processor_remove(struct acpi_device *device) 434 445 { 435 446 struct acpi_processor *pr; ··· 884 901 885 902 info->count = last_index; 886 903 887 - end: 904 + end: 888 905 kfree(buffer.pointer); 889 906 890 907 return ret;
+28 -15
drivers/acpi/acpi_video.c
··· 1392 1392 break; 1393 1393 } 1394 1394 } 1395 - /* Ajust level_current to closest available level */ 1395 + /* Adjust level_current to closest available level */ 1396 1396 level_current += delta; 1397 1397 for (i = ACPI_VIDEO_FIRST_LEVEL; i < device->brightness->count; i++) { 1398 1398 l = device->brightness->levels[i]; ··· 1555 1555 1556 1556 /* 1557 1557 * Win8 requires setting bit2 of _DOS to let firmware know it shouldn't 1558 - * preform any automatic brightness change on receiving a notification. 1558 + * perform any automatic brightness change on receiving a notification. 1559 1559 */ 1560 1560 static int acpi_video_bus_start_devices(struct acpi_video_bus *video) 1561 1561 { ··· 2182 2182 return false; 2183 2183 } 2184 2184 2185 + /* 2186 + * We're seeing a lot of bogus backlight interfaces on newer machines 2187 + * without a LCD such as desktops, servers and HDMI sticks. Checking the 2188 + * lcd flag fixes this, enable this by default on any machines which are: 2189 + * 1. Win8 ready (where we also prefer the native backlight driver, so 2190 + * normally the acpi_video code should not register there anyways); *and* 2191 + * 2.1 Report a desktop/server DMI chassis-type, or 2192 + * 2.2 Are an ACPI-reduced-hardware platform (and thus won't use the EC for 2193 + backlight control) 2194 + */ 2195 + static bool should_check_lcd_flag(void) 2196 + { 2197 + if (!acpi_osi_is_win8()) 2198 + return false; 2199 + 2200 + if (dmi_is_desktop()) 2201 + return true; 2202 + 2203 + if (acpi_reduced_hardware()) 2204 + return true; 2205 + 2206 + return false; 2207 + } 2208 + 2185 2209 int acpi_video_register(void) 2186 2210 { 2187 2211 int ret = 0; ··· 2219 2195 goto leave; 2220 2196 } 2221 2197 2222 - /* 2223 - * We're seeing a lot of bogus backlight interfaces on newer machines 2224 - * without a LCD such as desktops, servers and HDMI sticks. Checking 2225 - * the lcd flag fixes this, so enable this on any machines which are 2226 - * win8 ready (where we also prefer the native backlight driver, so 2227 - * normally the acpi_video code should not register there anyways). 2228 - */ 2229 - if (only_lcd == -1) { 2230 - if (dmi_is_desktop() && acpi_osi_is_win8()) 2231 - only_lcd = true; 2232 - else 2233 - only_lcd = false; 2234 - } 2198 + if (only_lcd == -1) 2199 + only_lcd = should_check_lcd_flag(); 2235 2200 2236 2201 dmi_check_system(video_dmi_table); 2237 2202
+15
drivers/acpi/acpica/acpredef.h
··· 328 328 {{"_BMS", METHOD_1ARGS(ACPI_TYPE_INTEGER), 329 329 METHOD_RETURNS(ACPI_RTYPE_INTEGER)}}, 330 330 331 + {{"_BPC", METHOD_0ARGS, 332 + METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (4 Int) */ 333 + PACKAGE_INFO(ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 4, 0, 0, 0), 334 + 335 + {{"_BPS", METHOD_0ARGS, 336 + METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (5 Int) */ 337 + PACKAGE_INFO(ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 5, 0, 0, 0), 338 + 339 + {{"_BPT", METHOD_1ARGS(ACPI_TYPE_PACKAGE), 340 + METHOD_RETURNS(ACPI_RTYPE_INTEGER)}}, 341 + 331 342 {{"_BQC", METHOD_0ARGS, 332 343 METHOD_RETURNS(ACPI_RTYPE_INTEGER)}}, 333 344 ··· 357 346 358 347 {{"_CBA", METHOD_0ARGS, 359 348 METHOD_RETURNS(ACPI_RTYPE_INTEGER)}}, /* See PCI firmware spec 3.0 */ 349 + 350 + {{"_CBR", METHOD_0ARGS, 351 + METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (3 Int) */ 352 + PACKAGE_INFO(ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 3, 0, 0, 0), 360 353 361 354 {{"_CCA", METHOD_0ARGS, 362 355 METHOD_RETURNS(ACPI_RTYPE_INTEGER)}}, /* ACPI 5.1 */
+4
drivers/acpi/acpica/acresrc.h
··· 46 46 ACPI_RSC_1BITFLAG, 47 47 ACPI_RSC_2BITFLAG, 48 48 ACPI_RSC_3BITFLAG, 49 + ACPI_RSC_6BITFLAG, 49 50 ACPI_RSC_ADDRESS, 50 51 ACPI_RSC_BITMASK, 51 52 ACPI_RSC_BITMASK16, ··· 103 102 ACPI_RSD_1BITFLAG, 104 103 ACPI_RSD_2BITFLAG, 105 104 ACPI_RSD_3BITFLAG, 105 + ACPI_RSD_6BITFLAG, 106 106 ACPI_RSD_ADDRESS, 107 107 ACPI_RSD_DWORDLIST, 108 108 ACPI_RSD_LITERAL, ··· 297 295 extern struct acpi_rsconvert_info acpi_rs_convert_ext_address64[]; 298 296 extern struct acpi_rsconvert_info acpi_rs_convert_gpio[]; 299 297 extern struct acpi_rsconvert_info acpi_rs_convert_fixed_dma[]; 298 + extern struct acpi_rsconvert_info acpi_rs_convert_csi2_serial_bus[]; 300 299 extern struct acpi_rsconvert_info acpi_rs_convert_i2c_serial_bus[]; 301 300 extern struct acpi_rsconvert_info acpi_rs_convert_spi_serial_bus[]; 302 301 extern struct acpi_rsconvert_info acpi_rs_convert_uart_serial_bus[]; ··· 352 349 extern struct acpi_rsdump_info acpi_rs_dump_pin_function[]; 353 350 extern struct acpi_rsdump_info acpi_rs_dump_fixed_dma[]; 354 351 extern struct acpi_rsdump_info acpi_rs_dump_common_serial_bus[]; 352 + extern struct acpi_rsdump_info acpi_rs_dump_csi2_serial_bus[]; 355 353 extern struct acpi_rsdump_info acpi_rs_dump_i2c_serial_bus[]; 356 354 extern struct acpi_rsdump_info acpi_rs_dump_spi_serial_bus[]; 357 355 extern struct acpi_rsdump_info acpi_rs_dump_uart_serial_bus[];
+1
drivers/acpi/acpica/acutils.h
··· 28 28 extern const char *acpi_gbl_mem_decode[]; 29 29 extern const char *acpi_gbl_min_decode[]; 30 30 extern const char *acpi_gbl_mtp_decode[]; 31 + extern const char *acpi_gbl_phy_decode[]; 31 32 extern const char *acpi_gbl_rng_decode[]; 32 33 extern const char *acpi_gbl_rw_decode[]; 33 34 extern const char *acpi_gbl_shr_decode[];
+18 -1
drivers/acpi/acpica/amlresrc.h
··· 40 40 #define ACPI_RESTAG_IORESTRICTION "_IOR" 41 41 #define ACPI_RESTAG_LENGTH "_LEN" 42 42 #define ACPI_RESTAG_LINE "_LIN" 43 + #define ACPI_RESTAG_LOCALPORT "_PRT" 43 44 #define ACPI_RESTAG_MEMATTRIBUTES "_MTP" /* Memory(0), Reserved(1), ACPI(2), NVS(3) */ 44 45 #define ACPI_RESTAG_MEMTYPE "_MEM" /* non_cache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */ 45 46 #define ACPI_RESTAG_MAXADDR "_MAX" ··· 50 49 #define ACPI_RESTAG_MODE "_MOD" 51 50 #define ACPI_RESTAG_PARITY "_PAR" 52 51 #define ACPI_RESTAG_PHASE "_PHA" 52 + #define ACPI_RESTAG_PHYTYPE "_PHY" 53 53 #define ACPI_RESTAG_PIN "_PIN" 54 54 #define ACPI_RESTAG_PINCONFIG "_PPI" 55 55 #define ACPI_RESTAG_PINCONFIG_TYPE "_TYP" ··· 318 316 #define AML_RESOURCE_I2C_SERIALBUSTYPE 1 319 317 #define AML_RESOURCE_SPI_SERIALBUSTYPE 2 320 318 #define AML_RESOURCE_UART_SERIALBUSTYPE 3 321 - #define AML_RESOURCE_MAX_SERIALBUSTYPE 3 319 + #define AML_RESOURCE_CSI2_SERIALBUSTYPE 4 320 + #define AML_RESOURCE_MAX_SERIALBUSTYPE 4 322 321 #define AML_RESOURCE_VENDOR_SERIALBUSTYPE 192 /* Vendor defined is 0xC0-0xFF (NOT SUPPORTED) */ 323 322 324 323 struct aml_resource_common_serialbus { 325 324 AML_RESOURCE_LARGE_HEADER_COMMON AML_RESOURCE_SERIAL_COMMON}; 325 + 326 + struct aml_resource_csi2_serialbus { 327 + AML_RESOURCE_LARGE_HEADER_COMMON AML_RESOURCE_SERIAL_COMMON 328 + /* 329 + * Optional fields follow immediately: 330 + * 1) Vendor Data bytes 331 + * 2) Resource Source String 332 + */ 333 + }; 334 + 335 + #define AML_RESOURCE_CSI2_REVISION 1 /* ACPI 6.4 */ 336 + #define AML_RESOURCE_CSI2_TYPE_REVISION 1 /* ACPI 6.4 */ 337 + #define AML_RESOURCE_CSI2_MIN_DATA_LEN 0 /* ACPI 6.4 */ 326 338 327 339 struct aml_resource_i2c_serialbus { 328 340 AML_RESOURCE_LARGE_HEADER_COMMON ··· 526 510 struct aml_resource_i2c_serialbus i2c_serial_bus; 527 511 struct aml_resource_spi_serialbus spi_serial_bus; 528 512 struct aml_resource_uart_serialbus uart_serial_bus; 513 + struct aml_resource_csi2_serialbus csi2_serial_bus; 529 514 struct aml_resource_common_serialbus common_serial_bus; 530 515 struct aml_resource_pin_function pin_function; 531 516 struct aml_resource_pin_config pin_config;
+2 -2
drivers/acpi/acpica/rscalc.c
··· 677 677 *size_needed += buffer_size; 678 678 679 679 ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, 680 - "Type %.2X, AmlLength %.2X InternalLength %.2X\n", 680 + "Type %.2X, AmlLength %.2X InternalLength %.2X%8X\n", 681 681 acpi_ut_get_resource_type(aml_buffer), 682 682 acpi_ut_get_descriptor_length(aml_buffer), 683 - buffer_size)); 683 + ACPI_FORMAT_UINT64(*size_needed))); 684 684 685 685 /* 686 686 * Point to the next resource within the AML stream using the length
+8
drivers/acpi/acpica/rsdump.c
··· 87 87 ("Invalid descriptor type (%X) in resource list\n", 88 88 resource_list->type); 89 89 return; 90 + } else if (!resource_list->type) { 91 + ACPI_ERROR((AE_INFO, "Invalid Zero Resource Type")); 92 + return; 90 93 } 91 94 92 95 /* Sanity check the length. It must not be zero, or we loop forever */ ··· 259 256 260 257 acpi_rs_out_string(name, 261 258 table->pointer[*target & 0x07]); 259 + break; 260 + 261 + case ACPI_RSD_6BITFLAG: 262 + 263 + acpi_rs_out_integer8(name, (ACPI_GET8(target) & 0x3F)); 262 264 break; 263 265 264 266 case ACPI_RSD_SHORTLIST:
+26
drivers/acpi/acpica/rsdumpinfo.c
··· 421 421 ACPI_RS_DUMP_COMMON_SERIAL_BUS 422 422 }; 423 423 424 + struct acpi_rsdump_info acpi_rs_dump_csi2_serial_bus[11] = { 425 + { ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_csi2_serial_bus), 426 + "Camera Serial Bus", NULL }, 427 + { ACPI_RSD_UINT8, ACPI_RSD_OFFSET(csi2_serial_bus.revision_id), 428 + "RevisionId", NULL }, 429 + { ACPI_RSD_UINT8, ACPI_RSD_OFFSET(csi2_serial_bus.type), "Type", 430 + acpi_gbl_sbt_decode }, 431 + { ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(csi2_serial_bus.producer_consumer), 432 + "ProducerConsumer", acpi_gbl_consume_decode }, 433 + { ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(csi2_serial_bus.slave_mode), 434 + "SlaveMode", acpi_gbl_sm_decode }, 435 + { ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(csi2_serial_bus.phy_type), 436 + "PhyType", acpi_gbl_phy_decode }, 437 + { ACPI_RSD_6BITFLAG, 438 + ACPI_RSD_OFFSET(csi2_serial_bus.local_port_instance), 439 + "LocalPortInstance", NULL }, 440 + { ACPI_RSD_UINT8, ACPI_RSD_OFFSET(csi2_serial_bus.type_revision_id), 441 + "TypeRevisionId", NULL }, 442 + { ACPI_RSD_UINT16, ACPI_RSD_OFFSET(csi2_serial_bus.vendor_length), 443 + "VendorLength", NULL }, 444 + { ACPI_RSD_SHORTLISTX, ACPI_RSD_OFFSET(csi2_serial_bus.vendor_data), 445 + "VendorData", NULL }, 446 + { ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(csi2_serial_bus.resource_source), 447 + "ResourceSource", NULL }, 448 + }; 449 + 424 450 struct acpi_rsdump_info acpi_rs_dump_i2c_serial_bus[14] = { 425 451 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_i2c_serial_bus), 426 452 "I2C Serial Bus", NULL},
+5 -1
drivers/acpi/acpica/rsinfo.c
··· 96 96 acpi_rs_convert_pin_group_config, /* 0x12, ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG */ 97 97 }; 98 98 99 - /* Subtype table for serial_bus -- I2C, SPI, and UART */ 99 + /* Subtype table for serial_bus -- I2C, SPI, UART, and CSI2 */ 100 100 101 101 struct acpi_rsconvert_info *acpi_gbl_convert_resource_serial_bus_dispatch[] = { 102 102 NULL, 103 103 acpi_rs_convert_i2c_serial_bus, 104 104 acpi_rs_convert_spi_serial_bus, 105 105 acpi_rs_convert_uart_serial_bus, 106 + acpi_rs_convert_csi2_serial_bus 106 107 }; 107 108 108 109 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUGGER) ··· 143 142 acpi_rs_dump_i2c_serial_bus, /* AML_RESOURCE_I2C_BUS_TYPE */ 144 143 acpi_rs_dump_spi_serial_bus, /* AML_RESOURCE_SPI_BUS_TYPE */ 145 144 acpi_rs_dump_uart_serial_bus, /* AML_RESOURCE_UART_BUS_TYPE */ 145 + acpi_rs_dump_csi2_serial_bus, /* AML_RESOURCE_CSI2_BUS_TYPE */ 146 146 }; 147 147 #endif 148 148 ··· 228 226 sizeof(struct aml_resource_i2c_serialbus), 229 227 sizeof(struct aml_resource_spi_serialbus), 230 228 sizeof(struct aml_resource_uart_serialbus), 229 + sizeof(struct aml_resource_csi2_serialbus), 231 230 }; 232 231 233 232 const u8 acpi_gbl_resource_struct_serial_bus_sizes[] = { ··· 236 233 ACPI_RS_SIZE(struct acpi_resource_i2c_serialbus), 237 234 ACPI_RS_SIZE(struct acpi_resource_spi_serialbus), 238 235 ACPI_RS_SIZE(struct acpi_resource_uart_serialbus), 236 + ACPI_RS_SIZE(struct acpi_resource_csi2_serialbus), 239 237 };
+7 -2
drivers/acpi/acpica/rslist.c
··· 59 59 AML_RESOURCE_MAX_SERIALBUSTYPE) { 60 60 conversion_table = NULL; 61 61 } else { 62 - /* This is an I2C, SPI, or UART serial_bus descriptor */ 62 + /* This is an I2C, SPI, UART, or CSI2 serial_bus descriptor */ 63 63 64 64 conversion_table = 65 65 acpi_gbl_convert_resource_serial_bus_dispatch ··· 87 87 "Could not convert AML resource (Type 0x%X)", 88 88 *aml)); 89 89 return_ACPI_STATUS(status); 90 + } 91 + 92 + if (!resource->length) { 93 + ACPI_EXCEPTION((AE_INFO, status, 94 + "Zero-length resource returned from RsConvertAmlToResource")); 90 95 } 91 96 92 97 ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, ··· 163 158 AML_RESOURCE_MAX_SERIALBUSTYPE) { 164 159 conversion_table = NULL; 165 160 } else { 166 - /* This is an I2C, SPI, or UART serial_bus descriptor */ 161 + /* This is an I2C, SPI, UART or CSI2 serial_bus descriptor */ 167 162 168 163 conversion_table = 169 164 acpi_gbl_convert_resource_serial_bus_dispatch
+19
drivers/acpi/acpica/rsmisc.c
··· 70 70 */ 71 71 count = INIT_TABLE_LENGTH(info); 72 72 while (count) { 73 + target = NULL; 74 + 73 75 /* 74 76 * Source is the external AML byte stream buffer, 75 77 * destination is the internal resource descriptor ··· 120 118 */ 121 119 ACPI_SET8(destination, 122 120 ((ACPI_GET8(source) >> info->value) & 0x07)); 121 + break; 122 + 123 + case ACPI_RSC_6BITFLAG: 124 + /* 125 + * Mask and shift the flag bits 126 + */ 127 + ACPI_SET8(destination, 128 + ((ACPI_GET8(source) >> info->value) & 0x3F)); 123 129 break; 124 130 125 131 case ACPI_RSC_COUNT: ··· 516 506 */ 517 507 ACPI_SET_BIT(*ACPI_CAST8(destination), (u8) 518 508 ((ACPI_GET8(source) & 0x07) << info-> 509 + value)); 510 + break; 511 + 512 + case ACPI_RSC_6BITFLAG: 513 + /* 514 + * Mask and shift the flag bits 515 + */ 516 + ACPI_SET_BIT(*ACPI_CAST8(destination), (u8) 517 + ((ACPI_GET8(source) & 0x3F) << info-> 519 518 value)); 520 519 break; 521 520
+75
drivers/acpi/acpica/rsserial.c
··· 187 187 188 188 /******************************************************************************* 189 189 * 190 + * acpi_rs_convert_csi2_serial_bus 191 + * 192 + ******************************************************************************/ 193 + 194 + struct acpi_rsconvert_info acpi_rs_convert_csi2_serial_bus[14] = { 195 + { ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_SERIAL_BUS, 196 + ACPI_RS_SIZE(struct acpi_resource_csi2_serialbus), 197 + ACPI_RSC_TABLE_SIZE(acpi_rs_convert_csi2_serial_bus) }, 198 + 199 + { ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_SERIAL_BUS, 200 + sizeof(struct aml_resource_csi2_serialbus), 201 + 0 }, 202 + 203 + { ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.common_serial_bus.revision_id), 204 + AML_OFFSET(common_serial_bus.revision_id), 205 + 1 }, 206 + 207 + { ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.csi2_serial_bus.type), 208 + AML_OFFSET(csi2_serial_bus.type), 209 + 1 }, 210 + 211 + { ACPI_RSC_1BITFLAG, 212 + ACPI_RS_OFFSET(data.csi2_serial_bus.producer_consumer), 213 + AML_OFFSET(csi2_serial_bus.flags), 214 + 1 }, 215 + 216 + { ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.csi2_serial_bus.slave_mode), 217 + AML_OFFSET(csi2_serial_bus.flags), 218 + 0 }, 219 + 220 + { ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.csi2_serial_bus.phy_type), 221 + AML_OFFSET(csi2_serial_bus.type_specific_flags), 222 + 0 }, 223 + 224 + { ACPI_RSC_6BITFLAG, 225 + ACPI_RS_OFFSET(data.csi2_serial_bus.local_port_instance), 226 + AML_OFFSET(csi2_serial_bus.type_specific_flags), 227 + 2 }, 228 + 229 + { ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.csi2_serial_bus.type_revision_id), 230 + AML_OFFSET(csi2_serial_bus.type_revision_id), 231 + 1 }, 232 + 233 + /* Vendor data */ 234 + 235 + { ACPI_RSC_COUNT_SERIAL_VEN, 236 + ACPI_RS_OFFSET(data.csi2_serial_bus.vendor_length), 237 + AML_OFFSET(csi2_serial_bus.type_data_length), 238 + AML_RESOURCE_CSI2_MIN_DATA_LEN }, 239 + 240 + { ACPI_RSC_MOVE_SERIAL_VEN, 241 + ACPI_RS_OFFSET(data.csi2_serial_bus.vendor_data), 242 + 0, 243 + sizeof(struct aml_resource_csi2_serialbus) }, 244 + 245 + /* Resource Source */ 246 + 247 + { ACPI_RSC_MOVE8, 248 + ACPI_RS_OFFSET(data.csi2_serial_bus.resource_source.index), 249 + AML_OFFSET(csi2_serial_bus.res_source_index), 250 + 1 }, 251 + 252 + { ACPI_RSC_COUNT_SERIAL_RES, 253 + ACPI_RS_OFFSET(data.csi2_serial_bus.resource_source.string_length), 254 + AML_OFFSET(csi2_serial_bus.type_data_length), 255 + sizeof(struct aml_resource_csi2_serialbus) }, 256 + 257 + { ACPI_RSC_MOVE_SERIAL_RES, 258 + ACPI_RS_OFFSET(data.csi2_serial_bus.resource_source.string_ptr), 259 + AML_OFFSET(csi2_serial_bus.type_data_length), 260 + sizeof(struct aml_resource_csi2_serialbus) }, 261 + }; 262 + 263 + /******************************************************************************* 264 + * 190 265 * acpi_rs_convert_i2c_serial_bus 191 266 * 192 267 ******************************************************************************/
+9 -1
drivers/acpi/acpica/utresdecode.c
··· 82 82 "AddressRangeNVS" 83 83 }; 84 84 85 + const char *acpi_gbl_phy_decode[] = { 86 + "Type C", 87 + "Type D", 88 + "Unknown Type", 89 + "Unknown Type" 90 + }; 91 + 85 92 const char *acpi_gbl_rng_decode[] = { 86 93 "InvalidRanges", 87 94 "NonISAOnlyRanges", ··· 168 161 "/* UNKNOWN serial bus type */", 169 162 "I2C", 170 163 "SPI", 171 - "UART" 164 + "UART", 165 + "CSI2" 172 166 }; 173 167 174 168 /* I2C serial bus access mode */
+1
drivers/acpi/acpica/utresrc.c
··· 64 64 ACPI_AML_SIZE_LARGE(struct aml_resource_i2c_serialbus), 65 65 ACPI_AML_SIZE_LARGE(struct aml_resource_spi_serialbus), 66 66 ACPI_AML_SIZE_LARGE(struct aml_resource_uart_serialbus), 67 + ACPI_AML_SIZE_LARGE(struct aml_resource_csi2_serialbus), 67 68 }; 68 69 69 70 /*
-1
drivers/acpi/apei/einj.c
··· 725 725 goto err_release; 726 726 } 727 727 728 - rc = -ENOMEM; 729 728 einj_param = einj_get_parameter_address(); 730 729 if ((param_extension || acpi5) && einj_param) { 731 730 debugfs_create_x32("flags", S_IRUSR | S_IWUSR, einj_debug_dir,
+1 -1
drivers/acpi/apei/erst.c
··· 54 54 55 55 static struct acpi_table_erst *erst_tab; 56 56 57 - /* ERST Error Log Address Range atrributes */ 57 + /* ERST Error Log Address Range attributes */ 58 58 #define ERST_RANGE_RESERVED 0x0001 59 59 #define ERST_RANGE_NVRAM 0x0002 60 60 #define ERST_RANGE_SLOW 0x0004
+1 -1
drivers/acpi/apei/hest.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 2 /* 3 - * APEI Hardware Error Souce Table support 3 + * APEI Hardware Error Source Table support 4 4 * 5 5 * HEST describes error sources in detail; communicates operational 6 6 * parameters (i.e. severity levels, masking bits, and threshold
+34 -29
drivers/acpi/battery.c
··· 74 74 ACPI_BATTERY_XINFO_PRESENT, 75 75 ACPI_BATTERY_QUIRK_PERCENTAGE_CAPACITY, 76 76 /* On Lenovo Thinkpad models from 2010 and 2011, the power unit 77 - switches between mWh and mAh depending on whether the system 78 - is running on battery or not. When mAh is the unit, most 79 - reported values are incorrect and need to be adjusted by 80 - 10000/design_voltage. Verified on x201, t410, t410s, and x220. 81 - Pre-2010 and 2012 models appear to always report in mWh and 82 - are thus unaffected (tested with t42, t61, t500, x200, x300, 83 - and x230). Also, in mid-2012 Lenovo issued a BIOS update for 84 - the 2011 models that fixes the issue (tested on x220 with a 85 - post-1.29 BIOS), but as of Nov. 2012, no such update is 86 - available for the 2010 models. */ 77 + * switches between mWh and mAh depending on whether the system 78 + * is running on battery or not. When mAh is the unit, most 79 + * reported values are incorrect and need to be adjusted by 80 + * 10000/design_voltage. Verified on x201, t410, t410s, and x220. 81 + * Pre-2010 and 2012 models appear to always report in mWh and 82 + * are thus unaffected (tested with t42, t61, t500, x200, x300, 83 + * and x230). Also, in mid-2012 Lenovo issued a BIOS update for 84 + * the 2011 models that fixes the issue (tested on x220 with a 85 + * post-1.29 BIOS), but as of Nov. 2012, no such update is 86 + * available for the 2010 models. 87 + */ 87 88 ACPI_BATTERY_QUIRK_THINKPAD_MAH, 88 89 /* for batteries reporting current capacity with design capacity 89 90 * on a full charge, but showing degradation in full charge cap. ··· 372 371 POWER_SUPPLY_PROP_SERIAL_NUMBER, 373 372 }; 374 373 375 - /* -------------------------------------------------------------------------- 376 - Battery Management 377 - -------------------------------------------------------------------------- */ 374 + /* Battery Management */ 378 375 struct acpi_offsets { 379 376 size_t offset; /* offset inside struct acpi_sbs_battery */ 380 377 u8 mode; /* int or string? */ ··· 430 431 { 431 432 int i; 432 433 union acpi_object *element; 434 + 433 435 if (package->type != ACPI_TYPE_PACKAGE) 434 436 return -EFAULT; 435 437 for (i = 0; i < num; ++i) { ··· 439 439 element = &package->package.elements[i]; 440 440 if (offsets[i].mode) { 441 441 u8 *ptr = (u8 *)battery + offsets[i].offset; 442 + 442 443 if (element->type == ACPI_TYPE_STRING || 443 444 element->type == ACPI_TYPE_BUFFER) 444 445 strncpy(ptr, element->string.pointer, 32); ··· 498 497 battery->design_capacity_warning * 499 498 10000 / battery->design_voltage; 500 499 /* Curiously, design_capacity_low, unlike the rest of them, 501 - is correct. */ 500 + * is correct. 501 + */ 502 502 /* capacity_granularity_* equal 1 on the systems tested, so 503 - it's impossible to tell if they would need an adjustment 504 - or not if their values were higher. */ 503 + * it's impossible to tell if they would need an adjustment 504 + * or not if their values were higher. 505 + */ 505 506 } 506 507 if (test_bit(ACPI_BATTERY_QUIRK_DEGRADED_FULL_CHARGE, &battery->flags) && 507 508 battery->capacity_now > battery->full_charge_capacity) ··· 535 532 if (ACPI_FAILURE(status)) { 536 533 acpi_handle_info(battery->device->handle, 537 534 "%s evaluation failed: %s\n", 538 - use_bix ?"_BIX":"_BIF", 539 - acpi_format_exception(status)); 535 + use_bix ? "_BIX":"_BIF", 536 + acpi_format_exception(status)); 540 537 } else { 541 538 result = extract_battery_info(use_bix, 542 539 battery, ··· 651 648 char *buf) 652 649 { 653 650 struct acpi_battery *battery = to_acpi_battery(dev_get_drvdata(dev)); 651 + 654 652 return sprintf(buf, "%d\n", battery->alarm * 1000); 655 653 } 656 654 ··· 661 657 { 662 658 unsigned long x; 663 659 struct acpi_battery *battery = to_acpi_battery(dev_get_drvdata(dev)); 660 + 664 661 if (sscanf(buf, "%lu\n", &x) == 1) 665 662 battery->alarm = x/1000; 666 663 if (acpi_battery_present(battery)) ··· 748 743 * This function gets called right after the battery sysfs 749 744 * attributes have been added, so that the drivers that 750 745 * define custom sysfs attributes can add their own. 751 - */ 746 + */ 752 747 static void battery_hook_add_battery(struct acpi_battery *battery) 753 748 { 754 749 struct acpi_battery_hook *hook_node, *tmp; ··· 877 872 { 878 873 struct acpi_battery *battery = (struct acpi_battery *)private; 879 874 /* Note: the hardcoded offsets below have been extracted from 880 - the source code of dmidecode. */ 875 + * the source code of dmidecode. 876 + */ 881 877 if (dm->type == DMI_ENTRY_PORTABLE_BATTERY && dm->length >= 8) { 882 878 const u8 *dmi_data = (const u8 *)(dm + 1); 883 879 int dmi_capacity = get_unaligned((const u16 *)(dmi_data + 6)); 880 + 884 881 if (dm->length >= 18) 885 882 dmi_capacity *= dmi_data[17]; 886 883 if (battery->design_capacity * battery->design_voltage / 1000 ··· 924 917 925 918 if (battery->power_unit && dmi_name_in_vendors("LENOVO")) { 926 919 const char *s; 920 + 927 921 s = dmi_get_system_info(DMI_PRODUCT_VERSION); 928 922 if (s && !strncasecmp(s, "ThinkPad", 8)) { 929 923 dmi_walk(find_battery, battery); ··· 1021 1013 sysfs_add_battery(battery); 1022 1014 } 1023 1015 1024 - /* -------------------------------------------------------------------------- 1025 - Driver Interface 1026 - -------------------------------------------------------------------------- */ 1027 - 1016 + /* Driver Interface */ 1028 1017 static void acpi_battery_notify(struct acpi_device *device, u32 event) 1029 1018 { 1030 1019 struct acpi_battery *battery = acpi_driver_data(device); ··· 1031 1026 return; 1032 1027 old = battery->bat; 1033 1028 /* 1034 - * On Acer Aspire V5-573G notifications are sometimes triggered too 1035 - * early. For example, when AC is unplugged and notification is 1036 - * triggered, battery state is still reported as "Full", and changes to 1037 - * "Discharging" only after short delay, without any notification. 1038 - */ 1029 + * On Acer Aspire V5-573G notifications are sometimes triggered too 1030 + * early. For example, when AC is unplugged and notification is 1031 + * triggered, battery state is still reported as "Full", and changes to 1032 + * "Discharging" only after short delay, without any notification. 1033 + */ 1039 1034 if (battery_notification_delay_ms > 0) 1040 1035 msleep(battery_notification_delay_ms); 1041 1036 if (event == ACPI_BATTERY_NOTIFY_INFO)
+2 -7
drivers/acpi/button.c
··· 156 156 module_param(lid_report_interval, ulong, 0644); 157 157 MODULE_PARM_DESC(lid_report_interval, "Interval (ms) between lid key events"); 158 158 159 - /* -------------------------------------------------------------------------- 160 - FS Interface (/proc) 161 - -------------------------------------------------------------------------- */ 162 - 159 + /* FS Interface (/proc) */ 163 160 static struct proc_dir_entry *acpi_button_dir; 164 161 static struct proc_dir_entry *acpi_lid_dir; 165 162 ··· 345 348 return 0; 346 349 } 347 350 348 - /* -------------------------------------------------------------------------- 349 - Driver Interface 350 - -------------------------------------------------------------------------- */ 351 + /* Driver Interface */ 351 352 int acpi_lid_open(void) 352 353 { 353 354 if (!lid_device)
+44 -52
drivers/acpi/cppc_acpi.c
··· 33 33 34 34 #define pr_fmt(fmt) "ACPI CPPC: " fmt 35 35 36 - #include <linux/cpufreq.h> 37 36 #include <linux/delay.h> 38 37 #include <linux/iopoll.h> 39 38 #include <linux/ktime.h> ··· 100 101 (cpc)->cpc_entry.reg.space_id == \ 101 102 ACPI_ADR_SPACE_PLATFORM_COMM) 102 103 103 - /* Evalutes to True if reg is a NULL register descriptor */ 104 + /* Evaluates to True if reg is a NULL register descriptor */ 104 105 #define IS_NULL_REG(reg) ((reg)->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY && \ 105 106 (reg)->address == 0 && \ 106 107 (reg)->bit_width == 0 && \ 107 108 (reg)->bit_offset == 0 && \ 108 109 (reg)->access_width == 0) 109 110 110 - /* Evalutes to True if an optional cpc field is supported */ 111 + /* Evaluates to True if an optional cpc field is supported */ 111 112 #define CPC_SUPPORTED(cpc) ((cpc)->type == ACPI_TYPE_INTEGER ? \ 112 113 !!(cpc)->cpc_entry.int_value : \ 113 114 !IS_NULL_REG(&(cpc)->cpc_entry.reg)) ··· 118 119 */ 119 120 #define NUM_RETRIES 500ULL 120 121 121 - struct cppc_attr { 122 - struct attribute attr; 123 - ssize_t (*show)(struct kobject *kobj, 124 - struct attribute *attr, char *buf); 125 - ssize_t (*store)(struct kobject *kobj, 126 - struct attribute *attr, const char *c, ssize_t count); 127 - }; 128 - 129 122 #define define_one_cppc_ro(_name) \ 130 - static struct cppc_attr _name = \ 123 + static struct kobj_attribute _name = \ 131 124 __ATTR(_name, 0444, show_##_name, NULL) 132 125 133 126 #define to_cpc_desc(a) container_of(a, struct cpc_desc, kobj) 134 127 135 128 #define show_cppc_data(access_fn, struct_name, member_name) \ 136 129 static ssize_t show_##member_name(struct kobject *kobj, \ 137 - struct attribute *attr, char *buf) \ 130 + struct kobj_attribute *attr, char *buf) \ 138 131 { \ 139 132 struct cpc_desc *cpc_ptr = to_cpc_desc(kobj); \ 140 133 struct struct_name st_name = {0}; \ ··· 152 161 show_cppc_data(cppc_get_perf_ctrs, cppc_perf_fb_ctrs, wraparound_time); 153 162 154 163 static ssize_t show_feedback_ctrs(struct kobject *kobj, 155 - struct attribute *attr, char *buf) 164 + struct kobj_attribute *attr, char *buf) 156 165 { 157 166 struct cpc_desc *cpc_ptr = to_cpc_desc(kobj); 158 167 struct cppc_perf_fb_ctrs fb_ctrs = {0}; ··· 318 327 if (unlikely(ret)) { 319 328 for_each_possible_cpu(i) { 320 329 struct cpc_desc *desc = per_cpu(cpc_desc_ptr, i); 330 + 321 331 if (!desc) 322 332 continue; 323 333 ··· 770 778 cpc_ptr->cpc_regs[i-2].type = ACPI_TYPE_BUFFER; 771 779 memcpy(&cpc_ptr->cpc_regs[i-2].cpc_entry.reg, gas_t, sizeof(*gas_t)); 772 780 } else { 773 - pr_debug("Err in entry:%d in CPC table of CPU:%d \n", i, pr->id); 781 + pr_debug("Err in entry:%d in CPC table of CPU:%d\n", i, pr->id); 774 782 goto out_free; 775 783 } 776 784 } ··· 860 868 void __iomem *addr; 861 869 int pcc_ss_id = per_cpu(cpu_pcc_subspace_idx, pr->id); 862 870 863 - if (pcc_ss_id >=0 && pcc_data[pcc_ss_id]) { 871 + if (pcc_ss_id >= 0 && pcc_data[pcc_ss_id]) { 864 872 if (pcc_data[pcc_ss_id]->pcc_channel_acquired) { 865 873 pcc_data[pcc_ss_id]->refcount--; 866 874 if (!pcc_data[pcc_ss_id]->refcount) { ··· 947 955 val, reg->bit_width); 948 956 949 957 switch (reg->bit_width) { 950 - case 8: 951 - *val = readb_relaxed(vaddr); 952 - break; 953 - case 16: 954 - *val = readw_relaxed(vaddr); 955 - break; 956 - case 32: 957 - *val = readl_relaxed(vaddr); 958 - break; 959 - case 64: 960 - *val = readq_relaxed(vaddr); 961 - break; 962 - default: 963 - pr_debug("Error: Cannot read %u bit width from PCC for ss: %d\n", 964 - reg->bit_width, pcc_ss_id); 965 - ret_val = -EFAULT; 958 + case 8: 959 + *val = readb_relaxed(vaddr); 960 + break; 961 + case 16: 962 + *val = readw_relaxed(vaddr); 963 + break; 964 + case 32: 965 + *val = readl_relaxed(vaddr); 966 + break; 967 + case 64: 968 + *val = readq_relaxed(vaddr); 969 + break; 970 + default: 971 + pr_debug("Error: Cannot read %u bit width from PCC for ss: %d\n", 972 + reg->bit_width, pcc_ss_id); 973 + ret_val = -EFAULT; 966 974 } 967 975 968 976 return ret_val; ··· 986 994 val, reg->bit_width); 987 995 988 996 switch (reg->bit_width) { 989 - case 8: 990 - writeb_relaxed(val, vaddr); 991 - break; 992 - case 16: 993 - writew_relaxed(val, vaddr); 994 - break; 995 - case 32: 996 - writel_relaxed(val, vaddr); 997 - break; 998 - case 64: 999 - writeq_relaxed(val, vaddr); 1000 - break; 1001 - default: 1002 - pr_debug("Error: Cannot write %u bit width to PCC for ss: %d\n", 1003 - reg->bit_width, pcc_ss_id); 1004 - ret_val = -EFAULT; 1005 - break; 997 + case 8: 998 + writeb_relaxed(val, vaddr); 999 + break; 1000 + case 16: 1001 + writew_relaxed(val, vaddr); 1002 + break; 1003 + case 32: 1004 + writel_relaxed(val, vaddr); 1005 + break; 1006 + case 64: 1007 + writeq_relaxed(val, vaddr); 1008 + break; 1009 + default: 1010 + pr_debug("Error: Cannot write %u bit width to PCC for ss: %d\n", 1011 + reg->bit_width, pcc_ss_id); 1012 + ret_val = -EFAULT; 1013 + break; 1006 1014 } 1007 1015 1008 1016 return ret_val; ··· 1322 1330 * is still with OSPM. 1323 1331 * pending_pcc_write_cmd can also be cleared by a different CPU, if 1324 1332 * there was a pcc CMD_READ waiting on down_write and it steals the lock 1325 - * before the pcc CMD_WRITE is completed. pcc_send_cmd checks for this 1333 + * before the pcc CMD_WRITE is completed. send_pcc_cmd checks for this 1326 1334 * case during a CMD_READ and if there are pending writes it delivers 1327 1335 * the write command before servicing the read command 1328 1336 */ ··· 1347 1355 /** 1348 1356 * cppc_get_transition_latency - returns frequency transition latency in ns 1349 1357 * 1350 - * ACPI CPPC does not explicitly specifiy how a platform can specify the 1351 - * transition latency for perfromance change requests. The closest we have 1358 + * ACPI CPPC does not explicitly specify how a platform can specify the 1359 + * transition latency for performance change requests. The closest we have 1352 1360 * is the timing information from the PCCT tables which provides the info 1353 1361 * on the number and frequency of PCC commands the platform can handle. 1354 1362 */
+1 -1
drivers/acpi/custom_method.c
··· 19 19 20 20 /* /sys/kernel/debug/acpi/custom_method */ 21 21 22 - static ssize_t cm_write(struct file *file, const char __user * user_buf, 22 + static ssize_t cm_write(struct file *file, const char __user *user_buf, 23 23 size_t count, loff_t *ppos) 24 24 { 25 25 static char *buf;
+3
drivers/acpi/device_pm.c
··· 966 966 int acpi_subsys_runtime_suspend(struct device *dev) 967 967 { 968 968 int ret = pm_generic_runtime_suspend(dev); 969 + 969 970 return ret ? ret : acpi_dev_suspend(dev, true); 970 971 } 971 972 EXPORT_SYMBOL_GPL(acpi_subsys_runtime_suspend); ··· 981 980 int acpi_subsys_runtime_resume(struct device *dev) 982 981 { 983 982 int ret = acpi_dev_resume(dev); 983 + 984 984 return ret ? ret : pm_generic_runtime_resume(dev); 985 985 } 986 986 EXPORT_SYMBOL_GPL(acpi_subsys_runtime_resume); ··· 1173 1171 int acpi_subsys_restore_early(struct device *dev) 1174 1172 { 1175 1173 int ret = acpi_dev_resume(dev); 1174 + 1176 1175 return ret ? ret : pm_generic_restore_early(dev); 1177 1176 } 1178 1177 EXPORT_SYMBOL_GPL(acpi_subsys_restore_early);
+12 -7
drivers/acpi/device_sysfs.c
··· 73 73 static void acpi_data_node_release(struct kobject *kobj) 74 74 { 75 75 struct acpi_data_node *dn = to_data_node(kobj); 76 + 76 77 complete(&dn->kobj_done); 77 78 } 78 79 ··· 131 130 * Return: 0: no _HID and no _CID 132 131 * -EINVAL: output error 133 132 * -ENOMEM: output is truncated 134 - */ 133 + */ 135 134 static int create_pnp_modalias(struct acpi_device *acpi_dev, char *modalias, 136 135 int size) 137 136 { ··· 377 376 if (ACPI_FAILURE(status) || !acpi_device->flags.ejectable) 378 377 return -ENODEV; 379 378 380 - get_device(&acpi_device->dev); 379 + acpi_dev_get(acpi_device); 381 380 status = acpi_hotplug_schedule(acpi_device, ACPI_OST_EC_OSPM_EJECT); 382 381 if (ACPI_SUCCESS(status)) 383 382 return count; 384 383 385 - put_device(&acpi_device->dev); 384 + acpi_dev_put(acpi_device); 386 385 acpi_evaluate_ost(acpi_device->handle, ACPI_OST_EC_OSPM_EJECT, 387 386 ACPI_OST_SC_NON_SPECIFIC_FAILURE, NULL); 388 387 return status == AE_NO_MEMORY ? -ENOMEM : -EAGAIN; ··· 432 431 /* sysfs file that shows description text from the ACPI _STR method */ 433 432 static ssize_t description_show(struct device *dev, 434 433 struct device_attribute *attr, 435 - char *buf) { 434 + char *buf) 435 + { 436 436 struct acpi_device *acpi_dev = to_acpi_device(dev); 437 437 int result; 438 438 ··· 458 456 459 457 static ssize_t 460 458 sun_show(struct device *dev, struct device_attribute *attr, 461 - char *buf) { 459 + char *buf) 460 + { 462 461 struct acpi_device *acpi_dev = to_acpi_device(dev); 463 462 acpi_status status; 464 463 unsigned long long sun; ··· 474 471 475 472 static ssize_t 476 473 hrv_show(struct device *dev, struct device_attribute *attr, 477 - char *buf) { 474 + char *buf) 475 + { 478 476 struct acpi_device *acpi_dev = to_acpi_device(dev); 479 477 acpi_status status; 480 478 unsigned long long hrv; ··· 489 485 static DEVICE_ATTR_RO(hrv); 490 486 491 487 static ssize_t status_show(struct device *dev, struct device_attribute *attr, 492 - char *buf) { 488 + char *buf) 489 + { 493 490 struct acpi_device *acpi_dev = to_acpi_device(dev); 494 491 acpi_status status; 495 492 unsigned long long sta;
+5 -2
drivers/acpi/dock.c
··· 271 271 272 272 if (!acpi_device_enumerated(adev)) { 273 273 int ret = acpi_bus_scan(adev->handle); 274 + 274 275 if (ret) 275 276 dev_dbg(&adev->dev, "scan error %d\n", -ret); 276 277 } ··· 503 502 struct device_attribute *attr, char *buf) 504 503 { 505 504 struct dock_station *dock_station = dev->platform_data; 505 + 506 506 return snprintf(buf, PAGE_SIZE, "%d\n", dock_station->flags); 507 507 508 508 } ··· 525 523 begin_undock(dock_station); 526 524 ret = handle_eject_request(dock_station, ACPI_NOTIFY_EJECT_REQUEST); 527 525 acpi_scan_lock_release(); 528 - return ret ? ret: count; 526 + return ret ? ret : count; 529 527 } 530 528 static DEVICE_ATTR_WO(undock); 531 529 ··· 537 535 { 538 536 unsigned long long lbuf; 539 537 struct dock_station *dock_station = dev->platform_data; 538 + 540 539 acpi_status status = acpi_evaluate_integer(dock_station->handle, 541 540 "_UID", NULL, &lbuf); 542 541 if (ACPI_FAILURE(status)) 543 - return 0; 542 + return 0; 544 543 545 544 return snprintf(buf, PAGE_SIZE, "%llx\n", lbuf); 546 545 }
+4 -4
drivers/acpi/glue.c
··· 190 190 if (!acpi_dev) 191 191 return -EINVAL; 192 192 193 - get_device(&acpi_dev->dev); 193 + acpi_dev_get(acpi_dev); 194 194 get_device(dev); 195 195 physical_node = kzalloc(sizeof(*physical_node), GFP_KERNEL); 196 196 if (!physical_node) { ··· 217 217 goto err; 218 218 219 219 put_device(dev); 220 - put_device(&acpi_dev->dev); 220 + acpi_dev_put(acpi_dev); 221 221 return 0; 222 222 } 223 223 if (pn->node_id == node_id) { ··· 257 257 err: 258 258 ACPI_COMPANION_SET(dev, NULL); 259 259 put_device(dev); 260 - put_device(&acpi_dev->dev); 260 + acpi_dev_put(acpi_dev); 261 261 return retval; 262 262 } 263 263 EXPORT_SYMBOL_GPL(acpi_bind_one); ··· 285 285 ACPI_COMPANION_SET(dev, NULL); 286 286 /* Drop references taken by acpi_bind_one(). */ 287 287 put_device(dev); 288 - put_device(&acpi_dev->dev); 288 + acpi_dev_put(acpi_dev); 289 289 kfree(entry); 290 290 break; 291 291 }
-1
drivers/acpi/hed.c
··· 74 74 }; 75 75 module_acpi_driver(acpi_hed_driver); 76 76 77 - ACPI_MODULE_NAME("hed"); 78 77 MODULE_AUTHOR("Huang Ying"); 79 78 MODULE_DESCRIPTION("ACPI Hardware Error Device Driver"); 80 79 MODULE_LICENSE("GPL");
+2 -2
drivers/acpi/internal.h
··· 109 109 int acpi_device_add(struct acpi_device *device, 110 110 void (*release)(struct device *)); 111 111 void acpi_init_device_object(struct acpi_device *device, acpi_handle handle, 112 - int type, unsigned long long sta, 113 - struct acpi_device_info *info); 112 + int type); 114 113 int acpi_device_setup_files(struct acpi_device *dev); 115 114 void acpi_device_remove_files(struct acpi_device *dev); 116 115 void acpi_device_add_finalize(struct acpi_device *device); ··· 142 143 int acpi_power_get_inferred_state(struct acpi_device *device, int *state); 143 144 int acpi_power_on_resources(struct acpi_device *device, int state); 144 145 int acpi_power_transition(struct acpi_device *device, int state); 146 + void acpi_turn_off_unused_power_resources(void); 145 147 146 148 /* -------------------------------------------------------------------------- 147 149 Device Power Management
+1 -1
drivers/acpi/nfit/core.c
··· 3831 3831 int ret; 3832 3832 3833 3833 BUILD_BUG_ON(sizeof(struct acpi_table_nfit) != 40); 3834 - BUILD_BUG_ON(sizeof(struct acpi_nfit_system_address) != 56); 3834 + BUILD_BUG_ON(sizeof(struct acpi_nfit_system_address) != 64); 3835 3835 BUILD_BUG_ON(sizeof(struct acpi_nfit_memory_map) != 48); 3836 3836 BUILD_BUG_ON(sizeof(struct acpi_nfit_interleave) != 20); 3837 3837 BUILD_BUG_ON(sizeof(struct acpi_nfit_smbios) != 9);
+1 -1
drivers/acpi/numa/hmat.c
··· 722 722 /* 723 723 * Skip offline nodes. This can happen when memory 724 724 * marked EFI_MEMORY_SP, "specific purpose", is applied 725 - * to all the memory in a promixity domain leading to 725 + * to all the memory in a proximity domain leading to 726 726 * the node being marked offline / unplugged, or if 727 727 * memory-only "hotplug" node is offline. 728 728 */
+10 -24
drivers/acpi/pci_irq.c
··· 9 9 * Bjorn Helgaas <bjorn.helgaas@hp.com> 10 10 */ 11 11 12 + #define pr_fmt(fmt) "ACPI: PCI: " fmt 12 13 13 14 #include <linux/dmi.h> 14 15 #include <linux/kernel.h> ··· 22 21 #include <linux/acpi.h> 23 22 #include <linux/slab.h> 24 23 #include <linux/interrupt.h> 25 - 26 - #define PREFIX "ACPI: " 27 - 28 - #define _COMPONENT ACPI_PCI_COMPONENT 29 - ACPI_MODULE_NAME("pci_irq"); 30 24 31 25 struct acpi_prt_entry { 32 26 struct acpi_pci_id id; ··· 122 126 entry->pin == quirk->pin && 123 127 !strcmp(prt->source, quirk->source) && 124 128 strlen(prt->source) >= strlen(quirk->actual_source)) { 125 - printk(KERN_WARNING PREFIX "firmware reports " 129 + pr_warn("Firmware reports " 126 130 "%04x:%02x:%02x PCI INT %c connected to %s; " 127 131 "changing to %s\n", 128 132 entry->id.segment, entry->id.bus, ··· 187 191 * the IRQ value, which is hardwired to specific interrupt inputs on 188 192 * the interrupt controller. 189 193 */ 190 - 191 - ACPI_DEBUG_PRINT_RAW((ACPI_DB_INFO, 192 - " %04x:%02x:%02x[%c] -> %s[%d]\n", 193 - entry->id.segment, entry->id.bus, 194 - entry->id.device, pin_name(entry->pin), 195 - prt->source, entry->index)); 194 + pr_debug("%04x:%02x:%02x[%c] -> %s[%d]\n", 195 + entry->id.segment, entry->id.bus, entry->id.device, 196 + pin_name(entry->pin), prt->source, entry->index); 196 197 197 198 *entry_ptr = entry; 198 199 ··· 300 307 #ifdef CONFIG_X86_IO_APIC 301 308 acpi_reroute_boot_interrupt(dev, entry); 302 309 #endif /* CONFIG_X86_IO_APIC */ 303 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found %s[%c] _PRT entry\n", 304 - pci_name(dev), pin_name(pin))); 310 + dev_dbg(&dev->dev, "Found [%c] _PRT entry\n", pin_name(pin)); 305 311 return entry; 306 312 } 307 313 ··· 316 324 /* PC card has the same IRQ as its cardbridge */ 317 325 bridge_pin = bridge->pin; 318 326 if (!bridge_pin) { 319 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 320 - "No interrupt pin configured for device %s\n", 321 - pci_name(bridge))); 327 + dev_dbg(&bridge->dev, "No interrupt pin configured\n"); 322 328 return NULL; 323 329 } 324 330 pin = bridge_pin; ··· 324 334 325 335 ret = acpi_pci_irq_find_prt_entry(bridge, pin, &entry); 326 336 if (!ret && entry) { 327 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 328 - "Derived GSI for %s INT %c from %s\n", 329 - pci_name(dev), pin_name(orig_pin), 330 - pci_name(bridge))); 337 + dev_dbg(&dev->dev, "Derived GSI INT %c from %s\n", 338 + pin_name(orig_pin), pci_name(bridge)); 331 339 return entry; 332 340 } 333 341 ··· 401 413 402 414 pin = dev->pin; 403 415 if (!pin) { 404 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 405 - "No interrupt pin configured for device %s\n", 406 - pci_name(dev))); 416 + dev_dbg(&dev->dev, "No interrupt pin configured\n"); 407 417 return 0; 408 418 } 409 419
+72 -92
drivers/acpi/pci_link.c
··· 12 12 * for IRQ management (e.g. start()->_SRS). 13 13 */ 14 14 15 + #define pr_fmt(fmt) "ACPI: PCI: " fmt 16 + 15 17 #include <linux/syscore_ops.h> 16 18 #include <linux/kernel.h> 17 19 #include <linux/module.h> ··· 29 27 30 28 #include "internal.h" 31 29 32 - #define _COMPONENT ACPI_PCI_COMPONENT 33 - ACPI_MODULE_NAME("pci_link"); 34 30 #define ACPI_PCI_LINK_CLASS "pci_irq_routing" 35 31 #define ACPI_PCI_LINK_DEVICE_NAME "PCI Interrupt Link" 36 32 #define ACPI_PCI_LINK_MAX_POSSIBLE 16 ··· 85 85 void *context) 86 86 { 87 87 struct acpi_pci_link *link = context; 88 + acpi_handle handle = link->device->handle; 88 89 u32 i; 89 90 90 91 switch (resource->type) { ··· 96 95 { 97 96 struct acpi_resource_irq *p = &resource->data.irq; 98 97 if (!p || !p->interrupt_count) { 99 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 100 - "Blank _PRS IRQ resource\n")); 98 + acpi_handle_debug(handle, 99 + "Blank _PRS IRQ resource\n"); 101 100 return AE_OK; 102 101 } 103 102 for (i = 0; 104 103 (i < p->interrupt_count 105 104 && i < ACPI_PCI_LINK_MAX_POSSIBLE); i++) { 106 105 if (!p->interrupts[i]) { 107 - printk(KERN_WARNING PREFIX 108 - "Invalid _PRS IRQ %d\n", 109 - p->interrupts[i]); 106 + acpi_handle_debug(handle, 107 + "Invalid _PRS IRQ %d\n", 108 + p->interrupts[i]); 110 109 continue; 111 110 } 112 111 link->irq.possible[i] = p->interrupts[i]; ··· 122 121 struct acpi_resource_extended_irq *p = 123 122 &resource->data.extended_irq; 124 123 if (!p || !p->interrupt_count) { 125 - printk(KERN_WARNING PREFIX 126 - "Blank _PRS EXT IRQ resource\n"); 124 + acpi_handle_debug(handle, 125 + "Blank _PRS EXT IRQ resource\n"); 127 126 return AE_OK; 128 127 } 129 128 for (i = 0; 130 129 (i < p->interrupt_count 131 130 && i < ACPI_PCI_LINK_MAX_POSSIBLE); i++) { 132 131 if (!p->interrupts[i]) { 133 - printk(KERN_WARNING PREFIX 134 - "Invalid _PRS IRQ %d\n", 135 - p->interrupts[i]); 132 + acpi_handle_debug(handle, 133 + "Invalid _PRS IRQ %d\n", 134 + p->interrupts[i]); 136 135 continue; 137 136 } 138 137 link->irq.possible[i] = p->interrupts[i]; ··· 144 143 break; 145 144 } 146 145 default: 147 - printk(KERN_ERR PREFIX "_PRS resource type 0x%x isn't an IRQ\n", 148 - resource->type); 146 + acpi_handle_debug(handle, "_PRS resource type 0x%x is not IRQ\n", 147 + resource->type); 149 148 return AE_OK; 150 149 } 151 150 ··· 154 153 155 154 static int acpi_pci_link_get_possible(struct acpi_pci_link *link) 156 155 { 156 + acpi_handle handle = link->device->handle; 157 157 acpi_status status; 158 158 159 - status = acpi_walk_resources(link->device->handle, METHOD_NAME__PRS, 159 + status = acpi_walk_resources(handle, METHOD_NAME__PRS, 160 160 acpi_pci_link_check_possible, link); 161 161 if (ACPI_FAILURE(status)) { 162 - acpi_handle_debug(link->device->handle, "_PRS not present or invalid"); 162 + acpi_handle_debug(handle, "_PRS not present or invalid"); 163 163 return 0; 164 164 } 165 165 166 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 167 - "Found %d possible IRQs\n", 168 - link->irq.possible_count)); 166 + acpi_handle_debug(handle, "Found %d possible IRQs\n", 167 + link->irq.possible_count); 169 168 170 169 return 0; 171 170 } ··· 187 186 * IRQ descriptors may have no IRQ# bits set, 188 187 * particularly those those w/ _STA disabled 189 188 */ 190 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 191 - "Blank _CRS IRQ resource\n")); 189 + pr_debug("Blank _CRS IRQ resource\n"); 192 190 return AE_OK; 193 191 } 194 192 *irq = p->interrupts[0]; ··· 202 202 * extended IRQ descriptors must 203 203 * return at least 1 IRQ 204 204 */ 205 - printk(KERN_WARNING PREFIX 206 - "Blank _CRS EXT IRQ resource\n"); 205 + pr_debug("Blank _CRS EXT IRQ resource\n"); 207 206 return AE_OK; 208 207 } 209 208 *irq = p->interrupts[0]; ··· 210 211 } 211 212 break; 212 213 default: 213 - printk(KERN_ERR PREFIX "_CRS resource type 0x%x isn't an IRQ\n", 214 - resource->type); 214 + pr_debug("_CRS resource type 0x%x is not IRQ\n", 215 + resource->type); 215 216 return AE_OK; 216 217 } 217 218 ··· 227 228 */ 228 229 static int acpi_pci_link_get_current(struct acpi_pci_link *link) 229 230 { 230 - int result = 0; 231 + acpi_handle handle = link->device->handle; 231 232 acpi_status status; 233 + int result = 0; 232 234 int irq = 0; 233 235 234 236 link->irq.active = 0; ··· 239 239 /* Query _STA, set link->device->status */ 240 240 result = acpi_bus_get_status(link->device); 241 241 if (result) { 242 - printk(KERN_ERR PREFIX "Unable to read status\n"); 242 + acpi_handle_err(handle, "Unable to read status\n"); 243 243 goto end; 244 244 } 245 245 246 246 if (!link->device->status.enabled) { 247 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Link disabled\n")); 247 + acpi_handle_debug(handle, "Link disabled\n"); 248 248 return 0; 249 249 } 250 250 } ··· 253 253 * Query and parse _CRS to get the current IRQ assignment. 254 254 */ 255 255 256 - status = acpi_walk_resources(link->device->handle, METHOD_NAME__CRS, 256 + status = acpi_walk_resources(handle, METHOD_NAME__CRS, 257 257 acpi_pci_link_check_current, &irq); 258 258 if (ACPI_FAILURE(status)) { 259 - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _CRS")); 259 + acpi_evaluation_failure_warn(handle, "_CRS", status); 260 260 result = -ENODEV; 261 261 goto end; 262 262 } 263 263 264 264 if (acpi_strict && !irq) { 265 - printk(KERN_ERR PREFIX "_CRS returned 0\n"); 265 + acpi_handle_err(handle, "_CRS returned 0\n"); 266 266 result = -ENODEV; 267 267 } 268 268 269 269 link->irq.active = irq; 270 270 271 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Link at IRQ %d \n", link->irq.active)); 271 + acpi_handle_debug(handle, "Link at IRQ %d \n", link->irq.active); 272 272 273 273 end: 274 274 return result; ··· 276 276 277 277 static int acpi_pci_link_set(struct acpi_pci_link *link, int irq) 278 278 { 279 - int result; 280 - acpi_status status; 281 279 struct { 282 280 struct acpi_resource res; 283 281 struct acpi_resource end; 284 282 } *resource; 285 283 struct acpi_buffer buffer = { 0, NULL }; 284 + acpi_handle handle = link->device->handle; 285 + acpi_status status; 286 + int result; 286 287 287 288 if (!irq) 288 289 return -EINVAL; ··· 330 329 /* ignore resource_source, it's optional */ 331 330 break; 332 331 default: 333 - printk(KERN_ERR PREFIX "Invalid Resource_type %d\n", link->irq.resource_type); 332 + acpi_handle_err(handle, "Invalid resource type %d\n", 333 + link->irq.resource_type); 334 334 result = -EINVAL; 335 335 goto end; 336 336 ··· 344 342 345 343 /* check for total failure */ 346 344 if (ACPI_FAILURE(status)) { 347 - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _SRS")); 345 + acpi_evaluation_failure_warn(handle, "_SRS", status); 348 346 result = -ENODEV; 349 347 goto end; 350 348 } ··· 352 350 /* Query _STA, set device->status */ 353 351 result = acpi_bus_get_status(link->device); 354 352 if (result) { 355 - printk(KERN_ERR PREFIX "Unable to read status\n"); 353 + acpi_handle_err(handle, "Unable to read status\n"); 356 354 goto end; 357 355 } 358 - if (!link->device->status.enabled) { 359 - printk(KERN_WARNING PREFIX 360 - "%s [%s] disabled and referenced, BIOS bug\n", 361 - acpi_device_name(link->device), 362 - acpi_device_bid(link->device)); 363 - } 356 + if (!link->device->status.enabled) 357 + acpi_handle_warn(handle, "Disabled and referenced, BIOS bug\n"); 364 358 365 359 /* Query _CRS, set link->irq.active */ 366 360 result = acpi_pci_link_get_current(link); ··· 373 375 * policy: when _CRS doesn't return what we just _SRS 374 376 * assume _SRS worked and override _CRS value. 375 377 */ 376 - printk(KERN_WARNING PREFIX 377 - "%s [%s] BIOS reported IRQ %d, using IRQ %d\n", 378 - acpi_device_name(link->device), 379 - acpi_device_bid(link->device), link->irq.active, irq); 378 + acpi_handle_warn(handle, "BIOS reported IRQ %d, using IRQ %d\n", 379 + link->irq.active, irq); 380 380 link->irq.active = irq; 381 381 } 382 382 383 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Set IRQ %d\n", link->irq.active)); 383 + acpi_handle_debug(handle, "Set IRQ %d\n", link->irq.active); 384 384 385 385 end: 386 386 kfree(resource); ··· 527 531 528 532 static int acpi_pci_link_allocate(struct acpi_pci_link *link) 529 533 { 534 + acpi_handle handle = link->device->handle; 530 535 int irq; 531 536 int i; 532 537 ··· 550 553 */ 551 554 if (i == link->irq.possible_count) { 552 555 if (acpi_strict) 553 - printk(KERN_WARNING PREFIX "_CRS %d not found" 554 - " in _PRS\n", link->irq.active); 556 + acpi_handle_warn(handle, "_CRS %d not found in _PRS\n", 557 + link->irq.active); 555 558 link->irq.active = 0; 556 559 } 557 560 ··· 575 578 } 576 579 } 577 580 if (acpi_irq_get_penalty(irq) >= PIRQ_PENALTY_ISA_ALWAYS) { 578 - printk(KERN_ERR PREFIX "No IRQ available for %s [%s]. " 579 - "Try pci=noacpi or acpi=off\n", 580 - acpi_device_name(link->device), 581 - acpi_device_bid(link->device)); 581 + acpi_handle_err(handle, 582 + "No IRQ available. Try pci=noacpi or acpi=off\n"); 582 583 return -ENODEV; 583 584 } 584 585 585 586 /* Attempt to enable the link device at this IRQ. */ 586 587 if (acpi_pci_link_set(link, irq)) { 587 - printk(KERN_ERR PREFIX "Unable to set IRQ for %s [%s]. " 588 - "Try pci=noacpi or acpi=off\n", 589 - acpi_device_name(link->device), 590 - acpi_device_bid(link->device)); 588 + acpi_handle_err(handle, 589 + "Unable to set IRQ. Try pci=noacpi or acpi=off\n"); 591 590 return -ENODEV; 592 591 } else { 593 592 if (link->irq.active < ACPI_MAX_ISA_IRQS) 594 593 acpi_isa_irq_penalty[link->irq.active] += 595 594 PIRQ_PENALTY_PCI_USING; 596 595 597 - pr_info("%s [%s] enabled at IRQ %d\n", 598 - acpi_device_name(link->device), 599 - acpi_device_bid(link->device), link->irq.active); 596 + acpi_handle_info(handle, "Enabled at IRQ %d\n", 597 + link->irq.active); 600 598 } 601 599 602 600 link->irq.initialized = 1; ··· 612 620 613 621 result = acpi_bus_get_device(handle, &device); 614 622 if (result) { 615 - printk(KERN_ERR PREFIX "Invalid link device\n"); 623 + acpi_handle_err(handle, "Invalid link device\n"); 616 624 return -1; 617 625 } 618 626 619 627 link = acpi_driver_data(device); 620 628 if (!link) { 621 - printk(KERN_ERR PREFIX "Invalid link context\n"); 629 + acpi_handle_err(handle, "Invalid link context\n"); 622 630 return -1; 623 631 } 624 632 625 633 /* TBD: Support multiple index (IRQ) entries per Link Device */ 626 634 if (index) { 627 - printk(KERN_ERR PREFIX "Invalid index %d\n", index); 635 + acpi_handle_err(handle, "Invalid index %d\n", index); 628 636 return -1; 629 637 } 630 638 ··· 636 644 637 645 if (!link->irq.active) { 638 646 mutex_unlock(&acpi_link_lock); 639 - printk(KERN_ERR PREFIX "Link active IRQ is 0!\n"); 647 + acpi_handle_err(handle, "Link active IRQ is 0!\n"); 640 648 return -1; 641 649 } 642 650 link->refcnt++; ··· 648 656 *polarity = link->irq.polarity; 649 657 if (name) 650 658 *name = acpi_device_bid(link->device); 651 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 652 - "Link %s is referenced\n", 653 - acpi_device_bid(link->device))); 659 + acpi_handle_debug(handle, "Link is referenced\n"); 654 660 return link->irq.active; 655 661 } 656 662 ··· 664 674 665 675 result = acpi_bus_get_device(handle, &device); 666 676 if (result) { 667 - printk(KERN_ERR PREFIX "Invalid link device\n"); 677 + acpi_handle_err(handle, "Invalid link device\n"); 668 678 return -1; 669 679 } 670 680 671 681 link = acpi_driver_data(device); 672 682 if (!link) { 673 - printk(KERN_ERR PREFIX "Invalid link context\n"); 683 + acpi_handle_err(handle, "Invalid link context\n"); 674 684 return -1; 675 685 } 676 686 677 687 mutex_lock(&acpi_link_lock); 678 688 if (!link->irq.initialized) { 679 689 mutex_unlock(&acpi_link_lock); 680 - printk(KERN_ERR PREFIX "Link isn't initialized\n"); 690 + acpi_handle_err(handle, "Link isn't initialized\n"); 681 691 return -1; 682 692 } 683 693 #ifdef FUTURE_USE ··· 692 702 */ 693 703 link->refcnt--; 694 704 #endif 695 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 696 - "Link %s is dereferenced\n", 697 - acpi_device_bid(link->device))); 705 + acpi_handle_debug(handle, "Link is dereferenced\n"); 698 706 699 707 if (link->refcnt == 0) 700 708 acpi_evaluate_object(link->device->handle, "_DIS", NULL, NULL); ··· 708 720 static int acpi_pci_link_add(struct acpi_device *device, 709 721 const struct acpi_device_id *not_used) 710 722 { 711 - int result; 723 + acpi_handle handle = device->handle; 712 724 struct acpi_pci_link *link; 725 + int result; 713 726 int i; 714 - int found = 0; 715 727 716 728 link = kzalloc(sizeof(struct acpi_pci_link), GFP_KERNEL); 717 729 if (!link) ··· 730 742 /* query and set link->irq.active */ 731 743 acpi_pci_link_get_current(link); 732 744 733 - printk(KERN_INFO PREFIX "%s [%s] (IRQs", acpi_device_name(device), 734 - acpi_device_bid(device)); 745 + pr_info("Interrupt link %s configured for IRQ %d\n", 746 + acpi_device_bid(device), link->irq.active); 747 + 735 748 for (i = 0; i < link->irq.possible_count; i++) { 736 - if (link->irq.active == link->irq.possible[i]) { 737 - printk(KERN_CONT " *%d", link->irq.possible[i]); 738 - found = 1; 739 - } else 740 - printk(KERN_CONT " %d", link->irq.possible[i]); 749 + if (link->irq.active != link->irq.possible[i]) 750 + acpi_handle_debug(handle, "Possible IRQ %d\n", 751 + link->irq.possible[i]); 741 752 } 742 753 743 - printk(KERN_CONT ")"); 744 - 745 - if (!found) 746 - printk(KERN_CONT " *%d", link->irq.active); 747 - 748 754 if (!link->device->status.enabled) 749 - printk(KERN_CONT ", disabled."); 750 - 751 - printk(KERN_CONT "\n"); 755 + pr_info("Interrupt link %s disabled\n", acpi_device_bid(device)); 752 756 753 757 list_add_tail(&link->list, &acpi_link_list); 754 758 755 759 end: 756 760 /* disable all links -- to be activated on use */ 757 - acpi_evaluate_object(device->handle, "_DIS", NULL, NULL); 761 + acpi_evaluate_object(handle, "_DIS", NULL, NULL); 758 762 mutex_unlock(&acpi_link_lock); 759 763 760 764 if (result)
+1 -1
drivers/acpi/pmic/intel_pmic_chtcrc.c
··· 15 15 /* 16 16 * We have no docs for the CHT Crystal Cove PMIC. The Asus Zenfone-2 kernel 17 17 * code has 2 Crystal Cove regulator drivers, one calls the PMIC a "Crystal 18 - * Cove Plus" PMIC and talks about Cherry Trail, so presuambly that one 18 + * Cove Plus" PMIC and talks about Cherry Trail, so presumably that one 19 19 * could be used to get register info for the regulators if we need to 20 20 * implement regulator support in the future. 21 21 *
+4 -14
drivers/acpi/power.c
··· 925 925 return -ENOMEM; 926 926 927 927 device = &resource->device; 928 - acpi_init_device_object(device, handle, ACPI_BUS_TYPE_POWER, 929 - ACPI_STA_DEFAULT, NULL); 928 + acpi_init_device_object(device, handle, ACPI_BUS_TYPE_POWER); 930 929 mutex_init(&resource->resource_lock); 931 930 INIT_LIST_HEAD(&resource->list_node); 932 931 INIT_LIST_HEAD(&resource->dependents); ··· 934 935 strcpy(acpi_device_class(device), ACPI_POWER_CLASS); 935 936 device->power.state = ACPI_STATE_UNKNOWN; 936 937 937 - /* Evalute the object to get the system level and resource order. */ 938 + /* Evaluate the object to get the system level and resource order. */ 938 939 status = acpi_evaluate_object(handle, NULL, NULL, &buffer); 939 940 if (ACPI_FAILURE(status)) 940 941 goto err; ··· 995 996 996 997 mutex_unlock(&power_resource_list_lock); 997 998 } 999 + #endif 998 1000 999 1001 void acpi_turn_off_unused_power_resources(void) 1000 1002 { ··· 1004 1004 mutex_lock(&power_resource_list_lock); 1005 1005 1006 1006 list_for_each_entry_reverse(resource, &acpi_power_resource_list, list_node) { 1007 - int result, state; 1008 - 1009 1007 mutex_lock(&resource->resource_lock); 1010 1008 1011 - result = acpi_power_get_state(resource->device.handle, &state); 1012 - if (result) { 1013 - mutex_unlock(&resource->resource_lock); 1014 - continue; 1015 - } 1016 - 1017 - if (state == ACPI_POWER_RESOURCE_STATE_ON 1018 - && !resource->ref_count) { 1009 + if (!resource->ref_count) { 1019 1010 dev_info(&resource->device.dev, "Turning OFF\n"); 1020 1011 __acpi_power_off(resource); 1021 1012 } ··· 1016 1025 1017 1026 mutex_unlock(&power_resource_list_lock); 1018 1027 } 1019 - #endif
+1 -5
drivers/acpi/processor_driver.c
··· 28 28 #define ACPI_PROCESSOR_NOTIFY_POWER 0x81 29 29 #define ACPI_PROCESSOR_NOTIFY_THROTTLING 0x82 30 30 31 - #define _COMPONENT ACPI_PROCESSOR_COMPONENT 32 - ACPI_MODULE_NAME("processor_driver"); 33 - 34 31 MODULE_AUTHOR("Paul Diefenbaugh"); 35 32 MODULE_DESCRIPTION("ACPI Processor Driver"); 36 33 MODULE_LICENSE("GPL"); ··· 84 87 dev_name(&device->dev), event, 0); 85 88 break; 86 89 default: 87 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 88 - "Unsupported event [0x%x]\n", event)); 90 + acpi_handle_debug(handle, "Unsupported event [0x%x]\n", event); 89 91 break; 90 92 } 91 93
+17 -21
drivers/acpi/processor_idle.c
··· 32 32 #include <asm/cpu.h> 33 33 #endif 34 34 35 - #define _COMPONENT ACPI_PROCESSOR_COMPONENT 36 - ACPI_MODULE_NAME("processor_idle"); 37 - 38 35 #define ACPI_IDLE_STATE_START (IS_ENABLED(CONFIG_ARCH_HAS_CPU_RELAX) ? 1 : 0) 39 36 40 37 static unsigned int max_cstate __read_mostly = ACPI_PROCESSOR_MAX_POWER; ··· 237 240 * 100 microseconds. 238 241 */ 239 242 if (acpi_gbl_FADT.c2_latency > ACPI_PROCESSOR_MAX_C2_LATENCY) { 240 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 241 - "C2 latency too large [%d]\n", acpi_gbl_FADT.c2_latency)); 243 + acpi_handle_debug(pr->handle, "C2 latency too large [%d]\n", 244 + acpi_gbl_FADT.c2_latency); 242 245 /* invalidate C2 */ 243 246 pr->power.states[ACPI_STATE_C2].address = 0; 244 247 } ··· 248 251 * 1000 microseconds. 249 252 */ 250 253 if (acpi_gbl_FADT.c3_latency > ACPI_PROCESSOR_MAX_C3_LATENCY) { 251 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 252 - "C3 latency too large [%d]\n", acpi_gbl_FADT.c3_latency)); 254 + acpi_handle_debug(pr->handle, "C3 latency too large [%d]\n", 255 + acpi_gbl_FADT.c3_latency); 253 256 /* invalidate C3 */ 254 257 pr->power.states[ACPI_STATE_C3].address = 0; 255 258 } 256 259 257 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 258 - "lvl2[0x%08x] lvl3[0x%08x]\n", 260 + acpi_handle_debug(pr->handle, "lvl2[0x%08x] lvl3[0x%08x]\n", 259 261 pr->power.states[ACPI_STATE_C2].address, 260 - pr->power.states[ACPI_STATE_C3].address)); 262 + pr->power.states[ACPI_STATE_C3].address); 261 263 262 264 snprintf(pr->power.states[ACPI_STATE_C2].desc, 263 265 ACPI_CX_DESC_LEN, "ACPI P_LVL2 IOPORT 0x%x", ··· 321 325 * devices thus we take the conservative approach. 322 326 */ 323 327 else if (errata.piix4.fdma) { 324 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 325 - "C3 not supported on PIIX4 with Type-F DMA\n")); 328 + acpi_handle_debug(pr->handle, 329 + "C3 not supported on PIIX4 with Type-F DMA\n"); 326 330 return; 327 331 } 328 332 ··· 341 345 if (!pr->flags.bm_control) { 342 346 if (pr->flags.has_cst != 1) { 343 347 /* bus mastering control is necessary */ 344 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 345 - "C3 support requires BM control\n")); 348 + acpi_handle_debug(pr->handle, 349 + "C3 support requires BM control\n"); 346 350 return; 347 351 } else { 348 352 /* Here we enter C3 without bus mastering */ 349 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 350 - "C3 support without BM control\n")); 353 + acpi_handle_debug(pr->handle, 354 + "C3 support without BM control\n"); 351 355 } 352 356 } 353 357 } else { ··· 356 360 * supported on when bm_check is not required. 357 361 */ 358 362 if (!(acpi_gbl_FADT.flags & ACPI_FADT_WBINVD)) { 359 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 363 + acpi_handle_debug(pr->handle, 360 364 "Cache invalidation should work properly" 361 - " for C3 to be enabled on SMP systems\n")); 365 + " for C3 to be enabled on SMP systems\n"); 362 366 return; 363 367 } 364 368 } ··· 785 789 dmi_check_system(processor_power_dmi_table); 786 790 max_cstate = acpi_processor_cstate_check(max_cstate); 787 791 if (max_cstate < ACPI_C_STATES_MAX) 788 - pr_notice("ACPI: processor limited to max C-state %d\n", 789 - max_cstate); 792 + pr_notice("processor limited to max C-state %d\n", max_cstate); 793 + 790 794 first_run++; 791 795 792 796 if (nocst) ··· 844 848 845 849 status = acpi_evaluate_object(handle, "_LPI", NULL, &buffer); 846 850 if (ACPI_FAILURE(status)) { 847 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No _LPI, giving up\n")); 851 + acpi_handle_debug(handle, "No _LPI, giving up\n"); 848 852 return -ENODEV; 849 853 } 850 854
+2 -5
drivers/acpi/processor_pdc.c
··· 16 16 17 17 #include "internal.h" 18 18 19 - #define _COMPONENT ACPI_PROCESSOR_COMPONENT 20 - ACPI_MODULE_NAME("processor_pdc"); 21 - 22 19 static bool __init processor_physically_present(acpi_handle handle) 23 20 { 24 21 int cpuid, type; ··· 129 132 status = acpi_evaluate_object(handle, "_PDC", pdc_in, NULL); 130 133 131 134 if (ACPI_FAILURE(status)) 132 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 133 - "Could not evaluate _PDC, using legacy perf. control.\n")); 135 + acpi_handle_debug(handle, 136 + "Could not evaluate _PDC, using legacy perf control\n"); 134 137 135 138 return status; 136 139 }
+24 -26
drivers/acpi/processor_perflib.c
··· 23 23 #define PREFIX "ACPI: " 24 24 25 25 #define ACPI_PROCESSOR_FILE_PERFORMANCE "performance" 26 - #define _COMPONENT ACPI_PROCESSOR_COMPONENT 27 - ACPI_MODULE_NAME("processor_perflib"); 28 26 29 27 static DEFINE_MUTEX(performance_mutex); 30 28 ··· 63 65 * (e.g. 0 = states 0..n; 1 = states 1..n; etc. 64 66 */ 65 67 status = acpi_evaluate_integer(pr->handle, "_PPC", NULL, &ppc); 66 - 67 - if (status != AE_NOT_FOUND) 68 + if (status != AE_NOT_FOUND) { 68 69 acpi_processor_ppc_in_use = true; 69 70 70 - if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { 71 - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PPC")); 72 - return -ENODEV; 71 + if (ACPI_FAILURE(status)) { 72 + acpi_evaluation_failure_warn(pr->handle, "_PPC", status); 73 + return -ENODEV; 74 + } 73 75 } 74 76 75 77 pr_debug("CPU %d: _PPC is %d - frequency %s limited\n", pr->id, ··· 96 98 * acpi_processor_ppc_ost: Notify firmware the _PPC evaluation status 97 99 * @handle: ACPI processor handle 98 100 * @status: the status code of _PPC evaluation 99 - * 0: success. OSPM is now using the performance state specificed. 101 + * 0: success. OSPM is now using the performance state specified. 100 102 * 1: failure. OSPM has not changed the number of P-states in use 101 103 */ 102 104 static void acpi_processor_ppc_ost(acpi_handle handle, int status) ··· 197 199 198 200 status = acpi_evaluate_object(pr->handle, "_PCT", NULL, &buffer); 199 201 if (ACPI_FAILURE(status)) { 200 - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PCT")); 202 + acpi_evaluation_failure_warn(pr->handle, "_PCT", status); 201 203 return -ENODEV; 202 204 } 203 205 ··· 297 299 298 300 status = acpi_evaluate_object(pr->handle, "_PSS", NULL, &buffer); 299 301 if (ACPI_FAILURE(status)) { 300 - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PSS")); 302 + acpi_evaluation_failure_warn(pr->handle, "_PSS", status); 301 303 return -ENODEV; 302 304 } 303 305 ··· 308 310 goto end; 309 311 } 310 312 311 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found %d performance states\n", 312 - pss->package.count)); 313 + acpi_handle_debug(pr->handle, "Found %d performance states\n", 314 + pss->package.count); 313 315 314 316 pr->performance->state_count = pss->package.count; 315 317 pr->performance->states = ··· 328 330 state.length = sizeof(struct acpi_processor_px); 329 331 state.pointer = px; 330 332 331 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Extracting state %d\n", i)); 333 + acpi_handle_debug(pr->handle, "Extracting state %d\n", i); 332 334 333 335 status = acpi_extract_package(&(pss->package.elements[i]), 334 336 &format, &state); 335 337 if (ACPI_FAILURE(status)) { 336 - ACPI_EXCEPTION((AE_INFO, status, "Invalid _PSS data")); 338 + acpi_handle_warn(pr->handle, "Invalid _PSS data: %s\n", 339 + acpi_format_exception(status)); 337 340 result = -EFAULT; 338 341 kfree(pr->performance->states); 339 342 goto end; ··· 342 343 343 344 amd_fixup_frequency(px, i); 344 345 345 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 346 + acpi_handle_debug(pr->handle, 346 347 "State [%d]: core_frequency[%d] power[%d] transition_latency[%d] bus_master_latency[%d] control[0x%x] status[0x%x]\n", 347 348 i, 348 349 (u32) px->core_frequency, 349 350 (u32) px->power, 350 351 (u32) px->transition_latency, 351 352 (u32) px->bus_master_latency, 352 - (u32) px->control, (u32) px->status)); 353 + (u32) px->control, (u32) px->status); 353 354 354 355 /* 355 356 * Check that ACPI's u64 MHz will be valid as u32 KHz in cpufreq ··· 399 400 return -EINVAL; 400 401 401 402 if (!acpi_has_method(pr->handle, "_PCT")) { 402 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 403 - "ACPI-based processor performance control unavailable\n")); 403 + acpi_handle_debug(pr->handle, 404 + "ACPI-based processor performance control unavailable\n"); 404 405 return -ENODEV; 405 406 } 406 407 ··· 441 442 if (!acpi_gbl_FADT.smi_command || !acpi_gbl_FADT.pstate_control) 442 443 return 0; 443 444 444 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 445 - "Writing pstate_control [0x%x] to smi_command [0x%x]\n", 446 - acpi_gbl_FADT.pstate_control, acpi_gbl_FADT.smi_command)); 445 + pr_debug("Writing pstate_control [0x%x] to smi_command [0x%x]\n", 446 + acpi_gbl_FADT.pstate_control, acpi_gbl_FADT.smi_command); 447 447 448 448 status = acpi_os_write_port(acpi_gbl_FADT.smi_command, 449 449 (u32)acpi_gbl_FADT.pstate_control, 8); 450 450 if (ACPI_SUCCESS(status)) 451 451 return 1; 452 452 453 - ACPI_EXCEPTION((AE_INFO, status, 454 - "Failed to write pstate_control [0x%x] to smi_command [0x%x]", 455 - acpi_gbl_FADT.pstate_control, acpi_gbl_FADT.smi_command)); 453 + pr_warn("Failed to write pstate_control [0x%x] to smi_command [0x%x]: %s\n", 454 + acpi_gbl_FADT.pstate_control, acpi_gbl_FADT.smi_command, 455 + acpi_format_exception(status)); 456 456 return -EIO; 457 457 } 458 458 459 459 int acpi_processor_notify_smm(struct module *calling_module) 460 460 { 461 - static int is_done = 0; 461 + static int is_done; 462 462 int result; 463 463 464 464 if (!acpi_processor_cpufreq_init) ··· 483 485 484 486 result = acpi_processor_pstate_control(); 485 487 if (!result) { 486 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No SMI port or pstate_control\n")); 488 + pr_debug("No SMI port or pstate_control\n"); 487 489 module_put(calling_module); 488 490 return 0; 489 491 }
+49 -53
drivers/acpi/processor_throttling.c
··· 22 22 23 23 #define PREFIX "ACPI: " 24 24 25 - #define _COMPONENT ACPI_PROCESSOR_COMPONENT 26 - ACPI_MODULE_NAME("processor_throttling"); 27 - 28 25 /* ignore_tpc: 29 26 * 0 -> acpi processor driver doesn't ignore _TPC values 30 27 * 1 -> acpi processor driver ignores _TPC values ··· 193 196 */ 194 197 void acpi_processor_throttling_init(void) 195 198 { 196 - if (acpi_processor_update_tsd_coord()) { 197 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 198 - "Assume no T-state coordination\n")); 199 - } 199 + if (acpi_processor_update_tsd_coord()) 200 + pr_debug("Assume no T-state coordination\n"); 200 201 201 202 return; 202 203 } ··· 211 216 cpu = p_tstate->cpu; 212 217 pr = per_cpu(processors, cpu); 213 218 if (!pr) { 214 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Invalid pr pointer\n")); 219 + pr_debug("Invalid pr pointer\n"); 215 220 return 0; 216 221 } 217 222 if (!pr->flags.throttling) { 218 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Throttling control is " 219 - "unsupported on CPU %d\n", cpu)); 223 + acpi_handle_debug(pr->handle, 224 + "Throttling control unsupported on CPU %d\n", 225 + cpu); 220 226 return 0; 221 227 } 222 228 target_state = p_tstate->target_state; ··· 241 245 target_state = p_throttling->state_count - 1; 242 246 } 243 247 p_tstate->target_state = target_state; 244 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "PreChange Event:" 245 - "target T-state of CPU %d is T%d\n", 246 - cpu, target_state)); 248 + acpi_handle_debug(pr->handle, 249 + "PreChange Event: target T-state of CPU %d is T%d\n", 250 + cpu, target_state); 247 251 break; 248 252 case THROTTLING_POSTCHANGE: 249 253 /* ··· 251 255 * T-state flag of acpi_processor_throttling. 252 256 */ 253 257 p_throttling->state = target_state; 254 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "PostChange Event:" 255 - "CPU %d is switched to T%d\n", 256 - cpu, target_state)); 258 + acpi_handle_debug(pr->handle, 259 + "PostChange Event: CPU %d is switched to T%d\n", 260 + cpu, target_state); 257 261 break; 258 262 default: 259 263 printk(KERN_WARNING ··· 280 284 281 285 status = acpi_evaluate_integer(pr->handle, "_TPC", NULL, &tpc); 282 286 if (ACPI_FAILURE(status)) { 283 - if (status != AE_NOT_FOUND) { 284 - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _TPC")); 285 - } 287 + if (status != AE_NOT_FOUND) 288 + acpi_evaluation_failure_warn(pr->handle, "_TPC", status); 289 + 286 290 return -ENODEV; 287 291 } 288 292 ··· 413 417 414 418 status = acpi_evaluate_object(pr->handle, "_PTC", NULL, &buffer); 415 419 if (ACPI_FAILURE(status)) { 416 - if (status != AE_NOT_FOUND) { 417 - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PTC")); 418 - } 420 + if (status != AE_NOT_FOUND) 421 + acpi_evaluation_failure_warn(pr->handle, "_PTC", status); 422 + 419 423 return -ENODEV; 420 424 } 421 425 ··· 498 502 499 503 status = acpi_evaluate_object(pr->handle, "_TSS", NULL, &buffer); 500 504 if (ACPI_FAILURE(status)) { 501 - if (status != AE_NOT_FOUND) { 502 - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _TSS")); 503 - } 505 + if (status != AE_NOT_FOUND) 506 + acpi_evaluation_failure_warn(pr->handle, "_TSS", status); 507 + 504 508 return -ENODEV; 505 509 } 506 510 ··· 511 515 goto end; 512 516 } 513 517 514 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found %d throttling states\n", 515 - tss->package.count)); 518 + acpi_handle_debug(pr->handle, "Found %d throttling states\n", 519 + tss->package.count); 516 520 517 521 pr->throttling.state_count = tss->package.count; 518 522 pr->throttling.states_tss = ··· 533 537 state.length = sizeof(struct acpi_processor_tx_tss); 534 538 state.pointer = tx; 535 539 536 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Extracting state %d\n", i)); 540 + acpi_handle_debug(pr->handle, "Extracting state %d\n", i); 537 541 538 542 status = acpi_extract_package(&(tss->package.elements[i]), 539 543 &format, &state); 540 544 if (ACPI_FAILURE(status)) { 541 - ACPI_EXCEPTION((AE_INFO, status, "Invalid _TSS data")); 545 + acpi_handle_warn(pr->handle, "Invalid _TSS data: %s\n", 546 + acpi_format_exception(status)); 542 547 result = -EFAULT; 543 548 kfree(pr->throttling.states_tss); 544 549 goto end; ··· 579 582 580 583 status = acpi_evaluate_object(pr->handle, "_TSD", NULL, &buffer); 581 584 if (ACPI_FAILURE(status)) { 582 - if (status != AE_NOT_FOUND) { 583 - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _TSD")); 584 - } 585 + if (status != AE_NOT_FOUND) 586 + acpi_evaluation_failure_warn(pr->handle, "_TSD", status); 587 + 585 588 return -ENODEV; 586 589 } 587 590 ··· 695 698 696 699 local_irq_enable(); 697 700 698 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 701 + acpi_handle_debug(pr->handle, 699 702 "Throttling state is T%d (%d%% throttling applied)\n", 700 - state, pr->throttling.states[state].performance)); 703 + state, pr->throttling.states[state].performance); 701 704 702 705 return 0; 703 706 } ··· 872 875 if (ret >= 0) { 873 876 state = acpi_get_throttling_state(pr, value); 874 877 if (state == -1) { 875 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 876 - "Invalid throttling state, reset\n")); 878 + acpi_handle_debug(pr->handle, 879 + "Invalid throttling state, reset\n"); 877 880 state = 0; 878 881 ret = __acpi_processor_set_throttling(pr, state, true, 879 882 true); ··· 918 921 int i, step; 919 922 920 923 if (!pr->throttling.address) { 921 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No throttling register\n")); 924 + acpi_handle_debug(pr->handle, "No throttling register\n"); 922 925 return -EINVAL; 923 926 } else if (!pr->throttling.duty_width) { 924 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No throttling states\n")); 927 + acpi_handle_debug(pr->handle, "No throttling states\n"); 925 928 return -EINVAL; 926 929 } 927 930 /* TBD: Support duty_cycle values that span bit 4. */ ··· 1012 1015 1013 1016 local_irq_enable(); 1014 1017 1015 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 1018 + acpi_handle_debug(pr->handle, 1016 1019 "Throttling state set to T%d (%d%%)\n", state, 1017 1020 (pr->throttling.states[state].performance ? pr-> 1018 - throttling.states[state].performance / 10 : 0))); 1021 + throttling.states[state].performance / 10 : 0)); 1019 1022 1020 1023 return 0; 1021 1024 } ··· 1126 1129 * error message and continue. 1127 1130 */ 1128 1131 if (!match_pr) { 1129 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 1130 - "Invalid Pointer for CPU %d\n", i)); 1132 + acpi_handle_debug(pr->handle, 1133 + "Invalid Pointer for CPU %d\n", i); 1131 1134 continue; 1132 1135 } 1133 1136 /* ··· 1135 1138 * we will report the error message and continue. 1136 1139 */ 1137 1140 if (!match_pr->flags.throttling) { 1138 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 1139 - "Throttling Control is unsupported " 1140 - "on CPU %d\n", i)); 1141 + acpi_handle_debug(pr->handle, 1142 + "Throttling Control unsupported on CPU %d\n", i); 1141 1143 continue; 1142 1144 } 1143 1145 ··· 1173 1177 int result = 0; 1174 1178 struct acpi_processor_throttling *pthrottling; 1175 1179 1176 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 1180 + acpi_handle_debug(pr->handle, 1177 1181 "pblk_address[0x%08x] duty_offset[%d] duty_width[%d]\n", 1178 1182 pr->throttling.address, 1179 1183 pr->throttling.duty_offset, 1180 - pr->throttling.duty_width)); 1184 + pr->throttling.duty_width); 1181 1185 1182 1186 /* 1183 1187 * Evaluate _PTC, _TSS and _TPC ··· 1217 1221 * used this part. 1218 1222 */ 1219 1223 if (errata.piix4.throttle) { 1220 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 1221 - "Throttling not supported on PIIX4 A- or B-step\n")); 1224 + acpi_handle_debug(pr->handle, 1225 + "Throttling not supported on PIIX4 A- or B-step\n"); 1222 1226 return 0; 1223 1227 } 1224 1228 1225 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found %d throttling states\n", 1226 - pr->throttling.state_count)); 1229 + acpi_handle_debug(pr->handle, "Found %d throttling states\n", 1230 + pr->throttling.state_count); 1227 1231 1228 1232 pr->flags.throttling = 1; 1229 1233 ··· 1238 1242 goto end; 1239 1243 1240 1244 if (pr->throttling.state) { 1241 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 1245 + acpi_handle_debug(pr->handle, 1242 1246 "Disabling throttling (was T%d)\n", 1243 - pr->throttling.state)); 1247 + pr->throttling.state); 1244 1248 result = acpi_processor_set_throttling(pr, 0, false); 1245 1249 if (result) 1246 1250 goto end;
+1 -1
drivers/acpi/resource.c
··· 596 596 * @preproc_data: Pointer passed to the caller's preprocessing routine. 597 597 * 598 598 * Evaluate the _CRS method for the given device node and process its output by 599 - * (1) executing the @preproc() rountine provided by the caller, passing the 599 + * (1) executing the @preproc() routine provided by the caller, passing the 600 600 * resource pointer and @preproc_data to it as arguments, for each ACPI resource 601 601 * returned and (2) converting all of the returned ACPI resources into struct 602 602 * resource objects if possible. If the return value of @preproc() in step (1)
+74 -106
drivers/acpi/scan.c
··· 530 530 * used by the device. 531 531 */ 532 532 acpi_power_transition(adev, ACPI_STATE_D3_COLD); 533 - put_device(&adev->dev); 533 + acpi_dev_put(adev); 534 534 } 535 535 } 536 536 ··· 560 560 * prevents attempts to register device objects identical to those being 561 561 * deleted from happening concurrently (such attempts result from 562 562 * hotplug events handled via the ACPI hotplug workqueue). It also will 563 - * run after all of the work items submitted previosuly, which helps 563 + * run after all of the work items submitted previously, which helps 564 564 * those work items to ensure that they are not accessing stale device 565 565 * objects. 566 566 */ ··· 604 604 605 605 static void get_acpi_device(void *dev) 606 606 { 607 - if (dev) 608 - get_device(&((struct acpi_device *)dev)->dev); 607 + acpi_dev_get(dev); 609 608 } 610 609 611 610 struct acpi_device *acpi_bus_get_acpi_device(acpi_handle handle) ··· 614 615 615 616 void acpi_bus_put_acpi_device(struct acpi_device *adev) 616 617 { 617 - put_device(&adev->dev); 618 + acpi_dev_put(adev); 618 619 } 619 620 620 621 static struct acpi_device_bus_id *acpi_device_bus_id_match(const char *dev_id) ··· 756 757 const char * const ids[]) 757 758 { 758 759 struct acpi_pnp_device_id_list *cid_list = NULL; 759 - int i; 760 + int i, index; 760 761 761 762 if (!(info->valid & ACPI_VALID_HID)) 762 763 return false; 763 764 765 + index = match_string(ids, -1, info->hardware_id.string); 766 + if (index >= 0) 767 + return true; 768 + 764 769 if (info->valid & ACPI_VALID_CID) 765 770 cid_list = &info->compatible_id_list; 766 771 767 - for (i = 0; ids[i]; i++) { 768 - int j; 772 + if (!cid_list) 773 + return false; 769 774 770 - if (!strcmp(info->hardware_id.string, ids[i])) 775 + for (i = 0; i < cid_list->count; i++) { 776 + index = match_string(ids, -1, cid_list->ids[i].string); 777 + if (index >= 0) 771 778 return true; 772 - 773 - if (!cid_list) 774 - continue; 775 - 776 - for (j = 0; j < cid_list->count; j++) { 777 - if (!strcmp(cid_list->ids[j].string, ids[i])) 778 - return true; 779 - } 780 779 } 781 780 782 781 return false; ··· 1304 1307 } 1305 1308 1306 1309 static void acpi_set_pnp_ids(acpi_handle handle, struct acpi_device_pnp *pnp, 1307 - int device_type, struct acpi_device_info *info) 1310 + int device_type) 1308 1311 { 1312 + struct acpi_device_info *info = NULL; 1309 1313 struct acpi_pnp_device_id_list *cid_list; 1310 1314 int i; 1311 1315 ··· 1317 1319 break; 1318 1320 } 1319 1321 1322 + acpi_get_object_info(handle, &info); 1320 1323 if (!info) { 1321 1324 pr_err(PREFIX "%s: Error reading device info\n", 1322 1325 __func__); ··· 1342 1343 GFP_KERNEL); 1343 1344 if (info->valid & ACPI_VALID_CLS) 1344 1345 acpi_add_id(pnp, info->class_code.string); 1346 + 1347 + kfree(info); 1345 1348 1346 1349 /* 1347 1350 * Some devices don't reliably have _HIDs & _CIDs, so add ··· 1650 1649 } 1651 1650 1652 1651 void acpi_init_device_object(struct acpi_device *device, acpi_handle handle, 1653 - int type, unsigned long long sta, 1654 - struct acpi_device_info *info) 1652 + int type) 1655 1653 { 1656 1654 INIT_LIST_HEAD(&device->pnp.ids); 1657 1655 device->device_type = type; 1658 1656 device->handle = handle; 1659 1657 device->parent = acpi_bus_get_parent(handle); 1660 1658 fwnode_init(&device->fwnode, &acpi_device_fwnode_ops); 1661 - acpi_set_device_status(device, sta); 1659 + acpi_set_device_status(device, ACPI_STA_DEFAULT); 1662 1660 acpi_device_get_busid(device); 1663 - acpi_set_pnp_ids(handle, &device->pnp, type, info); 1661 + acpi_set_pnp_ids(handle, &device->pnp, type); 1664 1662 acpi_init_properties(device); 1665 1663 acpi_bus_get_flags(device); 1666 1664 device->flags.match_driver = false; ··· 1680 1680 kobject_uevent(&device->dev.kobj, KOBJ_ADD); 1681 1681 } 1682 1682 1683 - static int acpi_add_single_object(struct acpi_device **child, 1684 - acpi_handle handle, int type, 1685 - unsigned long long sta) 1683 + static void acpi_scan_init_status(struct acpi_device *adev) 1686 1684 { 1687 - struct acpi_device_info *info = NULL; 1685 + if (acpi_bus_get_status(adev)) 1686 + acpi_set_device_status(adev, 0); 1687 + } 1688 + 1689 + static int acpi_add_single_object(struct acpi_device **child, 1690 + acpi_handle handle, int type) 1691 + { 1688 1692 struct acpi_device *device; 1689 1693 int result; 1690 1694 1691 - if (handle != ACPI_ROOT_OBJECT && type == ACPI_BUS_TYPE_DEVICE) 1692 - acpi_get_object_info(handle, &info); 1693 - 1694 1695 device = kzalloc(sizeof(struct acpi_device), GFP_KERNEL); 1695 - if (!device) { 1696 - kfree(info); 1696 + if (!device) 1697 1697 return -ENOMEM; 1698 - } 1699 1698 1700 - acpi_init_device_object(device, handle, type, sta, info); 1701 - kfree(info); 1699 + acpi_init_device_object(device, handle, type); 1702 1700 /* 1703 - * For ACPI_BUS_TYPE_DEVICE getting the status is delayed till here so 1704 - * that we can call acpi_bus_get_status() and use its quirk handling. 1705 - * Note this must be done before the get power-/wakeup_dev-flags calls. 1701 + * Getting the status is delayed till here so that we can call 1702 + * acpi_bus_get_status() and use its quirk handling. Note that 1703 + * this must be done before the get power-/wakeup_dev-flags calls. 1706 1704 */ 1707 - if (type == ACPI_BUS_TYPE_DEVICE) 1708 - if (acpi_bus_get_status(device) < 0) 1709 - acpi_set_device_status(device, 0); 1705 + if (type == ACPI_BUS_TYPE_DEVICE || type == ACPI_BUS_TYPE_PROCESSOR) 1706 + acpi_scan_init_status(device); 1710 1707 1711 1708 acpi_bus_get_power_flags(device); 1712 1709 acpi_bus_get_wakeup_device_flags(device); ··· 1758 1761 &res.start); 1759 1762 1760 1763 return true; 1761 - } 1762 - 1763 - static int acpi_bus_type_and_status(acpi_handle handle, int *type, 1764 - unsigned long long *sta) 1765 - { 1766 - acpi_status status; 1767 - acpi_object_type acpi_type; 1768 - 1769 - status = acpi_get_type(handle, &acpi_type); 1770 - if (ACPI_FAILURE(status)) 1771 - return -ENODEV; 1772 - 1773 - switch (acpi_type) { 1774 - case ACPI_TYPE_ANY: /* for ACPI_ROOT_OBJECT */ 1775 - case ACPI_TYPE_DEVICE: 1776 - if (acpi_device_should_be_hidden(handle)) 1777 - return -ENODEV; 1778 - 1779 - *type = ACPI_BUS_TYPE_DEVICE; 1780 - /* 1781 - * acpi_add_single_object updates this once we've an acpi_device 1782 - * so that acpi_bus_get_status' quirk handling can be used. 1783 - */ 1784 - *sta = ACPI_STA_DEFAULT; 1785 - break; 1786 - case ACPI_TYPE_PROCESSOR: 1787 - *type = ACPI_BUS_TYPE_PROCESSOR; 1788 - status = acpi_bus_get_status_handle(handle, sta); 1789 - if (ACPI_FAILURE(status)) 1790 - return -ENODEV; 1791 - break; 1792 - case ACPI_TYPE_THERMAL: 1793 - *type = ACPI_BUS_TYPE_THERMAL; 1794 - *sta = ACPI_STA_DEFAULT; 1795 - break; 1796 - case ACPI_TYPE_POWER: 1797 - *type = ACPI_BUS_TYPE_POWER; 1798 - *sta = ACPI_STA_DEFAULT; 1799 - break; 1800 - default: 1801 - return -ENODEV; 1802 - } 1803 - 1804 - return 0; 1805 1764 } 1806 1765 1807 1766 bool acpi_device_is_present(const struct acpi_device *adev) ··· 1828 1875 } 1829 1876 } 1830 1877 1831 - static u32 acpi_scan_check_dep(acpi_handle handle) 1878 + static u32 acpi_scan_check_dep(acpi_handle handle, bool check_dep) 1832 1879 { 1833 1880 struct acpi_handle_list dep_devices; 1834 1881 acpi_status status; ··· 1841 1888 * 2. ACPI nodes describing USB ports. 1842 1889 * Still, checking for _HID catches more then just these cases ... 1843 1890 */ 1844 - if (!acpi_has_method(handle, "_DEP") || !acpi_has_method(handle, "_HID")) 1891 + if (!check_dep || !acpi_has_method(handle, "_DEP") || 1892 + !acpi_has_method(handle, "_HID")) 1845 1893 return 0; 1846 1894 1847 1895 status = acpi_evaluate_reference(handle, "_DEP", NULL, &dep_devices); ··· 1907 1953 struct acpi_device **adev_p) 1908 1954 { 1909 1955 struct acpi_device *device = NULL; 1910 - unsigned long long sta; 1956 + acpi_object_type acpi_type; 1911 1957 int type; 1912 - int result; 1913 1958 1914 1959 acpi_bus_get_device(handle, &device); 1915 1960 if (device) 1916 1961 goto out; 1917 1962 1918 - result = acpi_bus_type_and_status(handle, &type, &sta); 1919 - if (result) 1963 + if (ACPI_FAILURE(acpi_get_type(handle, &acpi_type))) 1920 1964 return AE_OK; 1921 1965 1922 - if (type == ACPI_BUS_TYPE_POWER) { 1923 - acpi_add_power_resource(handle); 1924 - return AE_OK; 1925 - } 1966 + switch (acpi_type) { 1967 + case ACPI_TYPE_DEVICE: 1968 + if (acpi_device_should_be_hidden(handle)) 1969 + return AE_OK; 1926 1970 1927 - if (type == ACPI_BUS_TYPE_DEVICE && check_dep) { 1928 - u32 count = acpi_scan_check_dep(handle); 1929 - /* Bail out if the number of recorded dependencies is not 0. */ 1930 - if (count > 0) { 1971 + /* Bail out if there are dependencies. */ 1972 + if (acpi_scan_check_dep(handle, check_dep) > 0) { 1931 1973 acpi_bus_scan_second_pass = true; 1932 1974 return AE_CTRL_DEPTH; 1933 1975 } 1976 + 1977 + fallthrough; 1978 + case ACPI_TYPE_ANY: /* for ACPI_ROOT_OBJECT */ 1979 + type = ACPI_BUS_TYPE_DEVICE; 1980 + break; 1981 + 1982 + case ACPI_TYPE_PROCESSOR: 1983 + type = ACPI_BUS_TYPE_PROCESSOR; 1984 + break; 1985 + 1986 + case ACPI_TYPE_THERMAL: 1987 + type = ACPI_BUS_TYPE_THERMAL; 1988 + break; 1989 + 1990 + case ACPI_TYPE_POWER: 1991 + acpi_add_power_resource(handle); 1992 + fallthrough; 1993 + default: 1994 + return AE_OK; 1934 1995 } 1935 1996 1936 - acpi_add_single_object(&device, handle, type, sta); 1997 + acpi_add_single_object(&device, handle, type); 1937 1998 if (!device) 1938 1999 return AE_CTRL_DEPTH; 1939 2000 ··· 2222 2253 struct acpi_device *device = NULL; 2223 2254 int result; 2224 2255 2225 - result = acpi_add_single_object(&device, NULL, 2226 - type, ACPI_STA_DEFAULT); 2256 + result = acpi_add_single_object(&device, NULL, type); 2227 2257 if (result) 2228 2258 return result; 2229 2259 ··· 2242 2274 struct acpi_device *device = NULL; 2243 2275 2244 2276 result = acpi_add_single_object(&device, NULL, 2245 - ACPI_BUS_TYPE_POWER_BUTTON, 2246 - ACPI_STA_DEFAULT); 2277 + ACPI_BUS_TYPE_POWER_BUTTON); 2247 2278 if (result) 2248 2279 return result; 2249 2280 ··· 2258 2291 struct acpi_device *device = NULL; 2259 2292 2260 2293 result = acpi_add_single_object(&device, NULL, 2261 - ACPI_BUS_TYPE_SLEEP_BUTTON, 2262 - ACPI_STA_DEFAULT); 2294 + ACPI_BUS_TYPE_SLEEP_BUTTON); 2263 2295 if (result) 2264 2296 return result; 2265 2297 ··· 2354 2388 acpi_detach_data(acpi_root->handle, 2355 2389 acpi_scan_drop_device); 2356 2390 acpi_device_del(acpi_root); 2357 - put_device(&acpi_root->dev); 2391 + acpi_bus_put_acpi_device(acpi_root); 2358 2392 goto out; 2359 2393 } 2360 2394 } 2395 + 2396 + acpi_turn_off_unused_power_resources(); 2361 2397 2362 2398 acpi_scan_initialized = true; 2363 2399
-1
drivers/acpi/sleep.h
··· 8 8 extern struct mutex acpi_device_lock; 9 9 10 10 extern void acpi_resume_power_resources(void); 11 - extern void acpi_turn_off_unused_power_resources(void); 12 11 13 12 static inline acpi_status acpi_set_waking_vector(u32 wakeup_address) 14 13 {
+1 -13
drivers/acpi/sysfs.c
··· 12 12 13 13 #include "internal.h" 14 14 15 - #define _COMPONENT ACPI_SYSTEM_COMPONENT 16 - ACPI_MODULE_NAME("sysfs"); 17 - 18 15 #ifdef CONFIG_ACPI_DEBUG 19 16 /* 20 17 * ACPI debug sysfs I/F, including: ··· 48 51 ACPI_DEBUG_INIT(ACPI_CA_DISASSEMBLER), 49 52 ACPI_DEBUG_INIT(ACPI_COMPILER), 50 53 ACPI_DEBUG_INIT(ACPI_TOOLS), 51 - 52 - ACPI_DEBUG_INIT(ACPI_SBS_COMPONENT), 53 - ACPI_DEBUG_INIT(ACPI_FAN_COMPONENT), 54 - ACPI_DEBUG_INIT(ACPI_PCI_COMPONENT), 55 - ACPI_DEBUG_INIT(ACPI_CONTAINER_COMPONENT), 56 - ACPI_DEBUG_INIT(ACPI_SYSTEM_COMPONENT), 57 - ACPI_DEBUG_INIT(ACPI_MEMORY_DEVICE_COMPONENT), 58 - ACPI_DEBUG_INIT(ACPI_PROCESSOR_COMPONENT), 59 54 }; 60 55 61 56 static const struct acpi_dlevel acpi_debug_levels[] = { ··· 641 652 if (index < num_gpes) { 642 653 status = acpi_get_gpe_device(index, handle); 643 654 if (ACPI_FAILURE(status)) { 644 - ACPI_EXCEPTION((AE_INFO, AE_NOT_FOUND, 645 - "Invalid GPE 0x%x", index)); 655 + pr_warn("Invalid GPE 0x%x", index); 646 656 return -ENXIO; 647 657 } 648 658 status = acpi_get_gpe_status(*handle, index, ret);
+33 -4
drivers/acpi/utils.c
··· 512 512 #endif 513 513 514 514 /** 515 + * acpi_evaluation_failure_warn - Log evaluation failure warning. 516 + * @handle: Parent object handle. 517 + * @name: Name of the object whose evaluation has failed. 518 + * @status: Status value returned by the failing object evaluation. 519 + */ 520 + void acpi_evaluation_failure_warn(acpi_handle handle, const char *name, 521 + acpi_status status) 522 + { 523 + acpi_handle_warn(handle, "%s evaluation failed: %s\n", name, 524 + acpi_format_exception(status)); 525 + } 526 + EXPORT_SYMBOL_GPL(acpi_evaluation_failure_warn); 527 + 528 + /** 515 529 * acpi_has_method: Check whether @handle has a method named @name 516 530 * @handle: ACPI device handle 517 531 * @name: name of object or method ··· 811 797 * Note that if the device is pluggable, it may since have disappeared. 812 798 * 813 799 * Note that unlike acpi_dev_found() this function checks the status 814 - * of the device. So for devices which are present in the dsdt, but 800 + * of the device. So for devices which are present in the DSDT, but 815 801 * which are disabled (their _STA callback returns 0) this function 816 802 * will return false. 817 803 * ··· 838 824 839 825 /** 840 826 * acpi_dev_get_next_match_dev - Return the next match of ACPI device 841 - * @adev: Pointer to the previous acpi_device matching this @hid, @uid and @hrv 827 + * @adev: Pointer to the previous ACPI device matching this @hid, @uid and @hrv 842 828 * @hid: Hardware ID of the device. 843 829 * @uid: Unique ID of the device, pass NULL to not check _UID 844 830 * @hrv: Hardware Revision of the device, pass -1 to not check _HRV ··· 846 832 * Return the next match of ACPI device if another matching device was present 847 833 * at the moment of invocation, or NULL otherwise. 848 834 * 849 - * The caller is responsible to call put_device() on the returned device. 835 + * FIXME: The function does not tolerate the sudden disappearance of @adev, e.g. 836 + * in the case of a hotplug event. That said, the caller should ensure that 837 + * this will never happen. 838 + * 839 + * The caller is responsible for invoking acpi_dev_put() on the returned device. 850 840 * 851 841 * See additional information in acpi_dev_present() as well. 852 842 */ ··· 879 861 * Return the first match of ACPI device if a matching device was present 880 862 * at the moment of invocation, or NULL otherwise. 881 863 * 882 - * The caller is responsible to call put_device() on the returned device. 864 + * The caller is responsible for invoking acpi_dev_put() on the returned device. 883 865 * 884 866 * See additional information in acpi_dev_present() as well. 885 867 */ ··· 889 871 return acpi_dev_get_next_match_dev(NULL, hid, uid, hrv); 890 872 } 891 873 EXPORT_SYMBOL(acpi_dev_get_first_match_dev); 874 + 875 + /** 876 + * acpi_reduced_hardware - Return if this is an ACPI-reduced-hw machine 877 + * 878 + * Return true when running on an ACPI-reduced-hw machine, false otherwise. 879 + */ 880 + bool acpi_reduced_hardware(void) 881 + { 882 + return acpi_gbl_reduced_hardware; 883 + } 884 + EXPORT_SYMBOL_GPL(acpi_reduced_hardware); 892 885 893 886 /* 894 887 * acpi_backlight= handling, this is done here rather then in video_detect.c
+24
drivers/acpi/video_detect.c
··· 385 385 DMI_MATCH(DMI_BOARD_NAME, "BA51_MV"), 386 386 }, 387 387 }, 388 + { 389 + .callback = video_detect_force_native, 390 + .ident = "ASUSTeK COMPUTER INC. GA401", 391 + .matches = { 392 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 393 + DMI_MATCH(DMI_PRODUCT_NAME, "GA401"), 394 + }, 395 + }, 396 + { 397 + .callback = video_detect_force_native, 398 + .ident = "ASUSTeK COMPUTER INC. GA502", 399 + .matches = { 400 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 401 + DMI_MATCH(DMI_PRODUCT_NAME, "GA502"), 402 + }, 403 + }, 404 + { 405 + .callback = video_detect_force_native, 406 + .ident = "ASUSTeK COMPUTER INC. GA503", 407 + .matches = { 408 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 409 + DMI_MATCH(DMI_PRODUCT_NAME, "GA503"), 410 + }, 411 + }, 388 412 389 413 /* 390 414 * Desktops which falsely report a backlight and which our heuristics
+19 -10
drivers/hwmon/acpi_power_meter.c
··· 20 20 #include <linux/acpi.h> 21 21 22 22 #define ACPI_POWER_METER_NAME "power_meter" 23 - ACPI_MODULE_NAME(ACPI_POWER_METER_NAME); 24 23 #define ACPI_POWER_METER_DEVICE_NAME "Power Meter" 25 24 #define ACPI_POWER_METER_CLASS "pwr_meter_resource" 26 25 ··· 113 114 status = acpi_evaluate_integer(resource->acpi_dev->handle, "_GAI", 114 115 NULL, &data); 115 116 if (ACPI_FAILURE(status)) { 116 - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _GAI")); 117 + acpi_evaluation_failure_warn(resource->acpi_dev->handle, "_GAI", 118 + status); 117 119 return -ENODEV; 118 120 } 119 121 ··· 166 166 mutex_unlock(&resource->lock); 167 167 168 168 if (ACPI_FAILURE(status)) { 169 - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PAI")); 169 + acpi_evaluation_failure_warn(resource->acpi_dev->handle, "_PAI", 170 + status); 170 171 return -EINVAL; 171 172 } 172 173 ··· 187 186 status = acpi_evaluate_integer(resource->acpi_dev->handle, "_GHL", 188 187 NULL, &data); 189 188 if (ACPI_FAILURE(status)) { 190 - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _GHL")); 189 + acpi_evaluation_failure_warn(resource->acpi_dev->handle, "_GHL", 190 + status); 191 191 return -ENODEV; 192 192 } 193 193 ··· 239 237 mutex_unlock(&resource->lock); 240 238 241 239 if (ACPI_FAILURE(status)) { 242 - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _SHL")); 240 + acpi_evaluation_failure_warn(resource->acpi_dev->handle, "_SHL", 241 + status); 243 242 return -EINVAL; 244 243 } 245 244 ··· 273 270 status = acpi_evaluate_integer(resource->acpi_dev->handle, "_PTP", 274 271 &args, &data); 275 272 if (ACPI_FAILURE(status)) { 276 - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PTP")); 273 + acpi_evaluation_failure_warn(resource->acpi_dev->handle, "_PTP", 274 + status); 277 275 return -EINVAL; 278 276 } 279 277 ··· 326 322 status = acpi_evaluate_integer(resource->acpi_dev->handle, "_PMM", 327 323 NULL, &data); 328 324 if (ACPI_FAILURE(status)) { 329 - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PMM")); 325 + acpi_evaluation_failure_warn(resource->acpi_dev->handle, "_PMM", 326 + status); 330 327 return -ENODEV; 331 328 } 332 329 ··· 554 549 status = acpi_evaluate_object(resource->acpi_dev->handle, "_PMD", NULL, 555 550 &buffer); 556 551 if (ACPI_FAILURE(status)) { 557 - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PMD")); 552 + acpi_evaluation_failure_warn(resource->acpi_dev->handle, "_PMD", 553 + status); 558 554 return -ENODEV; 559 555 } 560 556 ··· 751 745 status = acpi_evaluate_object(resource->acpi_dev->handle, "_PMC", NULL, 752 746 &buffer); 753 747 if (ACPI_FAILURE(status)) { 754 - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PMC")); 748 + acpi_evaluation_failure_warn(resource->acpi_dev->handle, "_PMC", 749 + status); 755 750 return -ENODEV; 756 751 } 757 752 ··· 772 765 773 766 status = acpi_extract_package(pss, &format, &state); 774 767 if (ACPI_FAILURE(status)) { 775 - ACPI_EXCEPTION((AE_INFO, status, "Invalid data")); 768 + dev_err(&resource->acpi_dev->dev, ACPI_POWER_METER_NAME 769 + "_PMC package parsing failed: %s\n", 770 + acpi_format_exception(status)); 776 771 res = -EFAULT; 777 772 goto end; 778 773 }
+1 -3
drivers/iio/light/acpi-als.c
··· 29 29 #define ACPI_ALS_DEVICE_NAME "acpi-als" 30 30 #define ACPI_ALS_NOTIFY_ILLUMINANCE 0x80 31 31 32 - ACPI_MODULE_NAME("acpi-als"); 33 - 34 32 /* 35 33 * So far, there's only one channel in here, but the specification for 36 34 * ACPI0008 says there can be more to what the block can report. Like ··· 91 93 &temp_val); 92 94 93 95 if (ACPI_FAILURE(status)) { 94 - ACPI_EXCEPTION((AE_INFO, status, "Error reading ALS %s", prop)); 96 + acpi_evaluation_failure_warn(als->device->handle, prop, status); 95 97 return -EIO; 96 98 } 97 99
+1 -1
include/acpi/acoutput.h
··· 362 362 * 363 363 * A less-safe version of the macros is provided for optional use if the 364 364 * compiler uses excessive CPU stack (for example, this may happen in the 365 - * debug case if code optimzation is disabled.) 365 + * debug case if code optimization is disabled.) 366 366 */ 367 367 368 368 /* Exit trace helper macro */
+20
include/acpi/acpi_bus.h
··· 78 78 79 79 bool acpi_dev_found(const char *hid); 80 80 bool acpi_dev_present(const char *hid, const char *uid, s64 hrv); 81 + bool acpi_reduced_hardware(void); 81 82 82 83 #ifdef CONFIG_ACPI 83 84 ··· 690 689 struct acpi_device * 691 690 acpi_dev_get_first_match_dev(const char *hid, const char *uid, s64 hrv); 692 691 692 + /** 693 + * for_each_acpi_dev_match - iterate over ACPI devices that matching the criteria 694 + * @adev: pointer to the matching ACPI device, NULL at the end of the loop 695 + * @hid: Hardware ID of the device. 696 + * @uid: Unique ID of the device, pass NULL to not check _UID 697 + * @hrv: Hardware Revision of the device, pass -1 to not check _HRV 698 + * 699 + * The caller is responsible for invoking acpi_dev_put() on the returned device. 700 + * 701 + * FIXME: Due to above requirement there is a window that may invalidate @adev 702 + * and next iteration will use a dangling pointer, e.g. in the case of a 703 + * hotplug event. That said, the caller should ensure that this will never 704 + * happen. 705 + */ 693 706 #define for_each_acpi_dev_match(adev, hid, uid, hrv) \ 694 707 for (adev = acpi_dev_get_first_match_dev(hid, uid, hrv); \ 695 708 adev; \ 696 709 adev = acpi_dev_get_next_match_dev(adev, hid, uid, hrv)) 710 + 711 + static inline struct acpi_device *acpi_dev_get(struct acpi_device *adev) 712 + { 713 + return adev ? to_acpi_device(get_device(&adev->dev)) : NULL; 714 + } 697 715 698 716 static inline void acpi_dev_put(struct acpi_device *adev) 699 717 {
-12
include/acpi/acpi_drivers.h
··· 12 12 #define ACPI_MAX_STRING 80 13 13 14 14 /* 15 - * Please update drivers/acpi/debug.c and Documentation/firmware-guide/acpi/debug.rst 16 - * if you add to this list. 17 - */ 18 - #define ACPI_SBS_COMPONENT 0x00100000 19 - #define ACPI_FAN_COMPONENT 0x00200000 20 - #define ACPI_PCI_COMPONENT 0x00400000 21 - #define ACPI_CONTAINER_COMPONENT 0x01000000 22 - #define ACPI_SYSTEM_COMPONENT 0x02000000 23 - #define ACPI_MEMORY_DEVICE_COMPONENT 0x08000000 24 - #define ACPI_PROCESSOR_COMPONENT 0x20000000 25 - 26 - /* 27 15 * _HID definitions 28 16 * HIDs must conform to ACPI spec(6.1.4) 29 17 * Linux specific HIDs do not apply to this and begin with LNX:
+1 -1
include/acpi/acpixf.h
··· 12 12 13 13 /* Current ACPICA subsystem version in YYYYMMDD format */ 14 14 15 - #define ACPI_CA_VERSION 0x20210105 15 + #define ACPI_CA_VERSION 0x20210331 16 16 17 17 #include <acpi/acconfig.h> 18 18 #include <acpi/actypes.h>
+8 -1
include/acpi/acrestyp.h
··· 381 381 #define ACPI_IO_RESTRICT_OUTPUT 2 382 382 #define ACPI_IO_RESTRICT_NONE_PRESERVE 3 383 383 384 - /* Common structure for I2C, SPI, and UART serial descriptors */ 384 + /* Common structure for I2C, SPI, UART, CSI2 serial descriptors */ 385 385 386 386 #define ACPI_RESOURCE_SERIAL_COMMON \ 387 387 u8 revision_id; \ ··· 403 403 #define ACPI_RESOURCE_SERIAL_TYPE_I2C 1 404 404 #define ACPI_RESOURCE_SERIAL_TYPE_SPI 2 405 405 #define ACPI_RESOURCE_SERIAL_TYPE_UART 3 406 + #define ACPI_RESOURCE_SERIAL_TYPE_CSI2 4 406 407 407 408 /* Values for slave_mode field above */ 408 409 ··· 505 504 #define ACPI_UART_DATA_TERMINAL_READY (1<<5) 506 505 #define ACPI_UART_CLEAR_TO_SEND (1<<6) 507 506 #define ACPI_UART_REQUEST_TO_SEND (1<<7) 507 + 508 + struct acpi_resource_csi2_serialbus { 509 + ACPI_RESOURCE_SERIAL_COMMON u8 local_port_instance; 510 + u8 phy_type; 511 + }; 508 512 509 513 struct acpi_resource_pin_function { 510 514 u8 revision_id; ··· 640 634 struct acpi_resource_i2c_serialbus i2c_serial_bus; 641 635 struct acpi_resource_spi_serialbus spi_serial_bus; 642 636 struct acpi_resource_uart_serialbus uart_serial_bus; 637 + struct acpi_resource_csi2_serialbus csi2_serial_bus; 643 638 struct acpi_resource_common_serialbus common_serial_bus; 644 639 struct acpi_resource_pin_function pin_function; 645 640 struct acpi_resource_pin_config pin_config;
+51 -3
include/acpi/actbl1.h
··· 28 28 #define ACPI_SIG_BERT "BERT" /* Boot Error Record Table */ 29 29 #define ACPI_SIG_BGRT "BGRT" /* Boot Graphics Resource Table */ 30 30 #define ACPI_SIG_BOOT "BOOT" /* Simple Boot Flag Table */ 31 + #define ACPI_SIG_CEDT "CEDT" /* CXL Early Discovery Table */ 31 32 #define ACPI_SIG_CPEP "CPEP" /* Corrected Platform Error Polling table */ 32 33 #define ACPI_SIG_CSRT "CSRT" /* Core System Resource Table */ 33 34 #define ACPI_SIG_DBG2 "DBG2" /* Debug Port table type 2 */ ··· 300 299 struct acpi_table_header header; /* Common ACPI table header */ 301 300 u8 cmos_index; /* Index in CMOS RAM for the boot register */ 302 301 u8 reserved[3]; 302 + }; 303 + 304 + /******************************************************************************* 305 + * 306 + * CEDT - CXL Early Discovery Table 307 + * Version 1 308 + * 309 + * Conforms to the "CXL Early Discovery Table" (CXL 2.0) 310 + * 311 + ******************************************************************************/ 312 + 313 + struct acpi_table_cedt { 314 + struct acpi_table_header header; /* Common ACPI table header */ 315 + }; 316 + 317 + /* CEDT subtable header (Performance Record Structure) */ 318 + 319 + struct acpi_cedt_header { 320 + u8 type; 321 + u8 reserved; 322 + u16 length; 323 + }; 324 + 325 + /* Values for Type field above */ 326 + 327 + enum acpi_cedt_type { 328 + ACPI_CEDT_TYPE_CHBS = 0, 329 + ACPI_CEDT_TYPE_RESERVED = 1 330 + }; 331 + 332 + /* 333 + * CEDT subtables 334 + */ 335 + 336 + /* 0: CXL Host Bridge Structure */ 337 + 338 + struct acpi_cedt_chbs { 339 + struct acpi_cedt_header header; 340 + u32 uid; 341 + u32 cxl_version; 342 + u32 reserved; 343 + u64 base; 344 + u64 length; 303 345 }; 304 346 305 347 /******************************************************************************* ··· 1489 1445 struct acpi_hmat_structure header; 1490 1446 u8 flags; 1491 1447 u8 data_type; 1492 - u16 reserved1; 1448 + u8 min_transfer_size; 1449 + u8 reserved1; 1493 1450 u32 number_of_initiator_Pds; 1494 1451 u32 number_of_target_Pds; 1495 1452 u32 reserved2; ··· 1499 1454 1500 1455 /* Masks for Flags field above */ 1501 1456 1502 - #define ACPI_HMAT_MEMORY_HIERARCHY (0x0F) 1457 + #define ACPI_HMAT_MEMORY_HIERARCHY (0x0F) /* Bits 0-3 */ 1503 1458 1504 - /* Values for Memory Hierarchy flag */ 1459 + /* Values for Memory Hierarchy flags */ 1505 1460 1506 1461 #define ACPI_HMAT_MEMORY 0 1507 1462 #define ACPI_HMAT_LAST_LEVEL_CACHE 1 1508 1463 #define ACPI_HMAT_1ST_LEVEL_CACHE 2 1509 1464 #define ACPI_HMAT_2ND_LEVEL_CACHE 3 1510 1465 #define ACPI_HMAT_3RD_LEVEL_CACHE 4 1466 + #define ACPI_HMAT_MINIMUM_XFER_SIZE 0x10 /* Bit 4: ACPI 6.4 */ 1467 + #define ACPI_HMAT_NON_SEQUENTIAL_XFERS 0x20 /* Bit 5: ACPI 6.4 */ 1468 + 1511 1469 1512 1470 /* Values for data_type field above */ 1513 1471
+213 -27
include/acpi/actbl2.h
··· 36 36 #define ACPI_SIG_NFIT "NFIT" /* NVDIMM Firmware Interface Table */ 37 37 #define ACPI_SIG_PCCT "PCCT" /* Platform Communications Channel Table */ 38 38 #define ACPI_SIG_PDTT "PDTT" /* Platform Debug Trigger Table */ 39 + #define ACPI_SIG_PHAT "PHAT" /* Platform Health Assessment Table */ 39 40 #define ACPI_SIG_PMTT "PMTT" /* Platform Memory Topology Table */ 40 41 #define ACPI_SIG_PPTT "PPTT" /* Processor Properties Topology Table */ 41 42 #define ACPI_SIG_RASF "RASF" /* RAS Feature table */ ··· 68 67 * IORT - IO Remapping Table 69 68 * 70 69 * Conforms to "IO Remapping Table System Software on ARM Platforms", 71 - * Document number: ARM DEN 0049D, March 2018 70 + * Document number: ARM DEN 0049E.b, Feb 2021 72 71 * 73 72 ******************************************************************************/ 74 73 ··· 86 85 u8 type; 87 86 u16 length; 88 87 u8 revision; 89 - u32 reserved; 88 + u32 identifier; 90 89 u32 mapping_count; 91 90 u32 mapping_offset; 92 91 char node_data[1]; ··· 100 99 ACPI_IORT_NODE_PCI_ROOT_COMPLEX = 0x02, 101 100 ACPI_IORT_NODE_SMMU = 0x03, 102 101 ACPI_IORT_NODE_SMMU_V3 = 0x04, 103 - ACPI_IORT_NODE_PMCG = 0x05 102 + ACPI_IORT_NODE_PMCG = 0x05, 103 + ACPI_IORT_NODE_RMR = 0x06, 104 104 }; 105 105 106 106 struct acpi_iort_id_mapping { ··· 168 166 u8 reserved[3]; /* Reserved, must be zero */ 169 167 }; 170 168 171 - /* Values for ats_attribute field above */ 169 + /* Masks for ats_attribute field above */ 172 170 173 - #define ACPI_IORT_ATS_SUPPORTED 0x00000001 /* The root complex supports ATS */ 174 - #define ACPI_IORT_ATS_UNSUPPORTED 0x00000000 /* The root complex doesn't support ATS */ 171 + #define ACPI_IORT_ATS_SUPPORTED (1) /* The root complex ATS support */ 172 + #define ACPI_IORT_PRI_SUPPORTED (1<<1) /* The root complex PRI support */ 173 + #define ACPI_IORT_PASID_FWD_SUPPORTED (1<<2) /* The root complex PASID forward support */ 175 174 176 175 struct acpi_iort_smmu { 177 176 u64 base_address; /* SMMU base address */ ··· 243 240 u64 page1_base_address; 244 241 }; 245 242 243 + struct acpi_iort_rmr { 244 + u32 flags; 245 + u32 rmr_count; 246 + u32 rmr_offset; 247 + }; 248 + 249 + struct acpi_iort_rmr_desc { 250 + u64 base_address; 251 + u64 length; 252 + u32 reserved; 253 + }; 254 + 246 255 /******************************************************************************* 247 256 * 248 257 * IVRS - I/O Virtualization Reporting Structure ··· 291 276 enum acpi_ivrs_type { 292 277 ACPI_IVRS_TYPE_HARDWARE1 = 0x10, 293 278 ACPI_IVRS_TYPE_HARDWARE2 = 0x11, 279 + ACPI_IVRS_TYPE_HARDWARE3 = 0x40, 294 280 ACPI_IVRS_TYPE_MEMORY1 = 0x20, 295 281 ACPI_IVRS_TYPE_MEMORY2 = 0x21, 296 282 ACPI_IVRS_TYPE_MEMORY3 = 0x22 ··· 380 364 ACPI_IVRS_TYPE_ALIAS_START = 67, /* Uses struct acpi_ivrs_device8a */ 381 365 ACPI_IVRS_TYPE_EXT_SELECT = 70, /* Uses struct acpi_ivrs_device8b */ 382 366 ACPI_IVRS_TYPE_EXT_START = 71, /* Uses struct acpi_ivrs_device8b */ 383 - ACPI_IVRS_TYPE_SPECIAL = 72 /* Uses struct acpi_ivrs_device8c */ 367 + ACPI_IVRS_TYPE_SPECIAL = 72, /* Uses struct acpi_ivrs_device8c */ 368 + 369 + /* Variable-length device entries */ 370 + 371 + ACPI_IVRS_TYPE_HID = 240 /* Uses ACPI_IVRS_DEVICE_HID */ 384 372 }; 385 373 386 374 /* Values for Data field above */ ··· 435 415 436 416 #define ACPI_IVHD_IOAPIC 1 437 417 #define ACPI_IVHD_HPET 2 418 + 419 + /* Type 240: variable-length device entry */ 420 + 421 + struct acpi_ivrs_device_hid { 422 + struct acpi_ivrs_de_header header; 423 + u64 acpi_hid; 424 + u64 acpi_cid; 425 + u8 uid_type; 426 + u8 uid_length; 427 + }; 438 428 439 429 /* 0x20, 0x21, 0x22: I/O Virtualization Memory Definition Block (IVMD) */ 440 430 ··· 546 516 ACPI_MADT_TYPE_GENERIC_MSI_FRAME = 13, 547 517 ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR = 14, 548 518 ACPI_MADT_TYPE_GENERIC_TRANSLATOR = 15, 549 - ACPI_MADT_TYPE_RESERVED = 16 /* 16 and greater are reserved */ 519 + ACPI_MADT_TYPE_MULTIPROC_WAKEUP = 16, 520 + ACPI_MADT_TYPE_RESERVED = 17 /* 17 and greater are reserved */ 550 521 }; 551 522 552 523 /* ··· 752 721 u32 translation_id; 753 722 u64 base_address; 754 723 u32 reserved2; 724 + }; 725 + 726 + /* 16: Multiprocessor wakeup (ACPI 6.4) */ 727 + 728 + struct acpi_madt_multiproc_wakeup { 729 + struct acpi_subtable_header header; 730 + u16 mailbox_version; 731 + u32 reserved; /* reserved - must be zero */ 732 + u64 base_address; 755 733 }; 756 734 757 735 /* ··· 1023 983 u64 address; 1024 984 u64 length; 1025 985 u64 memory_mapping; 986 + u64 location_cookie; /* ACPI 6.4 */ 1026 987 }; 1027 988 1028 989 /* Flags */ 1029 990 1030 991 #define ACPI_NFIT_ADD_ONLINE_ONLY (1) /* 00: Add/Online Operation Only */ 1031 992 #define ACPI_NFIT_PROXIMITY_VALID (1<<1) /* 01: Proximity Domain Valid */ 993 + #define ACPI_NFIT_LOCATION_COOKIE_VALID (1<<2) /* 02: SPA location cookie valid (ACPI 6.4) */ 1032 994 1033 995 /* Range Type GUIDs appear in the include/acuuid.h file */ 1034 996 ··· 1226 1184 ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2 = 2, /* ACPI 6.1 */ 1227 1185 ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE = 3, /* ACPI 6.2 */ 1228 1186 ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE = 4, /* ACPI 6.2 */ 1229 - ACPI_PCCT_TYPE_RESERVED = 5 /* 5 and greater are reserved */ 1187 + ACPI_PCCT_TYPE_HW_REG_COMM_SUBSPACE = 5, /* ACPI 6.4 */ 1188 + ACPI_PCCT_TYPE_RESERVED = 6 /* 6 and greater are reserved */ 1230 1189 }; 1231 1190 1232 1191 /* ··· 1342 1299 u64 error_status_mask; 1343 1300 }; 1344 1301 1302 + /* 5: HW Registers based Communications Subspace */ 1303 + 1304 + struct acpi_pcct_hw_reg { 1305 + struct acpi_subtable_header header; 1306 + u16 version; 1307 + u64 base_address; 1308 + u64 length; 1309 + struct acpi_generic_address doorbell_register; 1310 + u64 doorbell_preserve; 1311 + u64 doorbell_write; 1312 + struct acpi_generic_address cmd_complete_register; 1313 + u64 cmd_complete_mask; 1314 + struct acpi_generic_address error_status_register; 1315 + u64 error_status_mask; 1316 + u32 nominal_latency; 1317 + u32 min_turnaround_time; 1318 + }; 1319 + 1345 1320 /* Values for doorbell flags above */ 1346 1321 1347 1322 #define ACPI_PCCT_INTERRUPT_POLARITY (1) ··· 1418 1357 1419 1358 /******************************************************************************* 1420 1359 * 1360 + * PHAT - Platform Health Assessment Table (ACPI 6.4) 1361 + * Version 1 1362 + * 1363 + ******************************************************************************/ 1364 + 1365 + struct acpi_table_phat { 1366 + struct acpi_table_header header; /* Common ACPI table header */ 1367 + }; 1368 + 1369 + /* Common header for PHAT subtables that follow main table */ 1370 + 1371 + struct acpi_phat_header { 1372 + u16 type; 1373 + u16 length; 1374 + u8 revision; 1375 + }; 1376 + 1377 + /* Values for Type field above */ 1378 + 1379 + #define ACPI_PHAT_TYPE_FW_VERSION_DATA 0 1380 + #define ACPI_PHAT_TYPE_FW_HEALTH_DATA 1 1381 + #define ACPI_PHAT_TYPE_RESERVED 2 /* 0x02-0xFFFF are reserved */ 1382 + 1383 + /* 1384 + * PHAT subtables, correspond to Type in struct acpi_phat_header 1385 + */ 1386 + 1387 + /* 0: Firmware Version Data Record */ 1388 + 1389 + struct acpi_phat_version_data { 1390 + struct acpi_phat_header header; 1391 + u8 reserved[3]; 1392 + u32 element_count; 1393 + }; 1394 + 1395 + struct acpi_phat_version_element { 1396 + u8 guid[16]; 1397 + u64 version_value; 1398 + u32 producer_id; 1399 + }; 1400 + 1401 + /* 1: Firmware Health Data Record */ 1402 + 1403 + struct acpi_phat_health_data { 1404 + struct acpi_phat_header header; 1405 + u8 reserved[2]; 1406 + u8 health; 1407 + u8 device_guid[16]; 1408 + u32 device_specific_offset; /* Zero if no Device-specific data */ 1409 + }; 1410 + 1411 + /* Values for Health field above */ 1412 + 1413 + #define ACPI_PHAT_ERRORS_FOUND 0 1414 + #define ACPI_PHAT_NO_ERRORS 1 1415 + #define ACPI_PHAT_UNKNOWN_ERRORS 2 1416 + #define ACPI_PHAT_ADVISORY 3 1417 + 1418 + /******************************************************************************* 1419 + * 1421 1420 * PMTT - Platform Memory Topology Table (ACPI 5.0) 1422 1421 * Version 1 1423 1422 * ··· 1485 1364 1486 1365 struct acpi_table_pmtt { 1487 1366 struct acpi_table_header header; /* Common ACPI table header */ 1488 - u32 reserved; 1367 + u32 memory_device_count; 1368 + /* 1369 + * Immediately followed by: 1370 + * MEMORY_DEVICE memory_device_struct[memory_device_count]; 1371 + */ 1489 1372 }; 1490 1373 1491 1374 /* Common header for PMTT subtables that follow main table */ ··· 1500 1375 u16 length; 1501 1376 u16 flags; 1502 1377 u16 reserved2; 1378 + u32 memory_device_count; /* Zero means no memory device structs follow */ 1379 + /* 1380 + * Immediately followed by: 1381 + * u8 type_specific_data[] 1382 + * MEMORY_DEVICE memory_device_struct[memory_device_count]; 1383 + */ 1503 1384 }; 1504 1385 1505 1386 /* Values for Type field above */ ··· 1513 1382 #define ACPI_PMTT_TYPE_SOCKET 0 1514 1383 #define ACPI_PMTT_TYPE_CONTROLLER 1 1515 1384 #define ACPI_PMTT_TYPE_DIMM 2 1516 - #define ACPI_PMTT_TYPE_RESERVED 3 /* 0x03-0xFF are reserved */ 1385 + #define ACPI_PMTT_TYPE_RESERVED 3 /* 0x03-0xFE are reserved */ 1386 + #define ACPI_PMTT_TYPE_VENDOR 0xFF 1517 1387 1518 1388 /* Values for Flags field above */ 1519 1389 ··· 1533 1401 u16 socket_id; 1534 1402 u16 reserved; 1535 1403 }; 1404 + /* 1405 + * Immediately followed by: 1406 + * MEMORY_DEVICE memory_device_struct[memory_device_count]; 1407 + */ 1536 1408 1537 1409 /* 1: Memory Controller subtable */ 1538 1410 1539 1411 struct acpi_pmtt_controller { 1540 1412 struct acpi_pmtt_header header; 1541 - u32 read_latency; 1542 - u32 write_latency; 1543 - u32 read_bandwidth; 1544 - u32 write_bandwidth; 1545 - u16 access_width; 1546 - u16 alignment; 1413 + u16 controller_id; 1547 1414 u16 reserved; 1548 - u16 domain_count; 1549 1415 }; 1550 - 1551 - /* 1a: Proximity Domain substructure */ 1552 - 1553 - struct acpi_pmtt_domain { 1554 - u32 proximity_domain; 1555 - }; 1416 + /* 1417 + * Immediately followed by: 1418 + * MEMORY_DEVICE memory_device_struct[memory_device_count]; 1419 + */ 1556 1420 1557 1421 /* 2: Physical Component Identifier (DIMM) */ 1558 1422 1559 1423 struct acpi_pmtt_physical_component { 1560 1424 struct acpi_pmtt_header header; 1561 - u16 component_id; 1562 - u16 reserved; 1563 - u32 memory_size; 1564 1425 u32 bios_handle; 1426 + }; 1427 + 1428 + /* 0xFF: Vendor Specific Data */ 1429 + 1430 + struct acpi_pmtt_vendor_specific { 1431 + struct acpi_pmtt_header header; 1432 + u8 type_uuid[16]; 1433 + u8 specific[]; 1434 + /* 1435 + * Immediately followed by: 1436 + * u8 vendor_specific_data[]; 1437 + * MEMORY_DEVICE memory_device_struct[memory_device_count]; 1438 + */ 1565 1439 }; 1566 1440 1567 1441 /******************************************************************************* ··· 1623 1485 u16 line_size; 1624 1486 }; 1625 1487 1488 + /* 1: Cache Type Structure for PPTT version 3 */ 1489 + 1490 + struct acpi_pptt_cache_v1 { 1491 + u32 cache_id; 1492 + }; 1493 + 1626 1494 /* Flags */ 1627 1495 1628 1496 #define ACPI_PPTT_SIZE_PROPERTY_VALID (1) /* Physical property valid */ ··· 1638 1494 #define ACPI_PPTT_CACHE_TYPE_VALID (1<<4) /* Cache type valid */ 1639 1495 #define ACPI_PPTT_WRITE_POLICY_VALID (1<<5) /* Write policy valid */ 1640 1496 #define ACPI_PPTT_LINE_SIZE_VALID (1<<6) /* Line size valid */ 1497 + #define ACPI_PPTT_CACHE_ID_VALID (1<<7) /* Cache ID valid */ 1641 1498 1642 1499 /* Masks for Attributes */ 1643 1500 ··· 1824 1679 /* Values for flags above */ 1825 1680 1826 1681 #define ACPI_SDEV_HANDOFF_TO_UNSECURE_OS (1) 1682 + #define ACPI_SDEV_SECURE_COMPONENTS_PRESENT (1<<1) 1827 1683 1828 1684 /* 1829 1685 * SDEV subtables ··· 1838 1692 u16 device_id_length; 1839 1693 u16 vendor_data_offset; 1840 1694 u16 vendor_data_length; 1695 + }; 1696 + 1697 + struct acpi_sdev_secure_component { 1698 + u16 secure_component_offset; 1699 + u16 secure_component_length; 1700 + }; 1701 + 1702 + /* 1703 + * SDEV sub-subtables ("Components") for above 1704 + */ 1705 + struct acpi_sdev_component { 1706 + struct acpi_sdev_header header; 1707 + }; 1708 + 1709 + /* Values for sub-subtable type above */ 1710 + 1711 + enum acpi_sac_type { 1712 + ACPI_SDEV_TYPE_ID_COMPONENT = 0, 1713 + ACPI_SDEV_TYPE_MEM_COMPONENT = 1 1714 + }; 1715 + 1716 + struct acpi_sdev_id_component { 1717 + struct acpi_sdev_header header; 1718 + u16 hardware_id_offset; 1719 + u16 hardware_id_length; 1720 + u16 subsystem_id_offset; 1721 + u16 subsystem_id_length; 1722 + u16 hardware_revision; 1723 + u8 hardware_rev_present; 1724 + u8 class_code_present; 1725 + u8 pci_base_class; 1726 + u8 pci_sub_class; 1727 + u8 pci_programming_xface; 1728 + }; 1729 + 1730 + struct acpi_sdev_mem_component { 1731 + struct acpi_sdev_header header; 1732 + u32 reserved; 1733 + u64 memory_base_address; 1734 + u64 memory_length; 1841 1735 }; 1842 1736 1843 1737 /* 1: PCIe Endpoint Device Based Device Structure */
+69 -1
include/acpi/actbl3.h
··· 33 33 #define ACPI_SIG_TCPA "TCPA" /* Trusted Computing Platform Alliance table */ 34 34 #define ACPI_SIG_TPM2 "TPM2" /* Trusted Platform Module 2.0 H/W interface table */ 35 35 #define ACPI_SIG_UEFI "UEFI" /* Uefi Boot Optimization Table */ 36 + #define ACPI_SIG_VIOT "VIOT" /* Virtual I/O Translation Table */ 36 37 #define ACPI_SIG_WAET "WAET" /* Windows ACPI Emulated devices Table */ 37 38 #define ACPI_SIG_WDAT "WDAT" /* Watchdog Action Table */ 38 39 #define ACPI_SIG_WDDT "WDDT" /* Watchdog Timer Description Table */ ··· 286 285 287 286 /* Flags for struct acpi_srat_generic_affinity */ 288 287 289 - #define ACPI_SRAT_GENERIC_AFFINITY_ENABLED (1) /* 00: Use affinity structure */ 288 + #define ACPI_SRAT_GENERIC_AFFINITY_ENABLED (1) /* 00: Use affinity structure */ 289 + #define ACPI_SRAT_ARCHITECTURAL_TRANSACTIONS (1<<1) /* ACPI 6.4 */ 290 290 291 291 /******************************************************************************* 292 292 * ··· 483 481 struct acpi_table_header header; /* Common ACPI table header */ 484 482 u8 identifier[16]; /* UUID identifier */ 485 483 u16 data_offset; /* Offset of remaining data in table */ 484 + }; 485 + 486 + /******************************************************************************* 487 + * 488 + * VIOT - Virtual I/O Translation Table 489 + * Version 1 490 + * 491 + ******************************************************************************/ 492 + 493 + struct acpi_table_viot { 494 + struct acpi_table_header header; /* Common ACPI table header */ 495 + u16 node_count; 496 + u16 node_offset; 497 + u8 reserved[8]; 498 + }; 499 + 500 + /* VIOT subtable header */ 501 + 502 + struct acpi_viot_header { 503 + u8 type; 504 + u8 reserved; 505 + u16 length; 506 + }; 507 + 508 + /* Values for Type field above */ 509 + 510 + enum acpi_viot_node_type { 511 + ACPI_VIOT_NODE_PCI_RANGE = 0x01, 512 + ACPI_VIOT_NODE_MMIO = 0x02, 513 + ACPI_VIOT_NODE_VIRTIO_IOMMU_PCI = 0x03, 514 + ACPI_VIOT_NODE_VIRTIO_IOMMU_MMIO = 0x04, 515 + ACPI_VIOT_RESERVED = 0x05 516 + }; 517 + 518 + /* VIOT subtables */ 519 + 520 + struct acpi_viot_pci_range { 521 + struct acpi_viot_header header; 522 + u32 endpoint_start; 523 + u16 segment_start; 524 + u16 segment_end; 525 + u16 bdf_start; 526 + u16 bdf_end; 527 + u16 output_node; 528 + u8 reserved[6]; 529 + }; 530 + 531 + struct acpi_viot_mmio { 532 + struct acpi_viot_header header; 533 + u32 endpoint; 534 + u64 base_address; 535 + u16 output_node; 536 + u8 reserved[6]; 537 + }; 538 + 539 + struct acpi_viot_virtio_iommu_pci { 540 + struct acpi_viot_header header; 541 + u16 segment; 542 + u16 bdf; 543 + u8 reserved[8]; 544 + }; 545 + 546 + struct acpi_viot_virtio_iommu_mmio { 547 + struct acpi_viot_header header; 548 + u8 reserved[4]; 549 + u64 base_address; 486 550 }; 487 551 488 552 /*******************************************************************************
+1
include/acpi/acuuid.h
··· 68 68 #define UUID_DEVICE_GRAPHS "ab02a46b-74c7-45a2-bd68-f7d344ef2153" 69 69 #define UUID_HIERARCHICAL_DATA_EXTENSION "dbb8e3e6-5886-4ba6-8795-1319f52a966b" 70 70 #define UUID_CORESIGHT_GRAPH "3ecbc8b6-1d0e-4fb3-8107-e627f805c6cd" 71 + #define UUID_USB4_CAPABILITIES "23a0d13a-26ab-486c-9c5f-0ffa525a575a" 71 72 72 73 #endif /* __ACUUID_H__ */
+40
include/acpi/cppc_acpi.h
··· 11 11 #define _CPPC_ACPI_H 12 12 13 13 #include <linux/acpi.h> 14 + #include <linux/cpufreq.h> 14 15 #include <linux/types.h> 15 16 16 17 #include <acpi/pcc.h> ··· 133 132 cpumask_var_t shared_cpu_map; 134 133 }; 135 134 135 + #ifdef CONFIG_ACPI_CPPC_LIB 136 136 extern int cppc_get_desired_perf(int cpunum, u64 *desired_perf); 137 137 extern int cppc_get_perf_ctrs(int cpu, struct cppc_perf_fb_ctrs *perf_fb_ctrs); 138 138 extern int cppc_set_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls); ··· 144 142 extern bool cpc_ffh_supported(void); 145 143 extern int cpc_read_ffh(int cpunum, struct cpc_reg *reg, u64 *val); 146 144 extern int cpc_write_ffh(int cpunum, struct cpc_reg *reg, u64 val); 145 + #else /* !CONFIG_ACPI_CPPC_LIB */ 146 + static inline int cppc_get_desired_perf(int cpunum, u64 *desired_perf) 147 + { 148 + return -ENOTSUPP; 149 + } 150 + static inline int cppc_get_perf_ctrs(int cpu, struct cppc_perf_fb_ctrs *perf_fb_ctrs) 151 + { 152 + return -ENOTSUPP; 153 + } 154 + static inline int cppc_set_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls) 155 + { 156 + return -ENOTSUPP; 157 + } 158 + static inline int cppc_get_perf_caps(int cpu, struct cppc_perf_caps *caps) 159 + { 160 + return -ENOTSUPP; 161 + } 162 + static inline bool acpi_cpc_valid(void) 163 + { 164 + return false; 165 + } 166 + static inline unsigned int cppc_get_transition_latency(int cpu) 167 + { 168 + return CPUFREQ_ETERNAL; 169 + } 170 + static inline bool cpc_ffh_supported(void) 171 + { 172 + return false; 173 + } 174 + static inline int cpc_read_ffh(int cpunum, struct cpc_reg *reg, u64 *val) 175 + { 176 + return -ENOTSUPP; 177 + } 178 + static inline int cpc_write_ffh(int cpunum, struct cpc_reg *reg, u64 val) 179 + { 180 + return -ENOTSUPP; 181 + } 182 + #endif /* !CONFIG_ACPI_CPPC_LIB */ 147 183 148 184 #endif /* _CPPC_ACPI_H*/
+1 -1
include/acpi/platform/acgcc.h
··· 61 61 #endif 62 62 63 63 /* 64 - * Explictly mark intentional explicit fallthrough to silence 64 + * Explicitly mark intentional explicit fallthrough to silence 65 65 * -Wimplicit-fallthrough in GCC 7.1+. 66 66 */ 67 67
+10
include/linux/acpi.h
··· 748 748 return NULL; 749 749 } 750 750 751 + static inline bool acpi_reduced_hardware(void) 752 + { 753 + return false; 754 + } 755 + 751 756 static inline void acpi_dev_put(struct acpi_device *adev) {} 752 757 753 758 static inline bool is_acpi_node(const struct fwnode_handle *fwnode) ··· 1039 1034 __printf(3, 4) 1040 1035 void acpi_handle_printk(const char *level, acpi_handle handle, 1041 1036 const char *fmt, ...); 1037 + void acpi_evaluation_failure_warn(acpi_handle handle, const char *name, 1038 + acpi_status status); 1042 1039 #else /* !CONFIG_ACPI */ 1043 1040 static inline __printf(3, 4) void 1044 1041 acpi_handle_printk(const char *level, void *handle, const char *fmt, ...) {} 1042 + static inline void acpi_evaluation_failure_warn(acpi_handle handle, 1043 + const char *name, 1044 + acpi_status status) {} 1045 1045 #endif /* !CONFIG_ACPI */ 1046 1046 1047 1047 #if defined(CONFIG_ACPI) && defined(CONFIG_DYNAMIC_DEBUG)
+1 -1
include/linux/ioport.h
··· 332 332 { 333 333 res->start = irq; 334 334 res->end = irq; 335 - res->flags = IORESOURCE_IRQ | IORESOURCE_DISABLED | IORESOURCE_UNSET; 335 + res->flags |= IORESOURCE_IRQ | IORESOURCE_DISABLED | IORESOURCE_UNSET; 336 336 } 337 337 338 338 extern struct address_space *iomem_get_mapping(void);
+1 -1
tools/power/acpi/common/cmfsize.c
··· 1 1 // SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 2 2 /****************************************************************************** 3 3 * 4 - * Module Name: cfsize - Common get file size function 4 + * Module Name: cmfsize - Common get file size function 5 5 * 6 6 * Copyright (C) 2000 - 2021, Intel Corp. 7 7 *