Skip to content

Commit 9bbf8e1

Browse files
committed
Merge tag 'acpi-6.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI updates from Rafael Wysocki: "These update APEI (new EINJv2 error injection, assorted fixes), fix the ACPI processor driver, update the legacy ACPI /proc interface (multiple assorted fixes of minor issues) and several assorted ACPI drivers (minor fixes and cleanups): - Printing the address in acpi_ex_trace_point() is either incorrect during early kernel boot or not really useful later when pathnames resolve properly, so stop doing it (Mario Limonciello) - Address several minor issues in the legacy ACPI proc interface (Andy Shevchenko) - Fix acpi_object union initialization in the ACPI processor driver to avoid using memory that contains leftover data (Sebastian Ott) - Make the ACPI processor perflib driver take the initial _PPC limit into account as appropriate (Jiayi Li) - Fix message formatting in the ACPI processor throttling driver and in the ACPI PCI link driver (Colin Ian King) - Clean up general ACPI PM domain handling (Rafael Wysocki) - Fix iomem-related sparse warnings in the APEI EINJ driver (Zaid Alali, Tony Luck) - Add EINJv2 error injection support to the APEI EINJ driver (Zaid Alali) - Fix memory corruption in error_type_set() in the APEI EINJ driver (Dan Carpenter) - Fix less than zero comparison on a size_t variable in the APEI EINJ driver (Colin Ian King) - Fix check and iounmap of an uninitialized pointer in the APEI EINJ driver (Colin Ian King) - Add TAINT_MACHINE_CHECK to the GHES panic path in APEI to improve diagnostics and post-mortem analysis (Breno Leitao) - Update APEI reviewer records and other ACPI-related information in MAINTAINERS as well as the contact information in the ACPI ABI documentation (Rafael Wysocki) - Fix the handling of synchronous uncorrected memory errors in APEI (Shuai Xue) - Remove an AudioDSP-related ID from the ACPI LPSS driver (Andy Shevchenko) - Replace sprintf()/scnprintf() with sysfs_emit() in the ACPI fan driver and update a debug message in fan_get_state_acpi4() (Eslam Khafagy, Abdelrahman Fekry, Sumeet Pawnikar) - Add Intel Wildcat Lake support to the ACPI DPTF driver (Srinivas Pandruvada) - Add more debug information regarding failing firmware updates to the ACPI pfr_update driver (Chen Yu) - Reduce the verbosity of the ACPI PRM (platform runtime mechanism) driver to avoid user confusion (Zhu Qiyu) - Replace sprintf() with sysfs_emit() in the ACPI TAD (time and alarm device) driver (Sukrut Heroorkar) - Enable CONFIG_ACPI_DEBUG by default to make it easier to get ACPI debug messages from OEM platforms (Mario Limonciello) - Fix parent device references in ASL examples in the ACPI documentation and fix spelling and style in the gpio-properties documentation in firmware-guide (Andy Shevchenko) - Fix typos in ACPI documentation and comments (Bjorn Helgaas)" * tag 'acpi-6.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (39 commits) ACPI: Fix typos ACPI/PCI: Remove space before newline ACPI: processor: throttling: Remove space before newline ACPI: processor: perflib: Fix initial _PPC limit application ACPI/PNP: Use my kernel.org address in MAINTAINERS and ABI docs ACPI: TAD: Replace sprintf() with sysfs_emit() ACPI: APEI: handle synchronous exceptions in task work ACPI: APEI: send SIGBUS to current task if synchronous memory error not recovered ACPI: APEI: MAINTAINERS: Update reviewers for APEI Documentation: ACPI: Fix parent device references ACPI: fan: Update debug message in fan_get_state_acpi4() ACPI: PRM: Reduce unnecessary printing to avoid user confusion ACPI: fan: Replace sprintf() with sysfs_emit() ACPI: APEI: EINJ: Fix trigger actions ACPI: processor: fix acpi_object initialization ACPI: APEI: GHES: add TAINT_MACHINE_CHECK on GHES panic path ACPI: LPSS: Remove AudioDSP related ID Documentation: firmware-guide: gpio-properties: Spelling and style fixes ACPI: fan: Replace sprintf()/scnprintf() with sysfs_emit() in show() functions ACPI: PM: Set .detach in acpi_general_pm_domain definition ...
2 parents 53edfec + ea34e67 commit 9bbf8e1

34 files changed

+567
-204
lines changed

Documentation/ABI/testing/sysfs-bus-acpi

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
What: /sys/bus/acpi/devices/.../path
22
Date: December 2006
3-
Contact: Rafael J. Wysocki <[email protected]>
3+
Contact: Rafael J. Wysocki <[email protected]>
44
Description:
55
This attribute indicates the full path of ACPI namespace
66
object associated with the device object. For example,
@@ -12,15 +12,15 @@ Description:
1212

1313
What: /sys/bus/acpi/devices/.../modalias
1414
Date: July 2007
15-
Contact: Rafael J. Wysocki <[email protected]>
15+
Contact: Rafael J. Wysocki <[email protected]>
1616
Description:
1717
This attribute indicates the PNP IDs of the device object.
1818
That is acpi:HHHHHHHH:[CCCCCCC:]. Where each HHHHHHHH or
1919
CCCCCCCC contains device object's PNPID (_HID or _CID).
2020

2121
What: /sys/bus/acpi/devices/.../hid
2222
Date: April 2005
23-
Contact: Rafael J. Wysocki <[email protected]>
23+
Contact: Rafael J. Wysocki <[email protected]>
2424
Description:
2525
This attribute indicates the hardware ID (_HID) of the
2626
device object. For example, PNP0103.
@@ -29,14 +29,14 @@ Description:
2929

3030
What: /sys/bus/acpi/devices/.../description
3131
Date: October 2012
32-
Contact: Rafael J. Wysocki <[email protected]>
32+
Contact: Rafael J. Wysocki <[email protected]>
3333
Description:
3434
This attribute contains the output of the device object's
3535
_STR control method, if present.
3636

3737
What: /sys/bus/acpi/devices/.../adr
3838
Date: October 2012
39-
Contact: Rafael J. Wysocki <[email protected]>
39+
Contact: Rafael J. Wysocki <[email protected]>
4040
Description:
4141
This attribute contains the output of the device object's
4242
_ADR control method, which is present for ACPI device
@@ -45,22 +45,22 @@ Description:
4545

4646
What: /sys/bus/acpi/devices/.../uid
4747
Date: October 2012
48-
Contact: Rafael J. Wysocki <[email protected]>
48+
Contact: Rafael J. Wysocki <[email protected]>
4949
Description:
5050
This attribute contains the output of the device object's
5151
_UID control method, if present.
5252

5353
What: /sys/bus/acpi/devices/.../eject
5454
Date: December 2006
55-
Contact: Rafael J. Wysocki <[email protected]>
55+
Contact: Rafael J. Wysocki <[email protected]>
5656
Description:
5757
Writing 1 to this attribute will trigger hot removal of
5858
this device object. This file exists for every device
5959
object that has _EJ0 method.
6060

6161
What: /sys/bus/acpi/devices/.../status
6262
Date: Jan, 2014
63-
Contact: Rafael J. Wysocki <[email protected]>
63+
Contact: Rafael J. Wysocki <[email protected]>
6464
Description:
6565
(RO) Returns the ACPI device status: enabled, disabled or
6666
functioning or present, if the method _STA is present.
@@ -90,7 +90,7 @@ Description:
9090

9191
What: /sys/bus/acpi/devices/.../hrv
9292
Date: Apr, 2016
93-
Contact: Rafael J. Wysocki <[email protected]>
93+
Contact: Rafael J. Wysocki <[email protected]>
9494
Description:
9595
(RO) Allows users to read the hardware version of non-PCI
9696
hardware, if the _HRV control method is present. It is mostly

Documentation/ABI/testing/sysfs-firmware-acpi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,15 @@ Description:
108108
number of a "General Purpose Events" (GPE).
109109

110110
A GPE vectors to a specified handler in AML, which
111-
can do a anything the BIOS writer wants from
111+
can do anything the BIOS writer wants from
112112
OS context. GPE 0x12, for example, would vector
113113
to a level or edge handler called _L12 or _E12.
114114
The handler may do its business and return.
115-
Or the handler may send send a Notify event
115+
Or the handler may send a Notify event
116116
to a Linux device driver registered on an ACPI device,
117117
such as a battery, or a processor.
118118

119-
To figure out where all the SCI's are coming from,
119+
To figure out where all the SCIs are coming from,
120120
/sys/firmware/acpi/interrupts contains a file listing
121121
every possible source, and the count of how many
122122
times it has triggered::

Documentation/firmware-guide/acpi/apei/einj.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ The following files belong to it:
5959
0x00000200 Platform Correctable
6060
0x00000400 Platform Uncorrectable non-fatal
6161
0x00000800 Platform Uncorrectable fatal
62+
V2_0x00000001 EINJV2 Processor Error
63+
V2_0x00000002 EINJV2 Memory Error
64+
V2_0x00000004 EINJV2 PCI Express Error
6265
================ ===================================
6366

6467
The format of the file contents are as above, except present are only
@@ -88,6 +91,8 @@ The following files belong to it:
8891
Memory address and mask valid (param1 and param2).
8992
Bit 2
9093
PCIe (seg,bus,dev,fn) valid (see param4 below).
94+
Bit 3
95+
EINJv2 extension structure is valid
9196

9297
If set to zero, legacy behavior is mimicked where the type of
9398
injection specifies just one bit set, and param1 is multiplexed.
@@ -122,6 +127,13 @@ The following files belong to it:
122127
this actually works depends on what operations the BIOS actually
123128
includes in the trigger phase.
124129

130+
- component_id0 .. component_idN, component_syndrome0 .. component_syndromeN
131+
132+
These files are used to set the "Component Array" field
133+
of the EINJv2 Extension Structure. Each holds a 128-bit
134+
hex value. Writing just a newline to any of these files
135+
sets an invalid (all-ones) value.
136+
125137
CXL error types are supported from ACPI 6.5 onwards (given a CXL port
126138
is present). The EINJ user interface for CXL error types is at
127139
<debugfs mount point>/cxl. The following files belong to it:
@@ -194,6 +206,27 @@ An error injection example::
194206
# echo 0x8 > error_type # Choose correctable memory error
195207
# echo 1 > error_inject # Inject now
196208

209+
An EINJv2 error injection example::
210+
211+
# cd /sys/kernel/debug/apei/einj
212+
# cat available_error_type # See which errors can be injected
213+
0x00000002 Processor Uncorrectable non-fatal
214+
0x00000008 Memory Correctable
215+
0x00000010 Memory Uncorrectable non-fatal
216+
V2_0x00000001 EINJV2 Processor Error
217+
V2_0x00000002 EINJV2 Memory Error
218+
219+
# echo 0x12345000 > param1 # Set memory address for injection
220+
# echo 0xfffffffffffff000 > param2 # Range - anywhere in this page
221+
# echo 0x1 > component_id0 # First device ID
222+
# echo 0x4 > component_syndrome0 # First error syndrome
223+
# echo 0x2 > component_id1 # Second device ID
224+
# echo 0x4 > component_syndrome1 # Second error syndrome
225+
# echo '' > component_id2 # Mark id2 invalid to terminate list
226+
# echo V2_0x2 > error_type # Choose EINJv2 memory error
227+
# echo 0xa > flags # set flags to indicate EINJv2
228+
# echo 1 > error_inject # Inject now
229+
197230
You should see something like this in dmesg::
198231

199232
[22715.830801] EDAC sbridge MC3: HANDLING MCE MEMORY ERROR

Documentation/firmware-guide/acpi/gpio-properties.rst

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ _DSD Device Properties Related to GPIO
66

77
With the release of ACPI 5.1, the _DSD configuration object finally
88
allows names to be given to GPIOs (and other things as well) returned
9-
by _CRS. Previously, we were only able to use an integer index to find
9+
by _CRS. Previously we were only able to use an integer index to find
1010
the corresponding GPIO, which is pretty error prone (it depends on
1111
the _CRS output ordering, for example).
1212

@@ -49,11 +49,11 @@ index
4949
pin
5050
Pin in the GpioIo()/GpioInt() resource. Typically this is zero.
5151
active_low
52-
If 1, the GPIO is marked as active_low.
52+
If 1, the GPIO is marked as active-low.
5353

5454
Since ACPI GpioIo() resource does not have a field saying whether it is
55-
active low or high, the "active_low" argument can be used here. Setting
56-
it to 1 marks the GPIO as active low.
55+
active-low or active-high, the "active_low" argument can be used here.
56+
Setting it to 1 marks the GPIO as active-low.
5757

5858
Note, active_low in _DSD does not make sense for GpioInt() resource and
5959
must be 0. GpioInt() resource has its own means of defining it.
@@ -92,8 +92,8 @@ and polarity settings. The table below shows the expectations:
9292
| | Low | as low, assuming active |
9393
+-------------+-------------+-----------------------------------------------+
9494

95-
That said, for our above example the both GPIOs, since the bias setting
96-
is explicit and _DSD is present, will be treated as active with a high
95+
That said, for our above example, since the bias setting is explicit and
96+
_DSD is present, both GPIOs will be treated as active with a high
9797
polarity and Linux will configure the pins in this state until a driver
9898
reprograms them differently.
9999

@@ -231,8 +231,8 @@ In those cases ACPI device identification objects, _HID, _CID, _CLS, _SUB, _HRV,
231231
available to the driver can be used to identify the device and that is supposed
232232
to be sufficient to determine the meaning and purpose of all of the GPIO lines
233233
listed by the GpioIo()/GpioInt() resources returned by _CRS. In other words,
234-
the driver is supposed to know what to use the GpioIo()/GpioInt() resources for
235-
once it has identified the device. Having done that, it can simply assign names
234+
the driver is supposed to know what to use from the GpioIo()/GpioInt() resources
235+
for once it has identified the device. Having done that, it can simply assign names
236236
to the GPIO lines it is going to use and provide the GPIO subsystem with a
237237
mapping between those names and the ACPI GPIO resources corresponding to them.
238238

@@ -252,9 +252,9 @@ question would look like this::
252252
static const struct acpi_gpio_params shutdown_gpio = { 0, 0, false };
253253

254254
static const struct acpi_gpio_mapping bluetooth_acpi_gpios[] = {
255-
{ "reset-gpios", &reset_gpio, 1 },
256-
{ "shutdown-gpios", &shutdown_gpio, 1 },
257-
{ }
255+
{ "reset-gpios", &reset_gpio, 1 },
256+
{ "shutdown-gpios", &shutdown_gpio, 1 },
257+
{ }
258258
};
259259

260260
Next, the mapping table needs to be passed as the second argument to
@@ -270,7 +270,7 @@ Using the _CRS fallback
270270

271271
If a device does not have _DSD or the driver does not create ACPI GPIO
272272
mapping, the Linux GPIO framework refuses to return any GPIOs. This is
273-
because the driver does not know what it actually gets. For example if we
273+
because the driver does not know what it actually gets. For example, if we
274274
have a device like below::
275275

276276
Device (BTH)
@@ -292,7 +292,7 @@ The driver might expect to get the right GPIO when it does::
292292
...error handling...
293293

294294
but since there is no way to know the mapping between "reset" and
295-
the GpioIo() in _CRS desc will hold ERR_PTR(-ENOENT).
295+
the GpioIo() in _CRS the desc will hold ERR_PTR(-ENOENT).
296296

297297
The driver author can solve this by passing the mapping explicitly
298298
(this is the recommended way and it's documented in the above chapter).
@@ -318,15 +318,15 @@ Case 1::
318318
desc = gpiod_get(dev, "non-null-connection-id", flags);
319319
desc = gpiod_get_index(dev, "non-null-connection-id", index, flags);
320320

321+
Case 1 assumes that corresponding ACPI device description must have
322+
defined device properties and will prevent from getting any GPIO resources
323+
otherwise.
324+
321325
Case 2::
322326

323327
desc = gpiod_get(dev, NULL, flags);
324328
desc = gpiod_get_index(dev, NULL, index, flags);
325329

326-
Case 1 assumes that corresponding ACPI device description must have
327-
defined device properties and will prevent to getting any GPIO resources
328-
otherwise.
329-
330330
Case 2 explicitly tells GPIO core to look for resources in _CRS.
331331

332332
Be aware that gpiod_get_index() in cases 1 and 2, assuming that there

Documentation/firmware-guide/acpi/i2c-muxes.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Consider this topology::
1414
| | | 0x70 |--CH01--> i2c client B (0x50)
1515
+------+ +------+
1616

17-
which corresponds to the following ASL::
17+
which corresponds to the following ASL (in the scope of \_SB)::
1818

1919
Device (SMB1)
2020
{
@@ -24,7 +24,7 @@ which corresponds to the following ASL::
2424
Name (_HID, ...)
2525
Name (_CRS, ResourceTemplate () {
2626
I2cSerialBus (0x70, ControllerInitiated, I2C_SPEED,
27-
AddressingMode7Bit, "^SMB1", 0x00,
27+
AddressingMode7Bit, "\\_SB.SMB1", 0x00,
2828
ResourceConsumer,,)
2929
}
3030

@@ -37,7 +37,7 @@ which corresponds to the following ASL::
3737
Name (_HID, ...)
3838
Name (_CRS, ResourceTemplate () {
3939
I2cSerialBus (0x50, ControllerInitiated, I2C_SPEED,
40-
AddressingMode7Bit, "^CH00", 0x00,
40+
AddressingMode7Bit, "\\_SB.SMB1.CH00", 0x00,
4141
ResourceConsumer,,)
4242
}
4343
}
@@ -52,7 +52,7 @@ which corresponds to the following ASL::
5252
Name (_HID, ...)
5353
Name (_CRS, ResourceTemplate () {
5454
I2cSerialBus (0x50, ControllerInitiated, I2C_SPEED,
55-
AddressingMode7Bit, "^CH01", 0x00,
55+
AddressingMode7Bit, "\\_SB.SMB1.CH01", 0x00,
5656
ResourceConsumer,,)
5757
}
5858
}

MAINTAINERS

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -306,16 +306,17 @@ F: tools/power/acpi/
306306

307307
ACPI APEI
308308
M: "Rafael J. Wysocki" <[email protected]>
309-
R: Len Brown <[email protected]>
310-
R: James Morse <[email protected]>
311309
R: Tony Luck <[email protected]>
312310
R: Borislav Petkov <[email protected]>
311+
R: Hanjun Guo <[email protected]>
312+
R: Mauro Carvalho Chehab <[email protected]>
313+
R: Shuai Xue <[email protected]>
313314
314315
F: drivers/acpi/apei/
315316

316317
ACPI COMPONENT ARCHITECTURE (ACPICA)
318+
M: "Rafael J. Wysocki" <[email protected]>
317319
M: Robert Moore <[email protected]>
318-
M: "Rafael J. Wysocki" <[email protected]>
319320
320321
321322
S: Supported
@@ -19768,7 +19769,7 @@ F: Documentation/devicetree/bindings/iio/magnetometer/pni,rm3100.yaml
1976819769
F: drivers/iio/magnetometer/rm3100*
1976919770

1977019771
PNP SUPPORT
19771-
M: "Rafael J. Wysocki" <rafael[email protected]>
19772+
M: "Rafael J. Wysocki" <rafael@kernel.org>
1977219773
1977319774
S: Maintained
1977419775
F: drivers/pnp/

drivers/acpi/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@ config ACPI_TABLE_OVERRIDE_VIA_BUILTIN_INITRD
394394

395395
config ACPI_DEBUG
396396
bool "Debug Statements"
397+
default y
397398
help
398399
The ACPI subsystem can produce debug output. Saying Y enables this
399400
output and increases the kernel size by around 50K.

drivers/acpi/acpi_processor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ static inline int acpi_processor_hotadd_init(struct acpi_processor *pr,
275275

276276
static int acpi_processor_get_info(struct acpi_device *device)
277277
{
278-
union acpi_object object = { 0 };
278+
union acpi_object object = { .processor = { 0 } };
279279
struct acpi_buffer buffer = { sizeof(union acpi_object), &object };
280280
struct acpi_processor *pr = acpi_driver_data(device);
281281
int device_declaration = 0;

drivers/acpi/acpi_tad.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ static ssize_t time_show(struct device *dev, struct device_attribute *attr,
233233
if (ret)
234234
return ret;
235235

236-
return sprintf(buf, "%u:%u:%u:%u:%u:%u:%d:%u\n",
236+
return sysfs_emit(buf, "%u:%u:%u:%u:%u:%u:%d:%u\n",
237237
rt.year, rt.month, rt.day, rt.hour, rt.minute, rt.second,
238238
rt.tz, rt.daylight);
239239
}
@@ -428,7 +428,7 @@ static ssize_t caps_show(struct device *dev, struct device_attribute *attr,
428428
{
429429
struct acpi_tad_driver_data *dd = dev_get_drvdata(dev);
430430

431-
return sprintf(buf, "0x%02X\n", dd->capabilities);
431+
return sysfs_emit(buf, "0x%02X\n", dd->capabilities);
432432
}
433433

434434
static DEVICE_ATTR_RO(caps);

drivers/acpi/acpica/extrace.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@ acpi_ex_trace_point(acpi_trace_event_type type,
136136

137137
if (pathname) {
138138
ACPI_DEBUG_PRINT((ACPI_DB_TRACE_POINT,
139-
"%s %s [0x%p:%s] execution.\n",
139+
"%s %s [%s] execution.\n",
140140
acpi_ex_get_trace_event_name(type),
141-
begin ? "Begin" : "End", aml, pathname));
141+
begin ? "Begin" : "End", pathname));
142142
} else {
143143
ACPI_DEBUG_PRINT((ACPI_DB_TRACE_POINT,
144144
"%s %s [0x%p] execution.\n",

0 commit comments

Comments
 (0)