Skip to content

Commit 47a0001

Browse files
coibyLinus Walleij
authored andcommitted
pinctrl: amd: remove debounce filter setting in IRQ type setting
Debounce filter setting should be independent from IRQ type setting because according to the ACPI specs, there are separate arguments for specifying debounce timeout and IRQ type in GpioIo() and GpioInt(). Together with commit 06abe82 ("pinctrl: amd: fix incorrect way to disable debounce filter") and Andy's patch "gpiolib: acpi: Take into account debounce settings" [1], this will fix broken touchpads for laptops whose BIOS set the debounce timeout to a relatively large value. For example, the BIOS of Lenovo AMD gaming laptops including Legion-5 15ARH05 (R7000), Legion-5P (R7000P) and IdeaPad Gaming 3 15ARH05, set the debounce timeout to 124.8ms. This led to the kernel receiving only ~7 HID reports per second from the Synaptics touchpad (MSFT0001:00 06CB:7F28). Existing touchpads like [2][3] are not troubled by this bug because the debounce timeout has been set to 0 by the BIOS before enabling the debounce filter in setting IRQ type. [1] https://lore.kernel.org/linux-gpio/20201111222008.39993-11-andriy.shevchenko@linux.intel.com/ 8dcb7a1 ("gpiolib: acpi: Take into account debounce settings") [2] Syniurge/i2c-amd-mp2#11 (comment) [3] https://forum.manjaro.org/t/random-short-touchpad-freezes/30832/28 Signed-off-by: Coiby Xu <coiby.xu@gmail.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Andy Shevchenko <andy.shevchenko@gmail.com> Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/linux-gpio/CAHp75VcwiGREBUJ0A06EEw-SyabqYsp%2Bdqs2DpSrhaY-2GVdAA%40mail.gmail.com/ BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1887190 Link: https://lore.kernel.org/r/20201125130320.311059-1-coiby.xu@gmail.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent 5fa9c5f commit 47a0001

1 file changed

Lines changed: 0 additions & 7 deletions

File tree

drivers/pinctrl/pinctrl-amd.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -429,41 +429,34 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)
429429
pin_reg &= ~BIT(LEVEL_TRIG_OFF);
430430
pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);
431431
pin_reg |= ACTIVE_HIGH << ACTIVE_LEVEL_OFF;
432-
pin_reg |= DB_TYPE_REMOVE_GLITCH << DB_CNTRL_OFF;
433432
irq_set_handler_locked(d, handle_edge_irq);
434433
break;
435434

436435
case IRQ_TYPE_EDGE_FALLING:
437436
pin_reg &= ~BIT(LEVEL_TRIG_OFF);
438437
pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);
439438
pin_reg |= ACTIVE_LOW << ACTIVE_LEVEL_OFF;
440-
pin_reg |= DB_TYPE_REMOVE_GLITCH << DB_CNTRL_OFF;
441439
irq_set_handler_locked(d, handle_edge_irq);
442440
break;
443441

444442
case IRQ_TYPE_EDGE_BOTH:
445443
pin_reg &= ~BIT(LEVEL_TRIG_OFF);
446444
pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);
447445
pin_reg |= BOTH_EADGE << ACTIVE_LEVEL_OFF;
448-
pin_reg |= DB_TYPE_REMOVE_GLITCH << DB_CNTRL_OFF;
449446
irq_set_handler_locked(d, handle_edge_irq);
450447
break;
451448

452449
case IRQ_TYPE_LEVEL_HIGH:
453450
pin_reg |= LEVEL_TRIGGER << LEVEL_TRIG_OFF;
454451
pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);
455452
pin_reg |= ACTIVE_HIGH << ACTIVE_LEVEL_OFF;
456-
pin_reg &= ~(DB_CNTRl_MASK << DB_CNTRL_OFF);
457-
pin_reg |= DB_TYPE_PRESERVE_LOW_GLITCH << DB_CNTRL_OFF;
458453
irq_set_handler_locked(d, handle_level_irq);
459454
break;
460455

461456
case IRQ_TYPE_LEVEL_LOW:
462457
pin_reg |= LEVEL_TRIGGER << LEVEL_TRIG_OFF;
463458
pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);
464459
pin_reg |= ACTIVE_LOW << ACTIVE_LEVEL_OFF;
465-
pin_reg &= ~(DB_CNTRl_MASK << DB_CNTRL_OFF);
466-
pin_reg |= DB_TYPE_PRESERVE_HIGH_GLITCH << DB_CNTRL_OFF;
467460
irq_set_handler_locked(d, handle_level_irq);
468461
break;
469462

0 commit comments

Comments
 (0)