Skip to content

Commit c0d6586

Browse files
committed
Merge tag 'acpi-5.16-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, address some issues related to the ACPI power resources management, simplify the enumeration of PCI devices having ACPI companions, add new quirks, fix assorted problems, update the ACPI-related information in maintainers and clean up code in several places. Specifics: - Update the ACPICA code in the kernel to upstream revision 20210930 including the following changes: - Fix system-wide resume issue caused by evaluating control methods too early in the resume path (Rafael Wysocki). - Add support for Windows 2020 _OSI string (Mario Limonciello). - Add Generic Port Affinity type for SRAT (Alison Schofield). - Add disassembly support for the NHLT ACPI table (Bob Moore). - Avoid flushing caches before entering C3 type of idle states on AMD processors (Deepak Sharma). - Avoid enumerating CPUs that are not present and not online-capable according to the platform firmware (Mario Limonciello). - Add DMI-based mechanism to quirk IRQ overrides and use it for two platforms (Hui Wang). - Change the configuration of unused ACPI device objects to reflect the D3cold power state after enumerating devices (Rafael Wysocki). - Update MAINTAINERS information regarding ACPI (Rafael Wysocki). - Fix typo in ACPI Kconfig (Masanari Iid). - Use sysfs_emit() instead of snprintf() in some places (Qing Wang). - Make the association of ACPI device objects with PCI devices more straightforward and simplify the code doing that for all devices in general (Rafael Wysocki). - Use acpi_device_adr() in acpi_find_child_device() instead of evaluating _ADR (Rafael Wysocki). - Drop duplicate device IDs from PNP device IDs list (Krzysztof Kozlowski). - Allow acpi_idle_play_dead() to use C3 on AMD processors (Richard Gong). - Use ACPI_COMPANION() to simplify code in some drivers (Rafael Wysocki). - Check the states of all ACPI power resources during initialization to avoid dealing with power resources in unknown states (Rafael Wysocki). - Fix ACPI power resource issues related to sharing wakeup power resources (Rafael Wysocki). - Avoid registering redundant suspend_ops (Rafael Wysocki). - Report battery charging state as "full" if it appears to be over the design capacity (André Almeida). - Quirk GK45 mini PC to skip reading _PSR in the AC driver (Stefan Schaeckeler). - Mark apei_hest_parse() static (Christoph Hellwig). - Relax platform response timeout to 1 second after instructing it to inject an error (Shuai Xue). - Make the PRM code handle memory allocation and remapping failures more gracefully and drop some unnecessary blank lines from that code (Aubrey Li). - Fix spelling mistake in the ACPI documentation (Colin Ian King)" * tag 'acpi-5.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (36 commits) ACPI: glue: Use acpi_device_adr() in acpi_find_child_device() perf: qcom_l2_pmu: ACPI: Use ACPI_COMPANION() directly ACPI: APEI: mark apei_hest_parse() static ACPI: APEI: EINJ: Relax platform response timeout to 1 second gpio-amdpt: ACPI: Use the ACPI_COMPANION() macro directly nouveau: ACPI: Use the ACPI_COMPANION() macro directly ACPI: resources: Add one more Medion model in IRQ override quirk ACPI: AC: Quirk GK45 to skip reading _PSR ACPI: PM: sleep: Do not set suspend_ops unnecessarily ACPI: PRM: Handle memory allocation and memory remap failure ACPI: PRM: Remove unnecessary blank lines ACPI: PM: Turn off wakeup power resources on _DSW/_PSW errors ACPI: PM: Fix sharing of wakeup power resources ACPI: PM: Turn off unused wakeup power resources ACPI: PM: Check states of power resources during initialization ACPI: replace snprintf() in "show" functions with sysfs_emit() ACPI: LPSS: Use ACPI_COMPANION() directly ACPI: scan: Release PM resources blocked by unused objects ACPI: battery: Accept charges over the design capacity as full ACPICA: Update version to 20210930 ...
2 parents 33fb426 + 90e17ed commit c0d6586

File tree

36 files changed

+547
-194
lines changed

36 files changed

+547
-194
lines changed

Documentation/firmware-guide/acpi/osi.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ The ACPI BIOS flow would include an evaluation of _OS, and the AML
7474
interpreter in the kernel would return to it a string identifying the OS:
7575

7676
Windows 98, SE: "Microsoft Windows"
77-
Windows ME: "Microsoft WindowsME:Millenium Edition"
77+
Windows ME: "Microsoft WindowsME:Millennium Edition"
7878
Windows NT: "Microsoft Windows NT"
7979

8080
The idea was on a platform tasked with running multiple OS's,

MAINTAINERS

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ F: drivers/platform/x86/acer-wmi.c
334334

335335
ACPI
336336
M: "Rafael J. Wysocki" <[email protected]>
337-
M: Len Brown <[email protected]>
337+
R: Len Brown <[email protected]>
338338
339339
S: Supported
340340
W: https://01.org/linux-acpi
@@ -355,7 +355,7 @@ F: tools/power/acpi/
355355

356356
ACPI APEI
357357
M: "Rafael J. Wysocki" <[email protected]>
358-
M: Len Brown <[email protected]>
358+
R: Len Brown <[email protected]>
359359
R: James Morse <[email protected]>
360360
R: Tony Luck <[email protected]>
361361
R: Borislav Petkov <[email protected]>
@@ -378,14 +378,6 @@ F: drivers/acpi/acpica/
378378
F: include/acpi/
379379
F: tools/power/acpi/
380380

381-
ACPI FAN DRIVER
382-
M: Zhang Rui <[email protected]>
383-
384-
S: Supported
385-
W: https://01.org/linux-acpi
386-
B: https://bugzilla.kernel.org
387-
F: drivers/acpi/fan.c
388-
389381
ACPI FOR ARM64 (ACPI/arm64)
390382
M: Lorenzo Pieralisi <[email protected]>
391383
M: Hanjun Guo <[email protected]>
@@ -428,14 +420,6 @@ W: https://01.org/linux-acpi
428420
B: https://bugzilla.kernel.org
429421
F: drivers/acpi/*thermal*
430422

431-
ACPI VIDEO DRIVER
432-
M: Zhang Rui <[email protected]>
433-
434-
S: Supported
435-
W: https://01.org/linux-acpi
436-
B: https://bugzilla.kernel.org
437-
F: drivers/acpi/acpi_video.c
438-
439423
ACPI VIOT DRIVER
440424
M: Jean-Philippe Brucker <[email protected]>
441425

arch/x86/kernel/acpi/boot.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ int acpi_fix_pin2_polarity __initdata;
6262

6363
#ifdef CONFIG_X86_LOCAL_APIC
6464
static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE;
65+
static bool acpi_support_online_capable;
6566
#endif
6667

6768
#ifdef CONFIG_X86_IO_APIC
@@ -138,6 +139,8 @@ static int __init acpi_parse_madt(struct acpi_table_header *table)
138139

139140
pr_debug("Local APIC address 0x%08x\n", madt->address);
140141
}
142+
if (madt->header.revision >= 5)
143+
acpi_support_online_capable = true;
141144

142145
default_acpi_madt_oem_check(madt->header.oem_id,
143146
madt->header.oem_table_id);
@@ -239,6 +242,12 @@ acpi_parse_lapic(union acpi_subtable_headers * header, const unsigned long end)
239242
if (processor->id == 0xff)
240243
return 0;
241244

245+
/* don't register processors that can not be onlined */
246+
if (acpi_support_online_capable &&
247+
!(processor->lapic_flags & ACPI_MADT_ENABLED) &&
248+
!(processor->lapic_flags & ACPI_MADT_ONLINE_CAPABLE))
249+
return 0;
250+
242251
/*
243252
* We need to register disabled CPU as well to permit
244253
* counting disabled CPUs. This allows us to size

arch/x86/kernel/acpi/cstate.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,21 @@ void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags,
7979
*/
8080
flags->bm_control = 0;
8181
}
82+
if (c->x86_vendor == X86_VENDOR_AMD && c->x86 >= 0x17) {
83+
/*
84+
* For all AMD Zen or newer CPUs that support C3, caches
85+
* should not be flushed by software while entering C3
86+
* type state. Set bm->check to 1 so that kernel doesn't
87+
* need to execute cache flush operation.
88+
*/
89+
flags->bm_check = 1;
90+
/*
91+
* In current AMD C state implementation ARB_DIS is no longer
92+
* used. So set bm_control to zero to indicate ARB_DIS is not
93+
* required while entering C3 type state.
94+
*/
95+
flags->bm_control = 0;
96+
}
8297
}
8398
EXPORT_SYMBOL(acpi_processor_power_init_bm_check);
8499

drivers/acpi/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ config ACPI_DEBUGGER
7171
if ACPI_DEBUGGER
7272

7373
config ACPI_DEBUGGER_USER
74-
tristate "Userspace debugger accessiblity"
74+
tristate "Userspace debugger accessibility"
7575
depends on DEBUG_FS
7676
help
7777
Export /sys/kernel/debug/acpi/acpidbg for userspace utilities

drivers/acpi/ac.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ static SIMPLE_DEV_PM_OPS(acpi_ac_pm, NULL, acpi_ac_resume);
6161

6262
static int ac_sleep_before_get_state_ms;
6363
static int ac_check_pmic = 1;
64+
static int ac_only;
6465

6566
static struct acpi_driver acpi_ac_driver = {
6667
.name = "ac",
@@ -93,6 +94,11 @@ static int acpi_ac_get_state(struct acpi_ac *ac)
9394
if (!ac)
9495
return -EINVAL;
9596

97+
if (ac_only) {
98+
ac->state = 1;
99+
return 0;
100+
}
101+
96102
status = acpi_evaluate_integer(ac->device->handle, "_PSR", NULL,
97103
&ac->state);
98104
if (ACPI_FAILURE(status)) {
@@ -200,6 +206,12 @@ static int __init ac_do_not_check_pmic_quirk(const struct dmi_system_id *d)
200206
return 0;
201207
}
202208

209+
static int __init ac_only_quirk(const struct dmi_system_id *d)
210+
{
211+
ac_only = 1;
212+
return 0;
213+
}
214+
203215
/* Please keep this list alphabetically sorted */
204216
static const struct dmi_system_id ac_dmi_table[] __initconst = {
205217
{
@@ -209,6 +221,13 @@ static const struct dmi_system_id ac_dmi_table[] __initconst = {
209221
DMI_MATCH(DMI_PRODUCT_NAME, "EF20EA"),
210222
},
211223
},
224+
{
225+
/* Kodlix GK45 returning incorrect state */
226+
.callback = ac_only_quirk,
227+
.matches = {
228+
DMI_MATCH(DMI_PRODUCT_NAME, "GK45"),
229+
},
230+
},
212231
{
213232
/* Lenovo Ideapad Miix 320, AXP288 PMIC, separate fuel-gauge */
214233
.callback = ac_do_not_check_pmic_quirk,

drivers/acpi/acpi_lpss.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -712,14 +712,13 @@ static void __lpss_reg_write(u32 val, struct lpss_private_data *pdata,
712712

713713
static int lpss_reg_read(struct device *dev, unsigned int reg, u32 *val)
714714
{
715-
struct acpi_device *adev;
715+
struct acpi_device *adev = ACPI_COMPANION(dev);
716716
struct lpss_private_data *pdata;
717717
unsigned long flags;
718718
int ret;
719719

720-
ret = acpi_bus_get_device(ACPI_HANDLE(dev), &adev);
721-
if (WARN_ON(ret))
722-
return ret;
720+
if (WARN_ON(!adev))
721+
return -ENODEV;
723722

724723
spin_lock_irqsave(&dev->power.lock, flags);
725724
if (pm_runtime_suspended(dev)) {
@@ -732,6 +731,7 @@ static int lpss_reg_read(struct device *dev, unsigned int reg, u32 *val)
732731
goto out;
733732
}
734733
*val = __lpss_reg_read(pdata, reg);
734+
ret = 0;
735735

736736
out:
737737
spin_unlock_irqrestore(&dev->power.lock, flags);
@@ -750,7 +750,7 @@ static ssize_t lpss_ltr_show(struct device *dev, struct device_attribute *attr,
750750
if (ret)
751751
return ret;
752752

753-
return snprintf(buf, PAGE_SIZE, "%08x\n", ltr_value);
753+
return sysfs_emit(buf, "%08x\n", ltr_value);
754754
}
755755

756756
static ssize_t lpss_ltr_mode_show(struct device *dev,
@@ -1266,7 +1266,8 @@ static int acpi_lpss_platform_notify(struct notifier_block *nb,
12661266
if (!id || !id->driver_data)
12671267
return 0;
12681268

1269-
if (acpi_bus_get_device(ACPI_HANDLE(&pdev->dev), &adev))
1269+
adev = ACPI_COMPANION(&pdev->dev);
1270+
if (!adev)
12701271
return 0;
12711272

12721273
pdata = acpi_driver_data(adev);

drivers/acpi/acpi_pnp.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,6 @@ static const struct acpi_device_id acpi_pnp_device_ids[] = {
156156
{"BRI0A49"}, /* Boca Complete Ofc Communicator 14.4 Data-FAX */
157157
{"BRI1400"}, /* Boca Research 33,600 ACF Modem */
158158
{"BRI3400"}, /* Boca 33.6 Kbps Internal FD34FSVD */
159-
{"BRI0A49"}, /* Boca 33.6 Kbps Internal FD34FSVD */
160-
{"BDP3336"}, /* Best Data Products Inc. Smart One 336F PnP Modem */
161159
{"CPI4050"}, /* Computer Peripherals Inc. EuroViVa CommCenter-33.6 SP PnP */
162160
{"CTL3001"}, /* Creative Labs Phone Blaster 28.8 DSVD PnP Voice */
163161
{"CTL3011"}, /* Creative Labs Modem Blaster 28.8 DSVD PnP Voice */

drivers/acpi/acpica/acglobal.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,8 @@ extern struct acpi_bit_register_info
226226
acpi_gbl_bit_register_info[ACPI_NUM_BITREG];
227227
ACPI_GLOBAL(u8, acpi_gbl_sleep_type_a);
228228
ACPI_GLOBAL(u8, acpi_gbl_sleep_type_b);
229+
ACPI_GLOBAL(u8, acpi_gbl_sleep_type_a_s0);
230+
ACPI_GLOBAL(u8, acpi_gbl_sleep_type_b_s0);
229231

230232
/*****************************************************************************
231233
*

drivers/acpi/acpica/hwesleep.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,17 +147,13 @@ acpi_status acpi_hw_extended_sleep(u8 sleep_state)
147147

148148
acpi_status acpi_hw_extended_wake_prep(u8 sleep_state)
149149
{
150-
acpi_status status;
151150
u8 sleep_type_value;
152151

153152
ACPI_FUNCTION_TRACE(hw_extended_wake_prep);
154153

155-
status = acpi_get_sleep_type_data(ACPI_STATE_S0,
156-
&acpi_gbl_sleep_type_a,
157-
&acpi_gbl_sleep_type_b);
158-
if (ACPI_SUCCESS(status)) {
154+
if (acpi_gbl_sleep_type_a_s0 != ACPI_SLEEP_TYPE_INVALID) {
159155
sleep_type_value =
160-
((acpi_gbl_sleep_type_a << ACPI_X_SLEEP_TYPE_POSITION) &
156+
((acpi_gbl_sleep_type_a_s0 << ACPI_X_SLEEP_TYPE_POSITION) &
161157
ACPI_X_SLEEP_TYPE_MASK);
162158

163159
(void)acpi_write((u64)(sleep_type_value | ACPI_X_SLEEP_ENABLE),

0 commit comments

Comments
 (0)