diff mbox series

[v2,2/3] ACPI: resource: Always use MADT override IRQ settings for GSI != 1

Message ID 20230808103335.95339-3-hdegoede@redhat.com
State New
Headers show
Series [v2,1/3] ACPI: resource: revert "Remove "Zen" specific match and quirks" | expand

Commit Message

Hans de Goede Aug. 8, 2023, 10:33 a.m. UTC
All the cases, were the DSDT IRQ settings should be used instead of
the MADT override, are for IRQ 1 (the PS/2 kbd IRQ).

Simplify things by always honering the override for GSI != 1
(for non DMI quirked cases).

This allows removing the DMI quirks to honor the override for
some non IRQ 1 IRQs on some AMD ZEN based Lenovo models.

Fixes: a9c4a912b7dc ("ACPI: resource: Remove "Zen" specific match and quirks")
Cc: Mario Limonciello <mario.limonciello@amd.com>
Cc: Linux regressions mailing list <regressions@lists.linux.dev>
Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/acpi/resource.c | 28 ++++++++--------------------
 1 file changed, 8 insertions(+), 20 deletions(-)

Comments

August Wikerfors Aug. 8, 2023, 8:31 p.m. UTC | #1
On 2023-08-08 12:33, Hans de Goede wrote:
> All the cases, were the DSDT IRQ settings should be used instead of
> the MADT override, are for IRQ 1 (the PS/2 kbd IRQ).
> 
> Simplify things by always honering the override for GSI != 1
> (for non DMI quirked cases).
> 
> This allows removing the DMI quirks to honor the override for
> some non IRQ 1 IRQs on some AMD ZEN based Lenovo models.
> 
> Fixes: a9c4a912b7dc ("ACPI: resource: Remove "Zen" specific match and quirks")
> Cc: Mario Limonciello <mario.limonciello@amd.com>
> Cc: Linux regressions mailing list <regressions@lists.linux.dev>
> Cc: stable@vger.kernel.org
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>   drivers/acpi/resource.c | 28 ++++++++--------------------
>   1 file changed, 8 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c
> index 0800a9d77558..840b938a5fb0 100644
> --- a/drivers/acpi/resource.c
> +++ b/drivers/acpi/resource.c
> @@ -470,24 +470,6 @@ static const struct dmi_system_id asus_laptop[] = {
>   	{ }
>   };
>   
> -static const struct dmi_system_id lenovo_laptop[] = {
> -	{
> -		.ident = "LENOVO IdeaPad Flex 5 14ALC7",
> -		.matches = {
> -			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
> -			DMI_MATCH(DMI_PRODUCT_NAME, "82R9"),
> -		},
> -	},
> -	{
> -		.ident = "LENOVO IdeaPad Flex 5 16ALC7",
> -		.matches = {
> -			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
> -			DMI_MATCH(DMI_PRODUCT_NAME, "82RA"),
> -		},
> -	},
> -	{ }
> -};
> -
>   static const struct dmi_system_id tongfang_gm_rg[] = {
>   	{
>   		.ident = "TongFang GMxRGxx/XMG CORE 15 (M22)/TUXEDO Stellaris 15 Gen4 AMD",
> @@ -539,8 +521,6 @@ struct irq_override_cmp {
>   static const struct irq_override_cmp override_table[] = {
>   	{ medion_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false },
>   	{ asus_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false },
> -	{ lenovo_laptop, 6, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, true },
> -	{ lenovo_laptop, 10, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, true },
>   	{ tongfang_gm_rg, 1, ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_LOW, 1, true },
>   	{ maingear_laptop, 1, ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_LOW, 1, true },
>   	{ lg_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false },
> @@ -562,6 +542,14 @@ static bool acpi_dev_irq_override(u32 gsi, u8 triggering, u8 polarity,
>   			return entry->override;
>   	}
>   
> +	/*
> +	 * Always use the MADT override info, except for IRQ 1 for IRQ1
> +	 * the DSDT IRQ settings should sometimes be used otherwise
> +	 * PS/2 keyboards will not work.
> +	 */
> +	if (gsi != 1)
> +		return true;
> +
>   #ifdef CONFIG_X86
>   	/*
>   	 * IRQ override isn't needed on modern AMD Zen systems and

I don't think this will work for the Lenovo ThinkPad neo 14 because 
according to https://bugzilla.kernel.org/show_bug.cgi?id=217731 it needs 
the override to also be skipped for IRQ 12.

Regards,
August Wikerfors
Hans de Goede Aug. 9, 2023, 8:45 a.m. UTC | #2
Hi August,

On 8/8/23 22:31, August Wikerfors wrote:
> On 2023-08-08 12:33, Hans de Goede wrote:
>> All the cases, were the DSDT IRQ settings should be used instead of
>> the MADT override, are for IRQ 1 (the PS/2 kbd IRQ).
>>
>> Simplify things by always honering the override for GSI != 1
>> (for non DMI quirked cases).
>>
>> This allows removing the DMI quirks to honor the override for
>> some non IRQ 1 IRQs on some AMD ZEN based Lenovo models.
>>
>> Fixes: a9c4a912b7dc ("ACPI: resource: Remove "Zen" specific match and quirks")
>> Cc: Mario Limonciello <mario.limonciello@amd.com>
>> Cc: Linux regressions mailing list <regressions@lists.linux.dev>
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>> ---
>>   drivers/acpi/resource.c | 28 ++++++++--------------------
>>   1 file changed, 8 insertions(+), 20 deletions(-)
>>
>> diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c
>> index 0800a9d77558..840b938a5fb0 100644
>> --- a/drivers/acpi/resource.c
>> +++ b/drivers/acpi/resource.c
>> @@ -470,24 +470,6 @@ static const struct dmi_system_id asus_laptop[] = {
>>       { }
>>   };
>>   -static const struct dmi_system_id lenovo_laptop[] = {
>> -    {
>> -        .ident = "LENOVO IdeaPad Flex 5 14ALC7",
>> -        .matches = {
>> -            DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
>> -            DMI_MATCH(DMI_PRODUCT_NAME, "82R9"),
>> -        },
>> -    },
>> -    {
>> -        .ident = "LENOVO IdeaPad Flex 5 16ALC7",
>> -        .matches = {
>> -            DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
>> -            DMI_MATCH(DMI_PRODUCT_NAME, "82RA"),
>> -        },
>> -    },
>> -    { }
>> -};
>> -
>>   static const struct dmi_system_id tongfang_gm_rg[] = {
>>       {
>>           .ident = "TongFang GMxRGxx/XMG CORE 15 (M22)/TUXEDO Stellaris 15 Gen4 AMD",
>> @@ -539,8 +521,6 @@ struct irq_override_cmp {
>>   static const struct irq_override_cmp override_table[] = {
>>       { medion_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false },
>>       { asus_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false },
>> -    { lenovo_laptop, 6, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, true },
>> -    { lenovo_laptop, 10, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, true },
>>       { tongfang_gm_rg, 1, ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_LOW, 1, true },
>>       { maingear_laptop, 1, ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_LOW, 1, true },
>>       { lg_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false },
>> @@ -562,6 +542,14 @@ static bool acpi_dev_irq_override(u32 gsi, u8 triggering, u8 polarity,
>>               return entry->override;
>>       }
>>   +    /*
>> +     * Always use the MADT override info, except for IRQ 1 for IRQ1
>> +     * the DSDT IRQ settings should sometimes be used otherwise
>> +     * PS/2 keyboards will not work.
>> +     */
>> +    if (gsi != 1)
>> +        return true;
>> +
>>   #ifdef CONFIG_X86
>>       /*
>>        * IRQ override isn't needed on modern AMD Zen systems and
> 
> I don't think this will work for the Lenovo ThinkPad neo 14 because according to https://bugzilla.kernel.org/show_bug.cgi?id=217731 it needs the override to also be skipped for IRQ 12.

You are right, thank you for catching this. I'll submit a v3 of
the series with the check changed to:

    if (gsi != 1 && gsi != 12)
        return true;


I'll update the Link: tags in the revert to add more bugreports
Links including the 217731 bugzilla.

Regards,

Hans
diff mbox series

Patch

diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c
index 0800a9d77558..840b938a5fb0 100644
--- a/drivers/acpi/resource.c
+++ b/drivers/acpi/resource.c
@@ -470,24 +470,6 @@  static const struct dmi_system_id asus_laptop[] = {
 	{ }
 };
 
-static const struct dmi_system_id lenovo_laptop[] = {
-	{
-		.ident = "LENOVO IdeaPad Flex 5 14ALC7",
-		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "82R9"),
-		},
-	},
-	{
-		.ident = "LENOVO IdeaPad Flex 5 16ALC7",
-		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "82RA"),
-		},
-	},
-	{ }
-};
-
 static const struct dmi_system_id tongfang_gm_rg[] = {
 	{
 		.ident = "TongFang GMxRGxx/XMG CORE 15 (M22)/TUXEDO Stellaris 15 Gen4 AMD",
@@ -539,8 +521,6 @@  struct irq_override_cmp {
 static const struct irq_override_cmp override_table[] = {
 	{ medion_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false },
 	{ asus_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false },
-	{ lenovo_laptop, 6, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, true },
-	{ lenovo_laptop, 10, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, true },
 	{ tongfang_gm_rg, 1, ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_LOW, 1, true },
 	{ maingear_laptop, 1, ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_LOW, 1, true },
 	{ lg_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false },
@@ -562,6 +542,14 @@  static bool acpi_dev_irq_override(u32 gsi, u8 triggering, u8 polarity,
 			return entry->override;
 	}
 
+	/*
+	 * Always use the MADT override info, except for IRQ 1 for IRQ1
+	 * the DSDT IRQ settings should sometimes be used otherwise
+	 * PS/2 keyboards will not work.
+	 */
+	if (gsi != 1)
+		return true;
+
 #ifdef CONFIG_X86
 	/*
 	 * IRQ override isn't needed on modern AMD Zen systems and