Skip to content

Commit d8f9176

Browse files
committed
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 ...
2 parents 47080f2 + b6237f6 commit d8f9176

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1127
-646
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
CONFIG_ACPI_DEBUG must be enabled to produce any ACPI
5151
debug output. Bits in debug_layer correspond to a
5252
_COMPONENT in an ACPI source file, e.g.,
53-
#define _COMPONENT ACPI_PCI_COMPONENT
53+
#define _COMPONENT ACPI_EVENTS
5454
Bits in debug_level correspond to a level in
5555
ACPI_DEBUG_PRINT statements, e.g.,
5656
ACPI_DEBUG_PRINT((ACPI_DB_INFO, ...
@@ -60,8 +60,6 @@
6060

6161
Enable processor driver info messages:
6262
acpi.debug_layer=0x20000000
63-
Enable PCI/PCI interrupt routing info messages:
64-
acpi.debug_layer=0x400000
6563
Enable AML "Debug" output, i.e., stores to the Debug
6664
object while interpreting AML:
6765
acpi.debug_layer=0xffffffff acpi.debug_level=0x2

Documentation/firmware-guide/acpi/debug.rst

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
.. SPDX-License-Identifier: GPL-2.0
22
3-
=================
4-
ACPI Debug Output
5-
=================
3+
====================
4+
ACPI CA Debug Output
5+
====================
66

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.
99

1010
Compile-time configuration
1111
==========================
1212

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.
1615

1716
Boot- and run-time configuration
1817
================================
@@ -27,16 +26,16 @@ debug_layer (component)
2726
=======================
2827

2928
The "debug_layer" is a mask that selects components of interest, e.g., a
30-
specific driver or part of the ACPI interpreter. To build the debug_layer
31-
bitmask, look for the "#define _COMPONENT" in an ACPI source file.
29+
specific part of the ACPI interpreter. To build the debug_layer bitmask, look
30+
for the "#define _COMPONENT" in an ACPI source file.
3231

3332
You can set the debug_layer mask at boot-time using the acpi.debug_layer
3433
command line argument, and you can change it after boot by writing values
3534
to /sys/module/acpi/parameters/debug_layer.
3635

37-
The possible components are defined in include/acpi/acoutput.h and
38-
include/acpi/acpi_drivers.h. Reading /sys/module/acpi/parameters/debug_layer
39-
shows the supported mask values, currently these::
36+
The possible components are defined in include/acpi/acoutput.h.
37+
38+
Reading /sys/module/acpi/parameters/debug_layer shows the supported mask values::
4039

4140
ACPI_UTILITIES 0x00000001
4241
ACPI_HARDWARE 0x00000002
@@ -52,13 +51,6 @@ shows the supported mask values, currently these::
5251
ACPI_CA_DISASSEMBLER 0x00000800
5352
ACPI_COMPILER 0x00001000
5453
ACPI_TOOLS 0x00002000
55-
ACPI_SBS_COMPONENT 0x00100000
56-
ACPI_FAN_COMPONENT 0x00200000
57-
ACPI_PCI_COMPONENT 0x00400000
58-
ACPI_CONTAINER_COMPONENT 0x01000000
59-
ACPI_SYSTEM_COMPONENT 0x02000000
60-
ACPI_MEMORY_DEVICE_COMPONENT 0x08000000
61-
ACPI_PROCESSOR_COMPONENT 0x20000000
6254

6355
debug_level
6456
===========
@@ -127,10 +119,6 @@ AML) during boot::
127119

128120
acpi.debug_layer=0xffffffff acpi.debug_level=0x2
129121

130-
Enable PCI and PCI interrupt routing debug messages::
131-
132-
acpi.debug_layer=0x400000 acpi.debug_level=0x4
133-
134122
Enable all ACPI hardware-related messages::
135123

136124
acpi.debug_layer=0x2 acpi.debug_level=0xffffffff

drivers/acpi/ac.c

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
22
/*
3-
* acpi_ac.c - ACPI AC Adapter Driver ($Revision: 27 $)
3+
* acpi_ac.c - ACPI AC Adapter Driver (Revision: 27)
44
*
55
* Copyright (C) 2001, 2002 Andy Grover <[email protected]>
66
* Copyright (C) 2001, 2002 Paul Diefenbaugh <[email protected]>
@@ -78,17 +78,14 @@ static struct acpi_driver acpi_ac_driver = {
7878
struct acpi_ac {
7979
struct power_supply *charger;
8080
struct power_supply_desc charger_desc;
81-
struct acpi_device * device;
81+
struct acpi_device *device;
8282
unsigned long long state;
8383
struct notifier_block battery_nb;
8484
};
8585

8686
#define to_acpi_ac(x) power_supply_get_drvdata(x)
8787

88-
/* --------------------------------------------------------------------------
89-
AC Adapter Management
90-
-------------------------------------------------------------------------- */
91-
88+
/* AC Adapter Management */
9289
static int acpi_ac_get_state(struct acpi_ac *ac)
9390
{
9491
acpi_status status = AE_OK;
@@ -109,9 +106,7 @@ static int acpi_ac_get_state(struct acpi_ac *ac)
109106
return 0;
110107
}
111108

112-
/* --------------------------------------------------------------------------
113-
sysfs I/F
114-
-------------------------------------------------------------------------- */
109+
/* sysfs I/F */
115110
static int get_ac_property(struct power_supply *psy,
116111
enum power_supply_property psp,
117112
union power_supply_propval *val)
@@ -138,10 +133,7 @@ static enum power_supply_property ac_props[] = {
138133
POWER_SUPPLY_PROP_ONLINE,
139134
};
140135

141-
/* --------------------------------------------------------------------------
142-
Driver Model
143-
-------------------------------------------------------------------------- */
144-
136+
/* Driver Model */
145137
static void acpi_ac_notify(struct acpi_device *device, u32 event)
146138
{
147139
struct acpi_ac *ac = acpi_driver_data(device);
@@ -174,8 +166,6 @@ static void acpi_ac_notify(struct acpi_device *device, u32 event)
174166
acpi_notifier_call_chain(device, event, (u32) ac->state);
175167
kobject_uevent(&ac->charger->dev.kobj, KOBJ_CHANGE);
176168
}
177-
178-
return;
179169
}
180170

181171
static int acpi_ac_battery_notify(struct notifier_block *nb,
@@ -187,7 +177,7 @@ static int acpi_ac_battery_notify(struct notifier_block *nb,
187177
/*
188178
* On HP Pavilion dv6-6179er AC status notifications aren't triggered
189179
* when adapter is plugged/unplugged. However, battery status
190-
* notifcations are triggered when battery starts charging or
180+
* notifications are triggered when battery starts charging or
191181
* discharging. Re-reading AC status triggers lost AC notifications,
192182
* if AC status has changed.
193183
*/
@@ -282,9 +272,8 @@ static int acpi_ac_add(struct acpi_device *device)
282272
ac->battery_nb.notifier_call = acpi_ac_battery_notify;
283273
register_acpi_notifier(&ac->battery_nb);
284274
end:
285-
if (result) {
275+
if (result)
286276
kfree(ac);
287-
}
288277

289278
return result;
290279
}
@@ -293,7 +282,7 @@ static int acpi_ac_add(struct acpi_device *device)
293282
static int acpi_ac_resume(struct device *dev)
294283
{
295284
struct acpi_ac *ac;
296-
unsigned old_state;
285+
unsigned int old_state;
297286

298287
if (!dev)
299288
return -EINVAL;
@@ -352,9 +341,8 @@ static int __init acpi_ac_init(void)
352341
}
353342

354343
result = acpi_bus_register_driver(&acpi_ac_driver);
355-
if (result < 0) {
344+
if (result < 0)
356345
return -ENODEV;
357-
}
358346

359347
return 0;
360348
}

drivers/acpi/acpi_apd.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,10 @@ static const struct apd_device_desc hip08_spi_desc = {
176176

177177
#endif
178178

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+
*/
183183
static int acpi_apd_create_device(struct acpi_device *adev,
184184
const struct acpi_device_id *id)
185185
{

drivers/acpi/acpi_ipmi.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,6 @@ static void ipmi_register_bmc(int iface, struct device *dev)
478478
ipmi_dev_release(ipmi_device);
479479
err_ref:
480480
put_device(smi_data.dev);
481-
return;
482481
}
483482

484483
static void ipmi_bmc_gone(int iface)

drivers/acpi/acpi_lpss.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ static const struct acpi_device_id acpi_lpss_device_ids[] = {
377377
static int is_memory(struct acpi_resource *res, void *not_used)
378378
{
379379
struct resource r;
380+
380381
return !acpi_dev_resource_memory(res, &r);
381382
}
382383

@@ -1200,6 +1201,7 @@ static int acpi_lpss_poweroff_noirq(struct device *dev)
12001201
if (pdata->dev_desc->resume_from_noirq) {
12011202
/* This is analogous to the acpi_lpss_suspend_noirq() case. */
12021203
int ret = acpi_lpss_do_poweroff_late(dev);
1204+
12031205
if (ret)
12041206
return ret;
12051207
}

drivers/acpi/acpi_pad.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ static void round_robin_cpu(unsigned int tsk_index)
128128
static void exit_round_robin(unsigned int tsk_index)
129129
{
130130
struct cpumask *pad_busy_cpus = to_cpumask(pad_busy_cpus_bits);
131+
131132
cpumask_clear_cpu(tsk_in_cpu[tsk_index], pad_busy_cpus);
132133
tsk_in_cpu[tsk_index] = -1;
133134
}
@@ -265,6 +266,7 @@ static ssize_t rrtime_store(struct device *dev,
265266
struct device_attribute *attr, const char *buf, size_t count)
266267
{
267268
unsigned long num;
269+
268270
if (kstrtoul(buf, 0, &num))
269271
return -EINVAL;
270272
if (num < 1 || num >= 100)
@@ -286,6 +288,7 @@ static ssize_t idlepct_store(struct device *dev,
286288
struct device_attribute *attr, const char *buf, size_t count)
287289
{
288290
unsigned long num;
291+
289292
if (kstrtoul(buf, 0, &num))
290293
return -EINVAL;
291294
if (num < 1 || num >= 100)
@@ -307,6 +310,7 @@ static ssize_t idlecpus_store(struct device *dev,
307310
struct device_attribute *attr, const char *buf, size_t count)
308311
{
309312
unsigned long num;
313+
310314
if (kstrtoul(buf, 0, &num))
311315
return -EINVAL;
312316
mutex_lock(&isolated_cpus_lock);

drivers/acpi/acpi_processor.c

Lines changed: 17 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,10 @@
2222

2323
#include "internal.h"
2424

25-
#define _COMPONENT ACPI_PROCESSOR_COMPONENT
26-
27-
ACPI_MODULE_NAME("processor");
28-
2925
DEFINE_PER_CPU(struct acpi_processor *, processors);
3026
EXPORT_PER_CPU_SYMBOL(processors);
3127

32-
/* --------------------------------------------------------------------------
33-
Errata Handling
34-
-------------------------------------------------------------------------- */
35-
28+
/* Errata Handling */
3629
struct acpi_processor_errata errata __read_mostly;
3730
EXPORT_SYMBOL_GPL(errata);
3831

@@ -51,19 +44,19 @@ static int acpi_processor_errata_piix4(struct pci_dev *dev)
5144

5245
switch (dev->revision) {
5346
case 0:
54-
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found PIIX4 A-step\n"));
47+
dev_dbg(&dev->dev, "Found PIIX4 A-step\n");
5548
break;
5649
case 1:
57-
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found PIIX4 B-step\n"));
50+
dev_dbg(&dev->dev, "Found PIIX4 B-step\n");
5851
break;
5952
case 2:
60-
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found PIIX4E\n"));
53+
dev_dbg(&dev->dev, "Found PIIX4E\n");
6154
break;
6255
case 3:
63-
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found PIIX4M\n"));
56+
dev_dbg(&dev->dev, "Found PIIX4M\n");
6457
break;
6558
default:
66-
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found unknown PIIX4\n"));
59+
dev_dbg(&dev->dev, "Found unknown PIIX4\n");
6760
break;
6861
}
6962

@@ -129,11 +122,9 @@ static int acpi_processor_errata_piix4(struct pci_dev *dev)
129122
}
130123

131124
if (errata.piix4.bmisx)
132-
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
133-
"Bus master activity detection (BM-IDE) erratum enabled\n"));
125+
dev_dbg(&dev->dev, "Bus master activity detection (BM-IDE) erratum enabled\n");
134126
if (errata.piix4.fdma)
135-
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
136-
"Type-F DMA livelock erratum (C3 disabled)\n"));
127+
dev_dbg(&dev->dev, "Type-F DMA livelock erratum (C3 disabled)\n");
137128

138129
return 0;
139130
}
@@ -157,10 +148,7 @@ static int acpi_processor_errata(void)
157148
return result;
158149
}
159150

160-
/* --------------------------------------------------------------------------
161-
Initialization
162-
-------------------------------------------------------------------------- */
163-
151+
/* Initialization */
164152
#ifdef CONFIG_ACPI_HOTPLUG_CPU
165153
int __weak acpi_map_cpu(acpi_handle handle,
166154
phys_cpuid_t physid, u32 acpi_id, int *pcpu)
@@ -244,11 +232,9 @@ static int acpi_processor_get_info(struct acpi_device *device)
244232
*/
245233
if (acpi_gbl_FADT.pm2_control_block && acpi_gbl_FADT.pm2_control_length) {
246234
pr->flags.bm_control = 1;
247-
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
248-
"Bus mastering arbitration control present\n"));
235+
dev_dbg(&device->dev, "Bus mastering arbitration control present\n");
249236
} else
250-
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
251-
"No bus mastering arbitration control\n"));
237+
dev_dbg(&device->dev, "No bus mastering arbitration control\n");
252238

253239
if (!strcmp(acpi_device_hid(device), ACPI_PROCESSOR_OBJECT_HID)) {
254240
/* Declared with "Processor" statement; match ProcessorID */
@@ -291,7 +277,7 @@ static int acpi_processor_get_info(struct acpi_device *device)
291277
pr->phys_id = acpi_get_phys_id(pr->handle, device_declaration,
292278
pr->acpi_id);
293279
if (invalid_phys_cpuid(pr->phys_id))
294-
acpi_handle_debug(pr->handle, "failed to get CPU physical ID.\n");
280+
dev_dbg(&device->dev, "Failed to get CPU physical ID.\n");
295281

296282
pr->id = acpi_map_cpuid(pr->phys_id, pr->acpi_id);
297283
if (!cpu0_initialized && !acpi_has_cpu_in_madt()) {
@@ -314,6 +300,7 @@ static int acpi_processor_get_info(struct acpi_device *device)
314300
*/
315301
if (invalid_logical_cpuid(pr->id) || !cpu_present(pr->id)) {
316302
int ret = acpi_processor_hotadd_init(pr);
303+
317304
if (ret)
318305
return ret;
319306
}
@@ -328,11 +315,10 @@ static int acpi_processor_get_info(struct acpi_device *device)
328315
* CPU+CPU ID.
329316
*/
330317
sprintf(acpi_device_bid(device), "CPU%X", pr->id);
331-
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Processor [%d:%d]\n", pr->id,
332-
pr->acpi_id));
318+
dev_dbg(&device->dev, "Processor [%d:%d]\n", pr->id, pr->acpi_id);
333319

334320
if (!object.processor.pblk_address)
335-
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No PBLK (NULL address)\n"));
321+
dev_dbg(&device->dev, "No PBLK (NULL address)\n");
336322
else if (object.processor.pblk_length != 6)
337323
dev_err(&device->dev, "Invalid PBLK length [%d]\n",
338324
object.processor.pblk_length);
@@ -440,10 +426,7 @@ static int acpi_processor_add(struct acpi_device *device,
440426
}
441427

442428
#ifdef CONFIG_ACPI_HOTPLUG_CPU
443-
/* --------------------------------------------------------------------------
444-
Removal
445-
-------------------------------------------------------------------------- */
446-
429+
/* Removal */
447430
static void acpi_processor_remove(struct acpi_device *device)
448431
{
449432
struct acpi_processor *pr;
@@ -901,7 +884,7 @@ int acpi_processor_evaluate_cst(acpi_handle handle, u32 cpu,
901884

902885
info->count = last_index;
903886

904-
end:
887+
end:
905888
kfree(buffer.pointer);
906889

907890
return ret;

0 commit comments

Comments
 (0)