From 117478c9d710dc616b4446d12eddca3c1997266b Mon Sep 17 00:00:00 2001 From: Armin Wolf Date: Sun, 9 Jun 2024 23:09:08 +0200 Subject: ACPI: acpi_pad: Still evaluate _OST when _PUR evaluation fails The ACPI specification says that if no action was performed when processing the _PUR object, _OST should still be evaluated, albeit with a different status code. Evaluate _OST even when evaluating _PUR fails, to signal the firmware that no action was performed. Compile-tested only. Signed-off-by: Armin Wolf Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpi_pad.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c index bd1ad07f0290..350d3a892889 100644 --- a/drivers/acpi/acpi_pad.c +++ b/drivers/acpi/acpi_pad.c @@ -25,6 +25,10 @@ #define ACPI_PROCESSOR_AGGREGATOR_CLASS "acpi_pad" #define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator" #define ACPI_PROCESSOR_AGGREGATOR_NOTIFY 0x80 + +#define ACPI_PROCESSOR_AGGREGATOR_STATUS_SUCCESS 0 +#define ACPI_PROCESSOR_AGGREGATOR_STATUS_NO_ACTION 1 + static DEFINE_MUTEX(isolated_cpus_lock); static DEFINE_MUTEX(round_robin_lock); @@ -382,16 +386,23 @@ static void acpi_pad_handle_notify(acpi_handle handle) .length = 4, .pointer = (void *)&idle_cpus, }; + u32 status; mutex_lock(&isolated_cpus_lock); num_cpus = acpi_pad_pur(handle); if (num_cpus < 0) { - mutex_unlock(&isolated_cpus_lock); - return; + /* The ACPI specification says that if no action was performed when + * processing the _PUR object, _OST should still be evaluated, albeit + * with a different status code. + */ + status = ACPI_PROCESSOR_AGGREGATOR_STATUS_NO_ACTION; + } else { + status = ACPI_PROCESSOR_AGGREGATOR_STATUS_SUCCESS; + acpi_pad_idle_cpus(num_cpus); } - acpi_pad_idle_cpus(num_cpus); + idle_cpus = acpi_pad_idle_cpus_num(); - acpi_evaluate_ost(handle, ACPI_PROCESSOR_AGGREGATOR_NOTIFY, 0, ¶m); + acpi_evaluate_ost(handle, ACPI_PROCESSOR_AGGREGATOR_NOTIFY, status, ¶m); mutex_unlock(&isolated_cpus_lock); } -- cgit From c7cfe9bfceb7a959f04d75a0fa805314bf2a0c6f Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Tue, 18 Jun 2024 16:42:25 -0500 Subject: ACPI: processor: Downgrade Intel _OSC and _PDC messages to debug Commit 95272641338a ("ACPI: processor: Use _OSC to convey OSPM processor support information") introduced messages related to determining processor support from the firmware. The UUID 4077A616-290C-47BE-9EBD-D87058713953 and _PDC methods are only used on Intel platforms, but all X86 platforms emit the messages. Attempting to evaluate them and showing messages on which are used is unnecessary for most users. Downgrade the messages to debug instead. Signed-off-by: Mario Limonciello Link: https://patch.msgid.link/20240618214225.50953-1-mario.limonciello@amd.com Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpi_processor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c index 7a0dd35d62c9..e82ec4f126bc 100644 --- a/drivers/acpi/acpi_processor.c +++ b/drivers/acpi/acpi_processor.c @@ -598,9 +598,9 @@ static bool __init acpi_early_processor_osc(void) void __init acpi_early_processor_control_setup(void) { if (acpi_early_processor_osc()) { - pr_info("_OSC evaluated successfully for all CPUs\n"); + pr_debug("_OSC evaluated successfully for all CPUs\n"); } else { - pr_info("_OSC evaluation for CPUs failed, trying _PDC\n"); + pr_debug("_OSC evaluation for CPUs failed, trying _PDC\n"); acpi_early_processor_set_pdc(); } } -- cgit From dc41751f9e07889d078e3f06adb6e892c80b7c10 Mon Sep 17 00:00:00 2001 From: Tamim Khan Date: Tue, 2 Jul 2024 08:58:06 -0400 Subject: ACPI: resource: Skip IRQ override on Asus Vivobook Pro N6506MU Like various other Asus laptops, the Asus Vivobook Pro N6506MV has a DSDT table that describes IRQ 1 as ActiveLow while the kernel is overriding it to Edge_High. This prevents the internal keyboard from working. This patch prevents this issue by adding this laptop to the override table that prevents the kernel from overriding this IRQ Link: https://bugzilla.kernel.org/show_bug.cgi?id=218954 Tested-by: Lefteris Signed-off-by: Tamim Khan Link: https://patch.msgid.link/20240702125918.34683-1-tamim@fusetak.com Signed-off-by: Rafael J. Wysocki --- drivers/acpi/resource.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c index b5bf8b81a050..b3ae5f9ac551 100644 --- a/drivers/acpi/resource.c +++ b/drivers/acpi/resource.c @@ -524,6 +524,13 @@ static const struct dmi_system_id irq1_level_low_skip_override[] = { DMI_MATCH(DMI_BOARD_NAME, "N6506MV"), }, }, + { + /* Asus Vivobook Pro N6506MU */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_BOARD_NAME, "N6506MU"), + }, + }, { /* LG Electronics 17U70P */ .matches = { -- cgit From cfc38d432dba5601db6ea225742e21715b2b901f Mon Sep 17 00:00:00 2001 From: Muhammad Qasim Abdul Majeed Date: Wed, 3 Jul 2024 13:41:25 +0500 Subject: ACPI: video: Use strscpy() instead of strcpy() Replace strcpy() with strscpy() in the ACPI backlight code. strcpy() has been deprecated because it is generally unsafe, so help to eliminate if from the kernel source. Link: https://github.com/KSPP/linux/issues/88 Signed-off-by: Muhammad Qasim Abdul Majeed Link: https://patch.msgid.link/20240703084124.11530-1-qasim.majeed20@gmail.com [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpi_video.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/acpi/acpi_video.c b/drivers/acpi/acpi_video.c index 1fda30388297..8274a17872ed 100644 --- a/drivers/acpi/acpi_video.c +++ b/drivers/acpi/acpi_video.c @@ -1128,8 +1128,8 @@ static int acpi_video_bus_get_one_device(struct acpi_device *device, void *arg) return -ENOMEM; } - strcpy(acpi_device_name(device), ACPI_VIDEO_DEVICE_NAME); - strcpy(acpi_device_class(device), ACPI_VIDEO_CLASS); + strscpy(acpi_device_name(device), ACPI_VIDEO_DEVICE_NAME); + strscpy(acpi_device_class(device), ACPI_VIDEO_CLASS); data->device_id = device_id; data->video = video; @@ -2010,8 +2010,8 @@ static int acpi_video_bus_add(struct acpi_device *device) } video->device = device; - strcpy(acpi_device_name(device), ACPI_VIDEO_BUS_NAME); - strcpy(acpi_device_class(device), ACPI_VIDEO_CLASS); + strscpy(acpi_device_name(device), ACPI_VIDEO_BUS_NAME); + strscpy(acpi_device_class(device), ACPI_VIDEO_CLASS); device->driver_data = video; acpi_video_bus_find_cap(video); -- cgit From d010a0282e045f02895f88299e5442506585b46c Mon Sep 17 00:00:00 2001 From: Orlando Chamberlain Date: Fri, 5 Jul 2024 13:56:24 +0000 Subject: ACPI: video: force native for some T2 macbooks The intel backlight is needed for these, previously users had nothing in /sys/class/backlight. Signed-off-by: Orlando Chamberlain Signed-off-by: Aditya Garg Reviewed-by: Hans de Goede Link: https://patch.msgid.link/3DA0EAE3-9EB7-492B-96FC-988503BBDCCC@live.com Signed-off-by: Rafael J. Wysocki --- drivers/acpi/video_detect.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c index 2cc3821b2b16..c11cbe5b6eaa 100644 --- a/drivers/acpi/video_detect.c +++ b/drivers/acpi/video_detect.c @@ -539,6 +539,14 @@ static const struct dmi_system_id video_detect_dmi_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "iMac12,2"), }, }, + { + .callback = video_detect_force_native, + /* Apple MacBook Air 9,1 */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), + DMI_MATCH(DMI_PRODUCT_NAME, "MacBookAir9,1"), + }, + }, { /* https://bugzilla.redhat.com/show_bug.cgi?id=1217249 */ .callback = video_detect_force_native, @@ -548,6 +556,14 @@ static const struct dmi_system_id video_detect_dmi_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro12,1"), }, }, + { + .callback = video_detect_force_native, + /* Apple MacBook Pro 16,2 */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), + DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro16,2"), + }, + }, { .callback = video_detect_force_native, /* Dell Inspiron N4010 */ -- cgit From e2e7f037b400aebbb3892d8010fb3d9cae6f426e Mon Sep 17 00:00:00 2001 From: Tamim Khan Date: Sun, 7 Jul 2024 20:05:50 -0400 Subject: ACPI: resource: Skip IRQ override on Asus Vivobook Pro N6506MJ Similar to other Asus Vivobooks, the Asus Vivobook Pro N6506MJ has a DSDT table that describes IRQ 1 as ActiveLow, whereas the kernel overrides it to Edge_High. This discrepancy prevents the internal keyboard from functioning properly. This patch resolves this issue by adding this laptop to the override table that prevents the kernel from overriding this IRQ. Link: https://bugzilla.kernel.org/show_bug.cgi?id=218929 Tested-by: Amber Connelly Signed-off-by: Tamim Khan Link: https://patch.msgid.link/20240708000557.83539-1-tamim@fusetak.com Signed-off-by: Rafael J. Wysocki --- drivers/acpi/resource.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c index b3ae5f9ac551..df5d5a554b38 100644 --- a/drivers/acpi/resource.c +++ b/drivers/acpi/resource.c @@ -531,6 +531,13 @@ static const struct dmi_system_id irq1_level_low_skip_override[] = { DMI_MATCH(DMI_BOARD_NAME, "N6506MU"), }, }, + { + /* Asus Vivobook Pro N6506MJ */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_BOARD_NAME, "N6506MJ"), + }, + }, { /* LG Electronics 17U70P */ .matches = { -- cgit