linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5] ACPI: skip IRQ1 override on 3 Ryzen 6000 laptops
@ 2022-06-30  2:23 Chuanhong Guo
  2022-06-30 20:12 ` Limonciello, Mario
  0 siblings, 1 reply; 6+ messages in thread
From: Chuanhong Guo @ 2022-06-30  2:23 UTC (permalink / raw)
  To: linux-acpi
  Cc: Chuanhong Guo, stable, Tighe Donnelly, Kent Hou Man,
	Rafael J. Wysocki, Len Brown, open list

The IRQ1 of these laptops with Ryzen 6000 and Insyde UEFI are active
low and defined in legacy format in ACPI DSDT. The kernel override
makes the keyboard interrupt polarity inverted, resulting in
non-functional keyboard.

Skip legacy IRQ override for:
Lenovo ThinkBook 14G4+ ARA
Redmi Book Pro 15 2022 Ryzen
Asus Zenbook S 13 OLED UM5302

Cc: <stable@vger.kernel.org>
Signed-off-by: Tighe Donnelly <tighe.donnelly@protonmail.com>
Signed-off-by: Kent Hou Man <knthmn0@gmail.com>
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
---
Changes since v1:
 Match DMI_PRODUCT_NAME for ThinkBook because the board name
 is used for other completely different Lenovo laptops.
 Add a patch for RedmiBook

Changes since v2:
 Fix alphabetical order in skip_override_table
 Add a patch for Asus Zenbook

Changes since v3:
 Merge patches as requested
 Fix another alphabetical ordering between two structs

Changes since v4:
 rename the ident in RedmiBook entry.
  There's also an Intel version of this series, so
  rename it to make it specific.
 reword commit title

 drivers/acpi/resource.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c
index c2d494784425..0491da180fc5 100644
--- a/drivers/acpi/resource.c
+++ b/drivers/acpi/resource.c
@@ -381,6 +381,31 @@ unsigned int acpi_dev_get_irq_type(int triggering, int polarity)
 }
 EXPORT_SYMBOL_GPL(acpi_dev_get_irq_type);
 
+static const struct dmi_system_id irq1_edge_low_shared[] = {
+	{
+		.ident = "Asus Zenbook S 13 OLED UM5302",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+			DMI_MATCH(DMI_BOARD_NAME, "UM5302TA"),
+		},
+	},
+	{
+		.ident = "Lenovo ThinkBook 14 G4+ ARA",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "21D0"),
+		},
+	},
+	{
+		.ident = "Redmi Book Pro 15 2022 Ryzen",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "TIMI"),
+			DMI_MATCH(DMI_BOARD_NAME, "TM2113"),
+		},
+	},
+	{ }
+};
+
 static const struct dmi_system_id medion_laptop[] = {
 	{
 		.ident = "MEDION P15651",
@@ -408,6 +433,7 @@ struct irq_override_cmp {
 };
 
 static const struct irq_override_cmp skip_override_table[] = {
+	{ irq1_edge_low_shared, 1, ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_LOW, 1 },
 	{ medion_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0 },
 };
 
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v5] ACPI: skip IRQ1 override on 3 Ryzen 6000 laptops
  2022-06-30  2:23 [PATCH v5] ACPI: skip IRQ1 override on 3 Ryzen 6000 laptops Chuanhong Guo
@ 2022-06-30 20:12 ` Limonciello, Mario
  2022-07-01 12:44   ` Chuanhong Guo
  0 siblings, 1 reply; 6+ messages in thread
From: Limonciello, Mario @ 2022-06-30 20:12 UTC (permalink / raw)
  To: Chuanhong Guo, linux-acpi
  Cc: stable, Tighe Donnelly, Kent Hou Man, Rafael J. Wysocki,
	Len Brown, open list

On 6/29/2022 21:23, Chuanhong Guo wrote:
> The IRQ1 of these laptops with Ryzen 6000 and Insyde UEFI are active
> low and defined in legacy format in ACPI DSDT. The kernel override
> makes the keyboard interrupt polarity inverted, resulting in
> non-functional keyboard.
> 
> Skip legacy IRQ override for:
> Lenovo ThinkBook 14G4+ ARA
> Redmi Book Pro 15 2022 Ryzen
> Asus Zenbook S 13 OLED UM5302

It's really unfortunate that these laptops have the bug.  This was found 
and fixed in the reference BIOS for Ryzen 6000 too (via an MADT override 
service) very early in development.  It seems these manufacturers didn't 
pick up (or ignored) the solution.

However I do want to point out that Windows doesn't care about legacy 
format or not.  This bug where keyboard doesn't work only popped up on 
Linux.

Given the number of systems with the bug is appearing to grow I wonder 
if the right answer is actually a new heuristic that doesn't apply the 
kernel override for polarity inversion anymore.  Maybe if the system is 
2022 or newer?  Or on the ACPI version?

> 
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Tighe Donnelly <tighe.donnelly@protonmail.com>
> Signed-off-by: Kent Hou Man <knthmn0@gmail.com>
> Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
> ---
> Changes since v1:
>   Match DMI_PRODUCT_NAME for ThinkBook because the board name
>   is used for other completely different Lenovo laptops.
>   Add a patch for RedmiBook
> 
> Changes since v2:
>   Fix alphabetical order in skip_override_table
>   Add a patch for Asus Zenbook
> 
> Changes since v3:
>   Merge patches as requested
>   Fix another alphabetical ordering between two structs
> 
> Changes since v4:
>   rename the ident in RedmiBook entry.
>    There's also an Intel version of this series, so
>    rename it to make it specific.
>   reword commit title
> 
>   drivers/acpi/resource.c | 26 ++++++++++++++++++++++++++
>   1 file changed, 26 insertions(+) >
> diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c
> index c2d494784425..0491da180fc5 100644
> --- a/drivers/acpi/resource.c
> +++ b/drivers/acpi/resource.c
> @@ -381,6 +381,31 @@ unsigned int acpi_dev_get_irq_type(int triggering, int polarity)
>   }
>   EXPORT_SYMBOL_GPL(acpi_dev_get_irq_type);
>   
> +static const struct dmi_system_id irq1_edge_low_shared[] = {
> +	{
> +		.ident = "Asus Zenbook S 13 OLED UM5302",
> +		.matches = {
> +			DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
> +			DMI_MATCH(DMI_BOARD_NAME, "UM5302TA"),
> +		},
> +	},
> +	{
> +		.ident = "Lenovo ThinkBook 14 G4+ ARA",
> +		.matches = {
> +			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
> +			DMI_MATCH(DMI_PRODUCT_NAME, "21D0"),
> +		},
> +	},
> +	{
> +		.ident = "Redmi Book Pro 15 2022 Ryzen",
> +		.matches = {
> +			DMI_MATCH(DMI_SYS_VENDOR, "TIMI"),
> +			DMI_MATCH(DMI_BOARD_NAME, "TM2113"),
> +		},
> +	},
> +	{ }
> +};
> +
>   static const struct dmi_system_id medion_laptop[] = {
>   	{
>   		.ident = "MEDION P15651",
> @@ -408,6 +433,7 @@ struct irq_override_cmp {
>   };
>   
>   static const struct irq_override_cmp skip_override_table[] = {
> +	{ irq1_edge_low_shared, 1, ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_LOW, 1 },
>   	{ medion_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0 },
>   };
>   


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v5] ACPI: skip IRQ1 override on 3 Ryzen 6000 laptops
  2022-06-30 20:12 ` Limonciello, Mario
@ 2022-07-01 12:44   ` Chuanhong Guo
  2022-07-05 18:24     ` Rafael J. Wysocki
  0 siblings, 1 reply; 6+ messages in thread
From: Chuanhong Guo @ 2022-07-01 12:44 UTC (permalink / raw)
  To: Rafael J. Wysocki, Limonciello, Mario
  Cc: linux-acpi, stable, Tighe Donnelly, Kent Hou Man, Len Brown, open list

On Fri, Jul 1, 2022 at 4:12 AM Limonciello, Mario
<mario.limonciello@amd.com> wrote:
> However I do want to point out that Windows doesn't care about legacy
> format or not.  This bug where keyboard doesn't work only popped up on
> Linux.
>
> Given the number of systems with the bug is appearing to grow I wonder
> if the right answer is actually a new heuristic that doesn't apply the
> kernel override for polarity inversion anymore.  Maybe if the system is
> 2022 or newer?  Or on the ACPI version?

The previous attempt to limit the scope of IRQ override ends up
breaking some other buggy devices:
https://patchwork.kernel.org/project/linux-acpi/patch/20210728151958.15205-1-hui.wang@canonical.com/

It's unfortunate that the original author of this IRQ override doesn't
limit the scope to their exact devices.

Hi, Rafael! What do you think? should we skip this IRQ override
one-by-one or add a different matching logic to check the bios date
instead?

-- 
Regards,
Chuanhong Guo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v5] ACPI: skip IRQ1 override on 3 Ryzen 6000 laptops
  2022-07-01 12:44   ` Chuanhong Guo
@ 2022-07-05 18:24     ` Rafael J. Wysocki
  2022-07-05 18:27       ` Limonciello, Mario
  0 siblings, 1 reply; 6+ messages in thread
From: Rafael J. Wysocki @ 2022-07-05 18:24 UTC (permalink / raw)
  To: Chuanhong Guo
  Cc: Rafael J. Wysocki, Limonciello, Mario, ACPI Devel Maling List,
	Stable, Tighe Donnelly, Kent Hou Man, Len Brown, open list

On Fri, Jul 1, 2022 at 2:45 PM Chuanhong Guo <gch981213@gmail.com> wrote:
>
> On Fri, Jul 1, 2022 at 4:12 AM Limonciello, Mario
> <mario.limonciello@amd.com> wrote:
> > However I do want to point out that Windows doesn't care about legacy
> > format or not.  This bug where keyboard doesn't work only popped up on
> > Linux.
> >
> > Given the number of systems with the bug is appearing to grow I wonder
> > if the right answer is actually a new heuristic that doesn't apply the
> > kernel override for polarity inversion anymore.  Maybe if the system is
> > 2022 or newer?  Or on the ACPI version?
>
> The previous attempt to limit the scope of IRQ override ends up
> breaking some other buggy devices:
> https://patchwork.kernel.org/project/linux-acpi/patch/20210728151958.15205-1-hui.wang@canonical.com/
>
> It's unfortunate that the original author of this IRQ override doesn't
> limit the scope to their exact devices.
>
> Hi, Rafael! What do you think? should we skip this IRQ override
> one-by-one or add a different matching logic to check the bios date
> instead?

It would be better to find something precise enough to identify the
machines in question without pulling in the others and use that for
skipping the override instead of listing them all one by one in the
blocklist.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH v5] ACPI: skip IRQ1 override on 3 Ryzen 6000 laptops
  2022-07-05 18:24     ` Rafael J. Wysocki
@ 2022-07-05 18:27       ` Limonciello, Mario
  2022-07-05 18:31         ` Rafael J. Wysocki
  0 siblings, 1 reply; 6+ messages in thread
From: Limonciello, Mario @ 2022-07-05 18:27 UTC (permalink / raw)
  To: Rafael J. Wysocki, Chuanhong Guo
  Cc: ACPI Devel Maling List, Stable, Tighe Donnelly, Kent Hou Man,
	Len Brown, open list

[Public]

> -----Original Message-----
> From: Rafael J. Wysocki <rafael@kernel.org>
> Sent: Tuesday, July 5, 2022 13:24
> To: Chuanhong Guo <gch981213@gmail.com>
> Cc: Rafael J. Wysocki <rafael@kernel.org>; Limonciello, Mario
> <Mario.Limonciello@amd.com>; ACPI Devel Maling List <linux-
> acpi@vger.kernel.org>; Stable <stable@vger.kernel.org>; Tighe Donnelly
> <tighe.donnelly@protonmail.com>; Kent Hou Man <knthmn0@gmail.com>;
> Len Brown <lenb@kernel.org>; open list <linux-kernel@vger.kernel.org>
> Subject: Re: [PATCH v5] ACPI: skip IRQ1 override on 3 Ryzen 6000 laptops
> 
> On Fri, Jul 1, 2022 at 2:45 PM Chuanhong Guo <gch981213@gmail.com>
> wrote:
> >
> > On Fri, Jul 1, 2022 at 4:12 AM Limonciello, Mario
> > <mario.limonciello@amd.com> wrote:
> > > However I do want to point out that Windows doesn't care about legacy
> > > format or not.  This bug where keyboard doesn't work only popped up on
> > > Linux.
> > >
> > > Given the number of systems with the bug is appearing to grow I wonder
> > > if the right answer is actually a new heuristic that doesn't apply the
> > > kernel override for polarity inversion anymore.  Maybe if the system is
> > > 2022 or newer?  Or on the ACPI version?
> >
> > The previous attempt to limit the scope of IRQ override ends up
> > breaking some other buggy devices:
> >
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatc
> hwork.kernel.org%2Fproject%2Flinux-
> acpi%2Fpatch%2F20210728151958.15205-1-
> hui.wang%40canonical.com%2F&amp;data=05%7C01%7Cmario.limonciello%4
> 0amd.com%7C106955e4611344d3bc3808da5eb3971d%7C3dd8961fe4884e608
> e11a82d994e183d%7C0%7C0%7C637926422673112765%7CUnknown%7CTWF
> pbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXV
> CI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=xOaRbkCv9EMhpLO%2BGAP
> mDjEhQ78xjYFBvehLZdg1k1I%3D&amp;reserved=0
> >
> > It's unfortunate that the original author of this IRQ override doesn't
> > limit the scope to their exact devices.
> >
> > Hi, Rafael! What do you think? should we skip this IRQ override
> > one-by-one or add a different matching logic to check the bios date
> > instead?
> 
> It would be better to find something precise enough to identify the
> machines in question without pulling in the others and use that for
> skipping the override instead of listing them all one by one in the
> blocklist.

How about using the CPU family/model in this case?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v5] ACPI: skip IRQ1 override on 3 Ryzen 6000 laptops
  2022-07-05 18:27       ` Limonciello, Mario
@ 2022-07-05 18:31         ` Rafael J. Wysocki
  0 siblings, 0 replies; 6+ messages in thread
From: Rafael J. Wysocki @ 2022-07-05 18:31 UTC (permalink / raw)
  To: Limonciello, Mario
  Cc: Rafael J. Wysocki, Chuanhong Guo, ACPI Devel Maling List, Stable,
	Tighe Donnelly, Kent Hou Man, Len Brown, open list

On Tue, Jul 5, 2022 at 8:27 PM Limonciello, Mario
<Mario.Limonciello@amd.com> wrote:
>
> [Public]
>
> > -----Original Message-----
> > From: Rafael J. Wysocki <rafael@kernel.org>
> > Sent: Tuesday, July 5, 2022 13:24
> > To: Chuanhong Guo <gch981213@gmail.com>
> > Cc: Rafael J. Wysocki <rafael@kernel.org>; Limonciello, Mario
> > <Mario.Limonciello@amd.com>; ACPI Devel Maling List <linux-
> > acpi@vger.kernel.org>; Stable <stable@vger.kernel.org>; Tighe Donnelly
> > <tighe.donnelly@protonmail.com>; Kent Hou Man <knthmn0@gmail.com>;
> > Len Brown <lenb@kernel.org>; open list <linux-kernel@vger.kernel.org>
> > Subject: Re: [PATCH v5] ACPI: skip IRQ1 override on 3 Ryzen 6000 laptops
> >
> > On Fri, Jul 1, 2022 at 2:45 PM Chuanhong Guo <gch981213@gmail.com>
> > wrote:
> > >
> > > On Fri, Jul 1, 2022 at 4:12 AM Limonciello, Mario
> > > <mario.limonciello@amd.com> wrote:
> > > > However I do want to point out that Windows doesn't care about legacy
> > > > format or not.  This bug where keyboard doesn't work only popped up on
> > > > Linux.
> > > >
> > > > Given the number of systems with the bug is appearing to grow I wonder
> > > > if the right answer is actually a new heuristic that doesn't apply the
> > > > kernel override for polarity inversion anymore.  Maybe if the system is
> > > > 2022 or newer?  Or on the ACPI version?
> > >
> > > The previous attempt to limit the scope of IRQ override ends up
> > > breaking some other buggy devices:
> > >
> > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatc
> > hwork.kernel.org%2Fproject%2Flinux-
> > acpi%2Fpatch%2F20210728151958.15205-1-
> > hui.wang%40canonical.com%2F&amp;data=05%7C01%7Cmario.limonciello%4
> > 0amd.com%7C106955e4611344d3bc3808da5eb3971d%7C3dd8961fe4884e608
> > e11a82d994e183d%7C0%7C0%7C637926422673112765%7CUnknown%7CTWF
> > pbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXV
> > CI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=xOaRbkCv9EMhpLO%2BGAP
> > mDjEhQ78xjYFBvehLZdg1k1I%3D&amp;reserved=0
> > >
> > > It's unfortunate that the original author of this IRQ override doesn't
> > > limit the scope to their exact devices.
> > >
> > > Hi, Rafael! What do you think? should we skip this IRQ override
> > > one-by-one or add a different matching logic to check the bios date
> > > instead?
> >
> > It would be better to find something precise enough to identify the
> > machines in question without pulling in the others and use that for
> > skipping the override instead of listing them all one by one in the
> > blocklist.
>
> How about using the CPU family/model in this case?

That would work for me.  The code in question is all quirks anyway.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-07-05 18:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-30  2:23 [PATCH v5] ACPI: skip IRQ1 override on 3 Ryzen 6000 laptops Chuanhong Guo
2022-06-30 20:12 ` Limonciello, Mario
2022-07-01 12:44   ` Chuanhong Guo
2022-07-05 18:24     ` Rafael J. Wysocki
2022-07-05 18:27       ` Limonciello, Mario
2022-07-05 18:31         ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).