ACPI: acpi_dev_irq_override(): Check DMI match last
PATCH 1/1 ACPI: acpi_dev_irq_override(): Check DMI match last
acpi_dev_irq_override() gets called approx. 30 times during boot (15 legacy IRQs * 2 override_table entries). Of these 30 calls at max 1 will match the non DMI checks done by acpi_dev_irq_override(). The dmi_check_system() check is by far the most expensive check done by acpi_dev_irq_override(), make this call the last check done by acpi_dev_irq_override() so that it will be called at max 1 time instead of 30 times.
--- drivers/acpi/resource.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/acpi/resource.c +3 -3
@@ -678,11 +678,11 @@ static bool acpi_dev_irq_override(u32 gsi, u8 triggering, u8 polarity,for (i =0 ; i <ARRAY_SIZE (override_table); i++) {const struct irq_override_cmp *entry = &override_table[i]; -if (dmi_check_system (entry->system) && - entry->irq == gsi && +if (entry->irq == gsi && entry->triggering == triggering && entry->polarity == polarity && - entry->shareable == shareable) + entry->shareable == shareable && +dmi_check_system (entry->system))return entry->override; }
Signature · 1 line
2.47.1
Quoted 8 lines · Hans de Goede
acpi_dev_irq_override()gets called approx. 30 times during boot (15 legacy IRQs * 2override_tableentries). Of these 30 calls at max 1 will match the non DMI checks done byacpi_dev_irq_override(). Thedmi_check_system()check is by far the most expensive check done byacpi_dev_irq_override(), make this call the last check done byacpi_dev_irq_override()so that it will be called at max 1 time instead of 30 times.Signed-off-by Hans de Goede <[email protected]>
Quoted 23 lines
--- drivers/acpi/resource.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/acpi/resource.c +3
-3@@ -678,11 +678,11 @@ static bool acpi_dev_irq_override(u32 gsi, u8 triggering, u8 polarity,for (i =0 ; i <ARRAY_SIZE (override_table); i++) {const struct irq_override_cmp *entry = &override_table[i]; -if (dmi_check_system (entry->system) && - entry->irq == gsi && +if (entry->irq == gsi && entry->triggering == triggering && entry->polarity == polarity && - entry->shareable == shareable) + entry->shareable == shareable && +dmi_check_system (entry->system))return entry->override; }
Quoted 9 lines · Mario Limonciello
Quoted 7 lines · Hans de Goede
acpi_dev_irq_override()gets called approx. 30 times during boot (15 legacy IRQs * 2override_tableentries). Of these 30 calls at max 1 will match the non DMI checks done byacpi_dev_irq_override(). Thedmi_check_system()check is by far the most expensive check done byacpi_dev_irq_override(), make this call the last check done byacpi_dev_irq_override()so that it will be called at max 1 time instead of 30 times.
Quoted 3 lines
Quoted 1 line
Signed-off-by Hans de Goede <[email protected]>Reviewed-by Mario Limonciello <[email protected]>
Applied as 6.13-rc material, thanks!