Skip to content

Commit a9ac763

Browse files
Jiri Slaby (SUSE)gregkh
authored andcommitted
ACPI: resource: do IRQ override on LENOVO IdeaPad
[ Upstream commit bfcdf58 ] LENOVO IdeaPad Flex 5 is ryzen-5 based and the commit below removed IRQ overriding for those. This broke touchscreen and trackpad: i2c_designware AMDI0010:00: controller timed out i2c_designware AMDI0010:03: controller timed out i2c_hid_acpi i2c-MSFT0001:00: failed to reset device: -61 i2c_designware AMDI0010:03: controller timed out ... i2c_hid_acpi i2c-MSFT0001:00: can't add hid device: -61 i2c_hid_acpi: probe of i2c-MSFT0001:00 failed with error -61 White-list this specific model in the override_table. For this to work, the ZEN test needs to be put below the table walk. Fixes: 37c81d9f1d1b (ACPI: resource: skip IRQ override on AMD Zen platforms) Link: https://bugzilla.suse.com/show_bug.cgi?id=1203794 Signed-off-by: Jiri Slaby (SUSE) <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]> Stable-dep-of: f3cb9b7 ("ACPI: resource: do IRQ override on Lenovo 14ALC7") Signed-off-by: Sasha Levin <[email protected]>
1 parent 5fe31f2 commit a9ac763

File tree

1 file changed

+28
-14
lines changed

1 file changed

+28
-14
lines changed

drivers/acpi/resource.c

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -417,24 +417,49 @@ static const struct dmi_system_id asus_laptop[] = {
417417
{ }
418418
};
419419

420+
static const struct dmi_system_id lenovo_82ra[] = {
421+
{
422+
.ident = "LENOVO IdeaPad Flex 5 16ALC7",
423+
.matches = {
424+
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
425+
DMI_MATCH(DMI_PRODUCT_NAME, "82RA"),
426+
},
427+
},
428+
{ }
429+
};
430+
420431
struct irq_override_cmp {
421432
const struct dmi_system_id *system;
422433
unsigned char irq;
423434
unsigned char triggering;
424435
unsigned char polarity;
425436
unsigned char shareable;
437+
bool override;
426438
};
427439

428-
static const struct irq_override_cmp skip_override_table[] = {
429-
{ medion_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0 },
430-
{ asus_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0 },
440+
static const struct irq_override_cmp override_table[] = {
441+
{ medion_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false },
442+
{ asus_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false },
443+
{ lenovo_82ra, 6, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, true },
444+
{ lenovo_82ra, 10, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, true },
431445
};
432446

433447
static bool acpi_dev_irq_override(u32 gsi, u8 triggering, u8 polarity,
434448
u8 shareable)
435449
{
436450
int i;
437451

452+
for (i = 0; i < ARRAY_SIZE(override_table); i++) {
453+
const struct irq_override_cmp *entry = &override_table[i];
454+
455+
if (dmi_check_system(entry->system) &&
456+
entry->irq == gsi &&
457+
entry->triggering == triggering &&
458+
entry->polarity == polarity &&
459+
entry->shareable == shareable)
460+
return entry->override;
461+
}
462+
438463
#ifdef CONFIG_X86
439464
/*
440465
* IRQ override isn't needed on modern AMD Zen systems and
@@ -445,17 +470,6 @@ static bool acpi_dev_irq_override(u32 gsi, u8 triggering, u8 polarity,
445470
return false;
446471
#endif
447472

448-
for (i = 0; i < ARRAY_SIZE(skip_override_table); i++) {
449-
const struct irq_override_cmp *entry = &skip_override_table[i];
450-
451-
if (dmi_check_system(entry->system) &&
452-
entry->irq == gsi &&
453-
entry->triggering == triggering &&
454-
entry->polarity == polarity &&
455-
entry->shareable == shareable)
456-
return false;
457-
}
458-
459473
return true;
460474
}
461475

0 commit comments

Comments
 (0)