[v3,4/4] pinctrl: amd: remove debounce filter setting in IRQ type setting

Message ID 20201105231912.69527-5-coiby.xu@gmail.com
State New
Headers show
Series
  • pinctrl: amd: debounce filter fixes
Related show

Commit Message

Coiby Xu Nov. 5, 2020, 11:19 p.m.
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().

This will fix broken touchpads for laptops whose BIOS set the debounce
timeout to a relatively large value. For example, the BIOS of Lenovo
Legion-5 AMD gaming laptops including 15ARH05 (R7000) and R7000P 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 [1][2] 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://github.com/Syniurge/i2c-amd-mp2/issues/11#issuecomment-721331582
[2] https://forum.manjaro.org/t/random-short-touchpad-freezes/30832/28

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
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1887190
Link: https://lore.kernel.org/linux-gpio/CAHp75VcwiGREBUJ0A06EEw-SyabqYsp%2Bdqs2DpSrhaY-2GVdAA%40mail.gmail.com/
Signed-off-by: Coiby Xu <coiby.xu@gmail.com>
---
 drivers/pinctrl/pinctrl-amd.c | 7 -------
 1 file changed, 7 deletions(-)

Comments

Hans de Goede Nov. 9, 2020, 1:52 p.m. | #1
Hi,

On 11/6/20 12:19 AM, Coiby Xu wrote:
> 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().
> 
> This will fix broken touchpads for laptops whose BIOS set the debounce
> timeout to a relatively large value. For example, the BIOS of Lenovo
> Legion-5 AMD gaming laptops including 15ARH05 (R7000) and R7000P 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 [1][2] 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://github.com/Syniurge/i2c-amd-mp2/issues/11#issuecomment-721331582
> [2] https://forum.manjaro.org/t/random-short-touchpad-freezes/30832/28
> 
> 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
> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1887190
> Link: https://lore.kernel.org/linux-gpio/CAHp75VcwiGREBUJ0A06EEw-SyabqYsp%2Bdqs2DpSrhaY-2GVdAA%40mail.gmail.com/
> Signed-off-by: Coiby Xu <coiby.xu@gmail.com>

I'm not entirely sure about this patch. This is consistent with how we
already stopped touching the debounce timeout setting during init, so
that speaks in favor of this change.

Still I'm worried a bit that this might have undesirable side effects.

I guess this should be landed together with Andy's series to apply
the debounce setting from the ACPI GPIO resources.

Regards,

Hans




> ---
>  drivers/pinctrl/pinctrl-amd.c | 7 -------
>  1 file changed, 7 deletions(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-amd.c b/drivers/pinctrl/pinctrl-amd.c
> index e9b761c2b77a..2d4acf21117c 100644
> --- a/drivers/pinctrl/pinctrl-amd.c
> +++ b/drivers/pinctrl/pinctrl-amd.c
> @@ -468,7 +468,6 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)
>  		pin_reg &= ~BIT(LEVEL_TRIG_OFF);
>  		pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);
>  		pin_reg |= ACTIVE_HIGH << ACTIVE_LEVEL_OFF;
> -		pin_reg |= DB_TYPE_REMOVE_GLITCH << DB_CNTRL_OFF;
>  		irq_set_handler_locked(d, handle_edge_irq);
>  		break;
>  
> @@ -476,7 +475,6 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)
>  		pin_reg &= ~BIT(LEVEL_TRIG_OFF);
>  		pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);
>  		pin_reg |= ACTIVE_LOW << ACTIVE_LEVEL_OFF;
> -		pin_reg |= DB_TYPE_REMOVE_GLITCH << DB_CNTRL_OFF;
>  		irq_set_handler_locked(d, handle_edge_irq);
>  		break;
>  
> @@ -484,7 +482,6 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)
>  		pin_reg &= ~BIT(LEVEL_TRIG_OFF);
>  		pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);
>  		pin_reg |= BOTH_EADGE << ACTIVE_LEVEL_OFF;
> -		pin_reg |= DB_TYPE_REMOVE_GLITCH << DB_CNTRL_OFF;
>  		irq_set_handler_locked(d, handle_edge_irq);
>  		break;
>  
> @@ -492,8 +489,6 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)
>  		pin_reg |= LEVEL_TRIGGER << LEVEL_TRIG_OFF;
>  		pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);
>  		pin_reg |= ACTIVE_HIGH << ACTIVE_LEVEL_OFF;
> -		pin_reg &= ~(DB_CNTRl_MASK << DB_CNTRL_OFF);
> -		pin_reg |= DB_TYPE_PRESERVE_LOW_GLITCH << DB_CNTRL_OFF;
>  		irq_set_handler_locked(d, handle_level_irq);
>  		break;
>  
> @@ -501,8 +496,6 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)
>  		pin_reg |= LEVEL_TRIGGER << LEVEL_TRIG_OFF;
>  		pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);
>  		pin_reg |= ACTIVE_LOW << ACTIVE_LEVEL_OFF;
> -		pin_reg &= ~(DB_CNTRl_MASK << DB_CNTRL_OFF);
> -		pin_reg |= DB_TYPE_PRESERVE_HIGH_GLITCH << DB_CNTRL_OFF;
>  		irq_set_handler_locked(d, handle_level_irq);
>  		break;
>  
>
Coiby Xu Nov. 10, 2020, 8:26 a.m. | #2
On Mon, Nov 09, 2020 at 02:52:17PM +0100, Hans de Goede wrote:
>Hi,

>

>On 11/6/20 12:19 AM, Coiby Xu wrote:

>> 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().

>>

>> This will fix broken touchpads for laptops whose BIOS set the debounce

>> timeout to a relatively large value. For example, the BIOS of Lenovo

>> Legion-5 AMD gaming laptops including 15ARH05 (R7000) and R7000P 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 [1][2] 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://github.com/Syniurge/i2c-amd-mp2/issues/11#issuecomment-721331582

>> [2] https://forum.manjaro.org/t/random-short-touchpad-freezes/30832/28

>>

>> 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

>> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

>> BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1887190

>> Link: https://lore.kernel.org/linux-gpio/CAHp75VcwiGREBUJ0A06EEw-SyabqYsp%2Bdqs2DpSrhaY-2GVdAA%40mail.gmail.com/

>> Signed-off-by: Coiby Xu <coiby.xu@gmail.com>

>

>I'm not entirely sure about this patch. This is consistent with how we

>already stopped touching the debounce timeout setting during init, so

>that speaks in favor of this change.

>

>Still I'm worried a bit that this might have undesirable side effects.

>

Now I can only confirm this patch won't affect the mentioned touchpads.
I'll see if other distributions like Manjaro are willing to test it
through the unstable channel.

>I guess this should be landed together with Andy's series to apply

>the debounce setting from the ACPI GPIO resources.


Thank you for the reminding! You are right, Andy's patch
"gpiolib: acpi: Take into account debounce settings" is needed to
fix this kind of touchpad issues. Since that patch hasn't been
merged, is there a way to refer to it in the commit message?
>

>Regards,

>

>Hans

>

>

>

>

>> ---

>>  drivers/pinctrl/pinctrl-amd.c | 7 -------

>>  1 file changed, 7 deletions(-)

>>

>> diff --git a/drivers/pinctrl/pinctrl-amd.c b/drivers/pinctrl/pinctrl-amd.c

>> index e9b761c2b77a..2d4acf21117c 100644

>> --- a/drivers/pinctrl/pinctrl-amd.c

>> +++ b/drivers/pinctrl/pinctrl-amd.c

>> @@ -468,7 +468,6 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)

>>  		pin_reg &= ~BIT(LEVEL_TRIG_OFF);

>>  		pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);

>>  		pin_reg |= ACTIVE_HIGH << ACTIVE_LEVEL_OFF;

>> -		pin_reg |= DB_TYPE_REMOVE_GLITCH << DB_CNTRL_OFF;

>>  		irq_set_handler_locked(d, handle_edge_irq);

>>  		break;

>>

>> @@ -476,7 +475,6 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)

>>  		pin_reg &= ~BIT(LEVEL_TRIG_OFF);

>>  		pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);

>>  		pin_reg |= ACTIVE_LOW << ACTIVE_LEVEL_OFF;

>> -		pin_reg |= DB_TYPE_REMOVE_GLITCH << DB_CNTRL_OFF;

>>  		irq_set_handler_locked(d, handle_edge_irq);

>>  		break;

>>

>> @@ -484,7 +482,6 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)

>>  		pin_reg &= ~BIT(LEVEL_TRIG_OFF);

>>  		pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);

>>  		pin_reg |= BOTH_EADGE << ACTIVE_LEVEL_OFF;

>> -		pin_reg |= DB_TYPE_REMOVE_GLITCH << DB_CNTRL_OFF;

>>  		irq_set_handler_locked(d, handle_edge_irq);

>>  		break;

>>

>> @@ -492,8 +489,6 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)

>>  		pin_reg |= LEVEL_TRIGGER << LEVEL_TRIG_OFF;

>>  		pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);

>>  		pin_reg |= ACTIVE_HIGH << ACTIVE_LEVEL_OFF;

>> -		pin_reg &= ~(DB_CNTRl_MASK << DB_CNTRL_OFF);

>> -		pin_reg |= DB_TYPE_PRESERVE_LOW_GLITCH << DB_CNTRL_OFF;

>>  		irq_set_handler_locked(d, handle_level_irq);

>>  		break;

>>

>> @@ -501,8 +496,6 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)

>>  		pin_reg |= LEVEL_TRIGGER << LEVEL_TRIG_OFF;

>>  		pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);

>>  		pin_reg |= ACTIVE_LOW << ACTIVE_LEVEL_OFF;

>> -		pin_reg &= ~(DB_CNTRl_MASK << DB_CNTRL_OFF);

>> -		pin_reg |= DB_TYPE_PRESERVE_HIGH_GLITCH << DB_CNTRL_OFF;

>>  		irq_set_handler_locked(d, handle_level_irq);

>>  		break;

>>

>>

>


--
Best regards,
Coiby
Hans de Goede Nov. 10, 2020, 8:35 a.m. | #3
Hi,

On 11/10/20 9:26 AM, Coiby Xu wrote:
> On Mon, Nov 09, 2020 at 02:52:17PM +0100, Hans de Goede wrote:
>> Hi,
>>
>> On 11/6/20 12:19 AM, Coiby Xu wrote:
>>> 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().
>>>
>>> This will fix broken touchpads for laptops whose BIOS set the debounce
>>> timeout to a relatively large value. For example, the BIOS of Lenovo
>>> Legion-5 AMD gaming laptops including 15ARH05 (R7000) and R7000P 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 [1][2] 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://github.com/Syniurge/i2c-amd-mp2/issues/11#issuecomment-721331582
>>> [2] https://forum.manjaro.org/t/random-short-touchpad-freezes/30832/28
>>>
>>> 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
>>> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
>>> BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1887190
>>> Link: https://lore.kernel.org/linux-gpio/CAHp75VcwiGREBUJ0A06EEw-SyabqYsp%2Bdqs2DpSrhaY-2GVdAA%40mail.gmail.com/
>>> Signed-off-by: Coiby Xu <coiby.xu@gmail.com>
>>
>> I'm not entirely sure about this patch. This is consistent with how we
>> already stopped touching the debounce timeout setting during init, so
>> that speaks in favor of this change.
>>
>> Still I'm worried a bit that this might have undesirable side effects.
>>
> Now I can only confirm this patch won't affect the mentioned touchpads.
> I'll see if other distributions like Manjaro are willing to test it
> through the unstable channel.
> 
>> I guess this should be landed together with Andy's series to apply
>> the debounce setting from the ACPI GPIO resources.
> 
> Thank you for the reminding! You are right, Andy's patch
> "gpiolib: acpi: Take into account debounce settings" is needed to
> fix this kind of touchpad issues. Since that patch hasn't been
> merged, is there a way to refer to it in the commit message?

You can always refer to it by subject, as you did above.

Regards,

Hans



>>> ---
>>>  drivers/pinctrl/pinctrl-amd.c | 7 -------
>>>  1 file changed, 7 deletions(-)
>>>
>>> diff --git a/drivers/pinctrl/pinctrl-amd.c b/drivers/pinctrl/pinctrl-amd.c
>>> index e9b761c2b77a..2d4acf21117c 100644
>>> --- a/drivers/pinctrl/pinctrl-amd.c
>>> +++ b/drivers/pinctrl/pinctrl-amd.c
>>> @@ -468,7 +468,6 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)
>>>          pin_reg &= ~BIT(LEVEL_TRIG_OFF);
>>>          pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);
>>>          pin_reg |= ACTIVE_HIGH << ACTIVE_LEVEL_OFF;
>>> -        pin_reg |= DB_TYPE_REMOVE_GLITCH << DB_CNTRL_OFF;
>>>          irq_set_handler_locked(d, handle_edge_irq);
>>>          break;
>>>
>>> @@ -476,7 +475,6 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)
>>>          pin_reg &= ~BIT(LEVEL_TRIG_OFF);
>>>          pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);
>>>          pin_reg |= ACTIVE_LOW << ACTIVE_LEVEL_OFF;
>>> -        pin_reg |= DB_TYPE_REMOVE_GLITCH << DB_CNTRL_OFF;
>>>          irq_set_handler_locked(d, handle_edge_irq);
>>>          break;
>>>
>>> @@ -484,7 +482,6 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)
>>>          pin_reg &= ~BIT(LEVEL_TRIG_OFF);
>>>          pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);
>>>          pin_reg |= BOTH_EADGE << ACTIVE_LEVEL_OFF;
>>> -        pin_reg |= DB_TYPE_REMOVE_GLITCH << DB_CNTRL_OFF;
>>>          irq_set_handler_locked(d, handle_edge_irq);
>>>          break;
>>>
>>> @@ -492,8 +489,6 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)
>>>          pin_reg |= LEVEL_TRIGGER << LEVEL_TRIG_OFF;
>>>          pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);
>>>          pin_reg |= ACTIVE_HIGH << ACTIVE_LEVEL_OFF;
>>> -        pin_reg &= ~(DB_CNTRl_MASK << DB_CNTRL_OFF);
>>> -        pin_reg |= DB_TYPE_PRESERVE_LOW_GLITCH << DB_CNTRL_OFF;
>>>          irq_set_handler_locked(d, handle_level_irq);
>>>          break;
>>>
>>> @@ -501,8 +496,6 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)
>>>          pin_reg |= LEVEL_TRIGGER << LEVEL_TRIG_OFF;
>>>          pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);
>>>          pin_reg |= ACTIVE_LOW << ACTIVE_LEVEL_OFF;
>>> -        pin_reg &= ~(DB_CNTRl_MASK << DB_CNTRL_OFF);
>>> -        pin_reg |= DB_TYPE_PRESERVE_HIGH_GLITCH << DB_CNTRL_OFF;
>>>          irq_set_handler_locked(d, handle_level_irq);
>>>          break;
>>>
>>>
>>
> 
> -- 
> Best regards,
> Coiby
>
Linus Walleij Nov. 10, 2020, 1:23 p.m. | #4
On Fri, Nov 6, 2020 at 12:19 AM Coiby Xu <coiby.xu@gmail.com> wrote:

> 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().

>

> This will fix broken touchpads for laptops whose BIOS set the debounce

> timeout to a relatively large value. For example, the BIOS of Lenovo

> Legion-5 AMD gaming laptops including 15ARH05 (R7000) and R7000P 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 [1][2] 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://github.com/Syniurge/i2c-amd-mp2/issues/11#issuecomment-721331582

> [2] https://forum.manjaro.org/t/random-short-touchpad-freezes/30832/28

>

> 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

> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

> BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1887190

> Link: https://lore.kernel.org/linux-gpio/CAHp75VcwiGREBUJ0A06EEw-SyabqYsp%2Bdqs2DpSrhaY-2GVdAA%40mail.gmail.com/

> Signed-off-by: Coiby Xu <coiby.xu@gmail.com>


As I have applied patches 1-3 we only have this one to land.

If Andy or someone else needs to take it through the ACPI
tree you can add my:
Acked-by: Linus Walleij <linus.walleij@linaro.org>


If I should apply it or if Andy sends me a pull request, just
ping me and tell me what to do :)

Yours,
Linus Walleij
Andy Shevchenko Nov. 10, 2020, 1:57 p.m. | #5
On Tue, Nov 10, 2020 at 3:23 PM Linus Walleij <linus.walleij@linaro.org> wrote:
> On Fri, Nov 6, 2020 at 12:19 AM Coiby Xu <coiby.xu@gmail.com> wrote:


...

> If Andy or someone else needs to take it through the ACPI

> tree you can add my:

> Acked-by: Linus Walleij <linus.walleij@linaro.org>

>

> If I should apply it or if Andy sends me a pull request, just

> ping me and tell me what to do :)


I can take it, but I would need few things:
- Hans' blessing of my series
- tested on top of my series (hence tested-by tag for my series)
- I would like to perform more tests myself


-- 
With Best Regards,
Andy Shevchenko

Patch

diff --git a/drivers/pinctrl/pinctrl-amd.c b/drivers/pinctrl/pinctrl-amd.c
index e9b761c2b77a..2d4acf21117c 100644
--- a/drivers/pinctrl/pinctrl-amd.c
+++ b/drivers/pinctrl/pinctrl-amd.c
@@ -468,7 +468,6 @@  static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)
 		pin_reg &= ~BIT(LEVEL_TRIG_OFF);
 		pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);
 		pin_reg |= ACTIVE_HIGH << ACTIVE_LEVEL_OFF;
-		pin_reg |= DB_TYPE_REMOVE_GLITCH << DB_CNTRL_OFF;
 		irq_set_handler_locked(d, handle_edge_irq);
 		break;
 
@@ -476,7 +475,6 @@  static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)
 		pin_reg &= ~BIT(LEVEL_TRIG_OFF);
 		pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);
 		pin_reg |= ACTIVE_LOW << ACTIVE_LEVEL_OFF;
-		pin_reg |= DB_TYPE_REMOVE_GLITCH << DB_CNTRL_OFF;
 		irq_set_handler_locked(d, handle_edge_irq);
 		break;
 
@@ -484,7 +482,6 @@  static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)
 		pin_reg &= ~BIT(LEVEL_TRIG_OFF);
 		pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);
 		pin_reg |= BOTH_EADGE << ACTIVE_LEVEL_OFF;
-		pin_reg |= DB_TYPE_REMOVE_GLITCH << DB_CNTRL_OFF;
 		irq_set_handler_locked(d, handle_edge_irq);
 		break;
 
@@ -492,8 +489,6 @@  static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)
 		pin_reg |= LEVEL_TRIGGER << LEVEL_TRIG_OFF;
 		pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);
 		pin_reg |= ACTIVE_HIGH << ACTIVE_LEVEL_OFF;
-		pin_reg &= ~(DB_CNTRl_MASK << DB_CNTRL_OFF);
-		pin_reg |= DB_TYPE_PRESERVE_LOW_GLITCH << DB_CNTRL_OFF;
 		irq_set_handler_locked(d, handle_level_irq);
 		break;
 
@@ -501,8 +496,6 @@  static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)
 		pin_reg |= LEVEL_TRIGGER << LEVEL_TRIG_OFF;
 		pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);
 		pin_reg |= ACTIVE_LOW << ACTIVE_LEVEL_OFF;
-		pin_reg &= ~(DB_CNTRl_MASK << DB_CNTRL_OFF);
-		pin_reg |= DB_TYPE_PRESERVE_HIGH_GLITCH << DB_CNTRL_OFF;
 		irq_set_handler_locked(d, handle_level_irq);
 		break;