Skip to content

Commit 3dd2fcf

Browse files
committed
Merge branches 'acpi-video', 'acpi-resource', 'acpi-pad' and 'acpi-misc'
Merge ACPI backlight (video) driver update, ACPI resource management updates, an ACPI processor aggregator device (PAD) driver fix, and miscellaneous ACPI updates for 6.12-rc1: - Add force_vendor quirk for Panasonic Toughbook CF-18 in the ACPI backlight driver (Hans de Goede). - Make the DMI checks related to backlight handling on Lenovo Yoga Tab 3 X90F less strict (Hans de Goede). - Enforce native backlight handling on Apple MacbookPro9,2 (Esther Shimanovich). - Add IRQ override quirks for Asus Vivobook Go E1404GAB and MECHREV GM7XG0M, and refine the TongFang GMxXGxx quirk (Li Chen, Tamim Khan, Werner Sembach). - Fix crash in exit_round_robin() in the ACPI processor aggregator device (PAD) driver (Seiji Nishikawa). - Define and use symbols for device and class name lengths in the ACPI bus type code and make the code use strscpy() instead of strcpy() in several places (Muhammad Qasim Abdul Majeed). * acpi-video: ACPI: video: Add force_vendor quirk for Panasonic Toughbook CF-18 ACPI: x86: Make Lenovo Yoga Tab 3 X90F DMI match less strict ACPI: video: Make Lenovo Yoga Tab 3 X90F DMI match less strict ACPI: video: force native for Apple MacbookPro9,2 * acpi-resource: ACPI: resource: Add another DMI match for the TongFang GMxXGxx ACPI: resource: Skip IRQ override on Asus Vivobook Go E1404GAB ACPI: resource: Do IRQ override on MECHREV GM7XG0M * acpi-pad: ACPI: PAD: fix crash in exit_round_robin() * acpi-misc: ACPI: button: Use strscpy() instead of strcpy() ACPI: bus: Define and use symbols for device and class name lengths ACPI: battery : Use strscpy() instead of strcpy() ACPI: acpi_processor: Use strscpy instead() of strcpy() ACPI: PAD: Use strscpy() instead of strcpy() ACPI: AC: Use strscpy() instead of strcpy()
5 parents bb19180 + eb7b0f1 + a98cfe6 + 0a2ed70 + 7fcf82e commit 3dd2fcf

File tree

8 files changed

+52
-15
lines changed

8 files changed

+52
-15
lines changed

drivers/acpi/ac.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,8 @@ static int acpi_ac_probe(struct platform_device *pdev)
213213
return -ENOMEM;
214214

215215
ac->device = adev;
216-
strcpy(acpi_device_name(adev), ACPI_AC_DEVICE_NAME);
217-
strcpy(acpi_device_class(adev), ACPI_AC_CLASS);
216+
strscpy(acpi_device_name(adev), ACPI_AC_DEVICE_NAME);
217+
strscpy(acpi_device_class(adev), ACPI_AC_CLASS);
218218

219219
platform_set_drvdata(pdev, ac);
220220

drivers/acpi/acpi_pad.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,10 @@ static void exit_round_robin(unsigned int tsk_index)
136136
{
137137
struct cpumask *pad_busy_cpus = to_cpumask(pad_busy_cpus_bits);
138138

139-
cpumask_clear_cpu(tsk_in_cpu[tsk_index], pad_busy_cpus);
140-
tsk_in_cpu[tsk_index] = -1;
139+
if (tsk_in_cpu[tsk_index] != -1) {
140+
cpumask_clear_cpu(tsk_in_cpu[tsk_index], pad_busy_cpus);
141+
tsk_in_cpu[tsk_index] = -1;
142+
}
141143
}
142144

143145
static unsigned int idle_pct = 5; /* percentage */
@@ -428,8 +430,8 @@ static int acpi_pad_probe(struct platform_device *pdev)
428430
struct acpi_device *adev = ACPI_COMPANION(&pdev->dev);
429431
acpi_status status;
430432

431-
strcpy(acpi_device_name(adev), ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME);
432-
strcpy(acpi_device_class(adev), ACPI_PROCESSOR_AGGREGATOR_CLASS);
433+
strscpy(acpi_device_name(adev), ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME);
434+
strscpy(acpi_device_class(adev), ACPI_PROCESSOR_AGGREGATOR_CLASS);
433435

434436
status = acpi_install_notify_handler(adev->handle,
435437
ACPI_DEVICE_NOTIFY, acpi_pad_notify, adev);

drivers/acpi/acpi_processor.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,8 @@ static int acpi_processor_add(struct acpi_device *device,
436436
}
437437

438438
pr->handle = device->handle;
439-
strcpy(acpi_device_name(device), ACPI_PROCESSOR_DEVICE_NAME);
440-
strcpy(acpi_device_class(device), ACPI_PROCESSOR_CLASS);
439+
strscpy(acpi_device_name(device), ACPI_PROCESSOR_DEVICE_NAME);
440+
strscpy(acpi_device_class(device), ACPI_PROCESSOR_CLASS);
441441
device->driver_data = pr;
442442

443443
result = acpi_processor_get_info(device);

drivers/acpi/button.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -547,20 +547,20 @@ static int acpi_button_add(struct acpi_device *device)
547547
!strcmp(hid, ACPI_BUTTON_HID_POWERF)) {
548548
button->type = ACPI_BUTTON_TYPE_POWER;
549549
handler = acpi_button_notify;
550-
strcpy(name, ACPI_BUTTON_DEVICE_NAME_POWER);
550+
strscpy(name, ACPI_BUTTON_DEVICE_NAME_POWER, MAX_ACPI_DEVICE_NAME_LEN);
551551
sprintf(class, "%s/%s",
552552
ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_POWER);
553553
} else if (!strcmp(hid, ACPI_BUTTON_HID_SLEEP) ||
554554
!strcmp(hid, ACPI_BUTTON_HID_SLEEPF)) {
555555
button->type = ACPI_BUTTON_TYPE_SLEEP;
556556
handler = acpi_button_notify;
557-
strcpy(name, ACPI_BUTTON_DEVICE_NAME_SLEEP);
557+
strscpy(name, ACPI_BUTTON_DEVICE_NAME_SLEEP, MAX_ACPI_DEVICE_NAME_LEN);
558558
sprintf(class, "%s/%s",
559559
ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_SLEEP);
560560
} else if (!strcmp(hid, ACPI_BUTTON_HID_LID)) {
561561
button->type = ACPI_BUTTON_TYPE_LID;
562562
handler = acpi_lid_notify;
563-
strcpy(name, ACPI_BUTTON_DEVICE_NAME_LID);
563+
strscpy(name, ACPI_BUTTON_DEVICE_NAME_LID, MAX_ACPI_DEVICE_NAME_LEN);
564564
sprintf(class, "%s/%s",
565565
ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_LID);
566566
input->open = acpi_lid_input_open;

drivers/acpi/resource.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,13 @@ static const struct dmi_system_id irq1_level_low_skip_override[] = {
503503
DMI_MATCH(DMI_BOARD_NAME, "B2502FBA"),
504504
},
505505
},
506+
{
507+
/* Asus Vivobook Go E1404GAB */
508+
.matches = {
509+
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
510+
DMI_MATCH(DMI_BOARD_NAME, "E1404GAB"),
511+
},
512+
},
506513
{
507514
/* Asus Vivobook E1504GA */
508515
.matches = {
@@ -554,6 +561,12 @@ static const struct dmi_system_id irq1_level_low_skip_override[] = {
554561
* to have a working keyboard.
555562
*/
556563
static const struct dmi_system_id irq1_edge_low_force_override[] = {
564+
{
565+
/* MECHREV Jiaolong17KS Series GM7XG0M */
566+
.matches = {
567+
DMI_MATCH(DMI_BOARD_NAME, "GM7XG0M"),
568+
},
569+
},
557570
{
558571
/* XMG APEX 17 (M23) */
559572
.matches = {
@@ -572,6 +585,12 @@ static const struct dmi_system_id irq1_edge_low_force_override[] = {
572585
DMI_MATCH(DMI_BOARD_NAME, "GMxXGxx"),
573586
},
574587
},
588+
{
589+
/* TongFang GMxXGxX/TUXEDO Polaris 15 Gen5 AMD */
590+
.matches = {
591+
DMI_MATCH(DMI_BOARD_NAME, "GMxXGxX"),
592+
},
593+
},
575594
{
576595
/* TongFang GMxXGxx sold as Eluktronics Inc. RP-15 */
577596
.matches = {

drivers/acpi/video_detect.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,14 @@ static const struct dmi_system_id video_detect_dmi_table[] = {
254254
DMI_MATCH(DMI_PRODUCT_NAME, "PCG-FRV35"),
255255
},
256256
},
257+
{
258+
.callback = video_detect_force_vendor,
259+
/* Panasonic Toughbook CF-18 */
260+
.matches = {
261+
DMI_MATCH(DMI_SYS_VENDOR, "Matsushita Electric Industrial"),
262+
DMI_MATCH(DMI_PRODUCT_NAME, "CF-18"),
263+
},
264+
},
257265

258266
/*
259267
* Toshiba models with Transflective display, these need to use
@@ -549,6 +557,14 @@ static const struct dmi_system_id video_detect_dmi_table[] = {
549557
DMI_MATCH(DMI_PRODUCT_NAME, "MacBookAir9,1"),
550558
},
551559
},
560+
{
561+
.callback = video_detect_force_native,
562+
/* Apple MacBook Pro 9,2 */
563+
.matches = {
564+
DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
565+
DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro9,2"),
566+
},
567+
},
552568
{
553569
/* https://bugzilla.redhat.com/show_bug.cgi?id=1217249 */
554570
.callback = video_detect_force_native,
@@ -896,7 +912,6 @@ static const struct dmi_system_id video_detect_dmi_table[] = {
896912
/* Lenovo Yoga Tab 3 Pro YT3-X90F */
897913
.matches = {
898914
DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"),
899-
DMI_MATCH(DMI_PRODUCT_NAME, "CHERRYVIEW D1 PLATFORM"),
900915
DMI_MATCH(DMI_PRODUCT_VERSION, "Blade3-10A-001"),
901916
},
902917
},

drivers/acpi/x86/utils.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,6 @@ static const struct dmi_system_id acpi_quirk_skip_dmi_ids[] = {
355355
/* Lenovo Yoga Tab 3 Pro X90F */
356356
.matches = {
357357
DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"),
358-
DMI_MATCH(DMI_PRODUCT_NAME, "CHERRYVIEW D1 PLATFORM"),
359358
DMI_MATCH(DMI_PRODUCT_VERSION, "Blade3-10A-001"),
360359
},
361360
.driver_data = (void *)(ACPI_QUIRK_SKIP_I2C_CLIENTS |

include/acpi/acpi_bus.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,12 @@ struct acpi_device_dir {
228228

229229
/* Plug and Play */
230230

231+
#define MAX_ACPI_DEVICE_NAME_LEN 40
232+
#define MAX_ACPI_CLASS_NAME_LEN 20
231233
typedef char acpi_bus_id[8];
232234
typedef u64 acpi_bus_address;
233-
typedef char acpi_device_name[40];
234-
typedef char acpi_device_class[20];
235+
typedef char acpi_device_name[MAX_ACPI_DEVICE_NAME_LEN];
236+
typedef char acpi_device_class[MAX_ACPI_CLASS_NAME_LEN];
235237

236238
struct acpi_hardware_id {
237239
struct list_head list;

0 commit comments

Comments
 (0)