* [PATCH 1/2] Input: soc_button_array - Add use_low_level_irq module parameter
@ 2022-11-06 21:53 Hans de Goede
2022-11-06 21:53 ` [PATCH 2/2] Input: soc_button_array - Add Acer Switch V 10 to dmi_use_low_level_irq[] Hans de Goede
2022-11-07 19:31 ` [PATCH 1/2] Input: soc_button_array - Add use_low_level_irq module parameter Dmitry Torokhov
0 siblings, 2 replies; 4+ messages in thread
From: Hans de Goede @ 2022-11-06 21:53 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: Hans de Goede, linux-input, Rudolf Polzer
It seems that the Windows drivers for the ACPI0011 soc_button_array
device use low level triggered IRQs rather then using edge triggering.
Some ACPI tables depend on this, directly poking the GPIO controller's
registers to clear the trigger type when closing a laptop's/2-in-1's lid
and re-instating the trigger when opening the lid again.
Linux sets the edge/level on which to trigger to both low+high since
it is using edge type IRQs, the ACPI tables then ends up also setting
the bit for level IRQs and since both low and high level have been
selected by Linux we get an IRQ storm leading to soft lockups.
As a workaround for this the soc_button_array already contains
a DMI quirk table with device models known to have this issue.
Add a module parameter for this so that users can easily test if their
device is affected too and so that they can use the module parameter
as a workaround.
Cc: Rudolf Polzer <rpolzer@google.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/input/misc/soc_button_array.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/input/misc/soc_button_array.c b/drivers/input/misc/soc_button_array.c
index 480476121c01..50497dd05027 100644
--- a/drivers/input/misc/soc_button_array.c
+++ b/drivers/input/misc/soc_button_array.c
@@ -18,6 +18,10 @@
#include <linux/gpio.h>
#include <linux/platform_device.h>
+static bool use_low_level_irq;
+module_param(use_low_level_irq, bool, 0444);
+MODULE_PARM_DESC(use_low_level_irq, "Use low-level triggered IRQ instead of edge triggered");
+
struct soc_button_info {
const char *name;
int acpi_index;
@@ -164,7 +168,8 @@ soc_button_device_create(struct platform_device *pdev,
}
/* See dmi_use_low_level_irq[] comment */
- if (!autorepeat && dmi_check_system(dmi_use_low_level_irq)) {
+ if (!autorepeat && (use_low_level_irq ||
+ dmi_check_system(dmi_use_low_level_irq))) {
irq_set_irq_type(irq, IRQ_TYPE_LEVEL_LOW);
gpio_keys[n_buttons].irq = irq;
gpio_keys[n_buttons].gpio = -ENOENT;
--
2.37.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] Input: soc_button_array - Add Acer Switch V 10 to dmi_use_low_level_irq[]
2022-11-06 21:53 [PATCH 1/2] Input: soc_button_array - Add use_low_level_irq module parameter Hans de Goede
@ 2022-11-06 21:53 ` Hans de Goede
2022-11-07 19:31 ` Dmitry Torokhov
2022-11-07 19:31 ` [PATCH 1/2] Input: soc_button_array - Add use_low_level_irq module parameter Dmitry Torokhov
1 sibling, 1 reply; 4+ messages in thread
From: Hans de Goede @ 2022-11-06 21:53 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: Hans de Goede, linux-input, Rudolf Polzer
Like on the Acer Switch 10 SW5-012, the Acer Switch V 10 SW5-017's _LID
method messes with home- and power-button GPIO IRQ settings, causing an
IRQ storm.
Add a quirk entry for the Acer Switch V 10 to the dmi_use_low_level_irq[]
DMI quirk list, to use low-level IRQs on this model, fixing the IRQ storm.
Cc: Rudolf Polzer <rpolzer@google.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/input/misc/soc_button_array.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/input/misc/soc_button_array.c b/drivers/input/misc/soc_button_array.c
index 50497dd05027..09489380afda 100644
--- a/drivers/input/misc/soc_button_array.c
+++ b/drivers/input/misc/soc_button_array.c
@@ -77,6 +77,13 @@ static const struct dmi_system_id dmi_use_low_level_irq[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "Aspire SW5-012"),
},
},
+ {
+ /* Acer Switch V 10 SW5-017, same issue as Acer Switch 10 SW5-012. */
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "SW5-017"),
+ },
+ },
{
/*
* Acer One S1003. _LID method messes with power-button GPIO
--
2.37.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] Input: soc_button_array - Add Acer Switch V 10 to dmi_use_low_level_irq[]
2022-11-06 21:53 ` [PATCH 2/2] Input: soc_button_array - Add Acer Switch V 10 to dmi_use_low_level_irq[] Hans de Goede
@ 2022-11-07 19:31 ` Dmitry Torokhov
0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2022-11-07 19:31 UTC (permalink / raw)
To: Hans de Goede; +Cc: linux-input, Rudolf Polzer
On Sun, Nov 06, 2022 at 10:53:20PM +0100, Hans de Goede wrote:
> Like on the Acer Switch 10 SW5-012, the Acer Switch V 10 SW5-017's _LID
> method messes with home- and power-button GPIO IRQ settings, causing an
> IRQ storm.
>
> Add a quirk entry for the Acer Switch V 10 to the dmi_use_low_level_irq[]
> DMI quirk list, to use low-level IRQs on this model, fixing the IRQ storm.
>
> Cc: Rudolf Polzer <rpolzer@google.com>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Applied, thank you.
--
Dmitry
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] Input: soc_button_array - Add use_low_level_irq module parameter
2022-11-06 21:53 [PATCH 1/2] Input: soc_button_array - Add use_low_level_irq module parameter Hans de Goede
2022-11-06 21:53 ` [PATCH 2/2] Input: soc_button_array - Add Acer Switch V 10 to dmi_use_low_level_irq[] Hans de Goede
@ 2022-11-07 19:31 ` Dmitry Torokhov
1 sibling, 0 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2022-11-07 19:31 UTC (permalink / raw)
To: Hans de Goede; +Cc: linux-input, Rudolf Polzer
On Sun, Nov 06, 2022 at 10:53:19PM +0100, Hans de Goede wrote:
> It seems that the Windows drivers for the ACPI0011 soc_button_array
> device use low level triggered IRQs rather then using edge triggering.
>
> Some ACPI tables depend on this, directly poking the GPIO controller's
> registers to clear the trigger type when closing a laptop's/2-in-1's lid
> and re-instating the trigger when opening the lid again.
>
> Linux sets the edge/level on which to trigger to both low+high since
> it is using edge type IRQs, the ACPI tables then ends up also setting
> the bit for level IRQs and since both low and high level have been
> selected by Linux we get an IRQ storm leading to soft lockups.
>
> As a workaround for this the soc_button_array already contains
> a DMI quirk table with device models known to have this issue.
>
> Add a module parameter for this so that users can easily test if their
> device is affected too and so that they can use the module parameter
> as a workaround.
>
> Cc: Rudolf Polzer <rpolzer@google.com>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Applied, thank you.
--
Dmitry
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-11-07 19:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-06 21:53 [PATCH 1/2] Input: soc_button_array - Add use_low_level_irq module parameter Hans de Goede
2022-11-06 21:53 ` [PATCH 2/2] Input: soc_button_array - Add Acer Switch V 10 to dmi_use_low_level_irq[] Hans de Goede
2022-11-07 19:31 ` Dmitry Torokhov
2022-11-07 19:31 ` [PATCH 1/2] Input: soc_button_array - Add use_low_level_irq module parameter Dmitry Torokhov
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).