Skip to content

Commit e69e6e4

Browse files
committed
Merge tag 'acpi-6.15-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull more ACPI updates from Rafael Wysocki: "These are fixes and cleanups on top of the previous ACPI material for 6.15-rc1 merged recently: - Extend the Lenovo Yoga Tab 3 ACPI quirk to skip GPIO event-handlers along with ACPI AC and battery which makes it work with Linux when started in the Windows mode (Hans de Goede) - Prevent the ACPI processor idle driver from being used on systems without _CST and with invalid C2/C3 in FADT in order to restore its previous (and expected) behavior that has been altered inadvertently by a recent code change (Giovanni Gherdovich) - Skip ACPI IRQ override on ASUS Vivobook 14 X1404VAP to make the internal keyboard work on it (Paul Menzel) - Make the ACPI backlight driver handle fetching EDID passed as ACPI_TYPE_PACKAGE which is not specification-compliant, but has been encountered in the field (Gergo Koteles) - Simplify the aggregation of choices in the ACPI platform-profile driver which has been unlocked by recent modifications of that driver (Kurt Borja) - Use str_enabled_disabled() instead of hardcoded strings in the ACPI code related to NUMA (Thorsten Blum) - Add Intel OC Watchdog device IDs to non-PNP device list to prevent PNP from claiming the devices that carry these IDs in which case non-PNP drivers cannot bind to them (Diogo Ivo)" * tag 'acpi-6.15-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: video: Handle fetching EDID as ACPI_TYPE_PACKAGE ACPI: processor: idle: Return an error if both P_LVL{2,3} idle states are invalid ACPI: platform_profile: Optimize _aggregate_choices() ACPI: x86: Extend Lenovo Yoga Tab 3 quirk with skip GPIO event-handlers ACPI: resource: Skip IRQ override on ASUS Vivobook 14 X1404VAP ACPI: PNP: Add Intel OC Watchdog IDs to non-PNP device list ACPI: NUMA: Use str_enabled_disabled() helper function
2 parents 0a87d6b + 5bf46fe commit e69e6e4

File tree

7 files changed

+36
-24
lines changed

7 files changed

+36
-24
lines changed

drivers/acpi/acpi_pnp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,10 @@ static bool acpi_pnp_match(const char *idstr, const struct acpi_device_id **matc
353353
* device represented by it.
354354
*/
355355
static const struct acpi_device_id acpi_nonpnp_device_ids[] = {
356+
{"INT3F0D"},
356357
{"INTC1080"},
357358
{"INTC1081"},
359+
{"INTC1099"},
358360
{""},
359361
};
360362

drivers/acpi/acpi_video.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,13 @@ acpi_video_device_EDID(struct acpi_video_device *device, void **edid, int length
649649

650650
obj = buffer.pointer;
651651

652+
/*
653+
* Some buggy implementations incorrectly return the EDID buffer in an ACPI package.
654+
* In this case, extract the buffer from the package.
655+
*/
656+
if (obj && obj->type == ACPI_TYPE_PACKAGE && obj->package.count == 1)
657+
obj = &obj->package.elements[0];
658+
652659
if (obj && obj->type == ACPI_TYPE_BUFFER) {
653660
*edid = kmemdup(obj->buffer.pointer, obj->buffer.length, GFP_KERNEL);
654661
ret = *edid ? obj->buffer.length : -ENOMEM;
@@ -658,7 +665,7 @@ acpi_video_device_EDID(struct acpi_video_device *device, void **edid, int length
658665
ret = -EFAULT;
659666
}
660667

661-
kfree(obj);
668+
kfree(buffer.pointer);
662669
return ret;
663670
}
664671

drivers/acpi/numa/srat.c

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <linux/nodemask.h>
1919
#include <linux/topology.h>
2020
#include <linux/numa_memblks.h>
21+
#include <linux/string_choices.h>
2122

2223
static nodemask_t nodes_found_map = NODE_MASK_NONE;
2324

@@ -188,8 +189,7 @@ acpi_table_print_srat_entry(struct acpi_subtable_header *header)
188189
pr_debug("SRAT Processor (id[0x%02x] eid[0x%02x]) in proximity domain %d %s\n",
189190
p->apic_id, p->local_sapic_eid,
190191
p->proximity_domain_lo,
191-
(p->flags & ACPI_SRAT_CPU_ENABLED) ?
192-
"enabled" : "disabled");
192+
str_enabled_disabled(p->flags & ACPI_SRAT_CPU_ENABLED));
193193
}
194194
break;
195195

@@ -201,8 +201,7 @@ acpi_table_print_srat_entry(struct acpi_subtable_header *header)
201201
(unsigned long long)p->base_address,
202202
(unsigned long long)p->length,
203203
p->proximity_domain,
204-
(p->flags & ACPI_SRAT_MEM_ENABLED) ?
205-
"enabled" : "disabled",
204+
str_enabled_disabled(p->flags & ACPI_SRAT_MEM_ENABLED),
206205
(p->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) ?
207206
" hot-pluggable" : "",
208207
(p->flags & ACPI_SRAT_MEM_NON_VOLATILE) ?
@@ -217,8 +216,7 @@ acpi_table_print_srat_entry(struct acpi_subtable_header *header)
217216
pr_debug("SRAT Processor (x2apicid[0x%08x]) in proximity domain %d %s\n",
218217
p->apic_id,
219218
p->proximity_domain,
220-
(p->flags & ACPI_SRAT_CPU_ENABLED) ?
221-
"enabled" : "disabled");
219+
str_enabled_disabled(p->flags & ACPI_SRAT_CPU_ENABLED));
222220
}
223221
break;
224222

@@ -229,8 +227,7 @@ acpi_table_print_srat_entry(struct acpi_subtable_header *header)
229227
pr_debug("SRAT Processor (acpi id[0x%04x]) in proximity domain %d %s\n",
230228
p->acpi_processor_uid,
231229
p->proximity_domain,
232-
(p->flags & ACPI_SRAT_GICC_ENABLED) ?
233-
"enabled" : "disabled");
230+
str_enabled_disabled(p->flags & ACPI_SRAT_GICC_ENABLED));
234231
}
235232
break;
236233

@@ -248,8 +245,7 @@ acpi_table_print_srat_entry(struct acpi_subtable_header *header)
248245
*(u16 *)(&p->device_handle[0]),
249246
*(u16 *)(&p->device_handle[2]),
250247
p->proximity_domain,
251-
(p->flags & ACPI_SRAT_GENERIC_AFFINITY_ENABLED) ?
252-
"enabled" : "disabled");
248+
str_enabled_disabled(p->flags & ACPI_SRAT_GENERIC_AFFINITY_ENABLED));
253249
} else {
254250
/*
255251
* In this case we can rely on the device having a
@@ -259,8 +255,7 @@ acpi_table_print_srat_entry(struct acpi_subtable_header *header)
259255
(char *)(&p->device_handle[0]),
260256
(char *)(&p->device_handle[8]),
261257
p->proximity_domain,
262-
(p->flags & ACPI_SRAT_GENERIC_AFFINITY_ENABLED) ?
263-
"enabled" : "disabled");
258+
str_enabled_disabled(p->flags & ACPI_SRAT_GENERIC_AFFINITY_ENABLED));
264259
}
265260
}
266261
break;
@@ -272,8 +267,7 @@ acpi_table_print_srat_entry(struct acpi_subtable_header *header)
272267
pr_debug("SRAT Processor (acpi id[0x%04x]) in proximity domain %d %s\n",
273268
p->acpi_processor_uid,
274269
p->proximity_domain,
275-
(p->flags & ACPI_SRAT_RINTC_ENABLED) ?
276-
"enabled" : "disabled");
270+
str_enabled_disabled(p->flags & ACPI_SRAT_RINTC_ENABLED));
277271
}
278272
break;
279273

drivers/acpi/platform_profile.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,8 @@ static const struct class platform_profile_class = {
245245
/**
246246
* _aggregate_choices - Aggregate the available profile choices
247247
* @dev: The device
248-
* @arg: struct aggregate_choices_data
248+
* @arg: struct aggregate_choices_data, with it's aggregate member bitmap
249+
* initially filled with ones
249250
*
250251
* Return: 0 on success, -errno on failure
251252
*/
@@ -256,12 +257,10 @@ static int _aggregate_choices(struct device *dev, void *arg)
256257
struct platform_profile_handler *handler;
257258

258259
lockdep_assert_held(&profile_lock);
260+
259261
handler = to_pprof_handler(dev);
260262
bitmap_or(tmp, handler->choices, handler->hidden_choices, PLATFORM_PROFILE_LAST);
261-
if (test_bit(PLATFORM_PROFILE_LAST, data->aggregate))
262-
bitmap_copy(data->aggregate, tmp, PLATFORM_PROFILE_LAST);
263-
else
264-
bitmap_and(data->aggregate, tmp, data->aggregate, PLATFORM_PROFILE_LAST);
263+
bitmap_and(data->aggregate, tmp, data->aggregate, PLATFORM_PROFILE_LAST);
265264
data->count++;
266265

267266
return 0;
@@ -305,7 +304,6 @@ static ssize_t platform_profile_choices_show(struct kobject *kobj,
305304
};
306305
int err;
307306

308-
set_bit(PLATFORM_PROFILE_LAST, data.aggregate);
309307
scoped_cond_guard(mutex_intr, return -ERESTARTSYS, &profile_lock) {
310308
err = class_for_each_device(&platform_profile_class, NULL,
311309
&data, _aggregate_choices);
@@ -422,7 +420,7 @@ static ssize_t platform_profile_store(struct kobject *kobj,
422420
i = sysfs_match_string(profile_names, buf);
423421
if (i < 0 || i == PLATFORM_PROFILE_CUSTOM)
424422
return -EINVAL;
425-
set_bit(PLATFORM_PROFILE_LAST, data.aggregate);
423+
426424
scoped_cond_guard(mutex_intr, return -ERESTARTSYS, &profile_lock) {
427425
ret = class_for_each_device(&platform_profile_class, NULL,
428426
&data, _aggregate_choices);
@@ -502,7 +500,6 @@ int platform_profile_cycle(void)
502500
enum platform_profile_option profile = PLATFORM_PROFILE_LAST;
503501
int err;
504502

505-
set_bit(PLATFORM_PROFILE_LAST, data.aggregate);
506503
scoped_cond_guard(mutex_intr, return -ERESTARTSYS, &profile_lock) {
507504
err = class_for_each_device(&platform_profile_class, NULL,
508505
&profile, _aggregate_profiles);

drivers/acpi/processor_idle.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,10 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr)
268268
ACPI_CX_DESC_LEN, "ACPI P_LVL3 IOPORT 0x%x",
269269
pr->power.states[ACPI_STATE_C3].address);
270270

271+
if (!pr->power.states[ACPI_STATE_C2].address &&
272+
!pr->power.states[ACPI_STATE_C3].address)
273+
return -ENODEV;
274+
271275
return 0;
272276
}
273277

drivers/acpi/resource.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,13 @@ static const struct dmi_system_id irq1_level_low_skip_override[] = {
440440
DMI_MATCH(DMI_BOARD_NAME, "S5602ZA"),
441441
},
442442
},
443+
{
444+
/* Asus Vivobook X1404VAP */
445+
.matches = {
446+
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
447+
DMI_MATCH(DMI_BOARD_NAME, "X1404VAP"),
448+
},
449+
},
443450
{
444451
/* Asus Vivobook X1504VAP */
445452
.matches = {

drivers/acpi/x86/utils.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,8 @@ static const struct dmi_system_id acpi_quirk_skip_dmi_ids[] = {
374374
DMI_MATCH(DMI_PRODUCT_VERSION, "Blade3-10A-001"),
375375
},
376376
.driver_data = (void *)(ACPI_QUIRK_SKIP_I2C_CLIENTS |
377-
ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY),
377+
ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY |
378+
ACPI_QUIRK_SKIP_GPIO_EVENT_HANDLERS),
378379
},
379380
{
380381
/* Medion Lifetab S10346 */

0 commit comments

Comments
 (0)