mbox series

[0/4] pinctrl: amd: Adjust handling for firmware misconfigurations

Message ID 20230421120625.3366-1-mario.limonciello@amd.com
Headers show
Series pinctrl: amd: Adjust handling for firmware misconfigurations | expand

Message

Mario Limonciello April 21, 2023, 12:06 p.m. UTC
commit 4e5a04be88fe ("pinctrl: amd: disable and mask interrupts on probe")
had intended to work around firmware problems on a Microsoft Surface
device but actually masked other real bugs in firmware and the driver.

Before this commit, "wake on lid" doesn't work properly on a number of
systems, but this is because debounce handling was improperly configured
in the driver and due to a bug in this commit it gets configured a
different way.

commit b26cd9325be4 ("pinctrl: amd: Disable and mask interrupts on
resume") attempted to build on top of this to mask issues on resume, but
it happened to "fix" the bug in commit 4e5a04be88fe ("pinctrl: amd:
disable and mask interrupts on probe") which "broke" wake on lid since
the debounce handling was programmed differently.

This was reverted in commit 534e465845eb ("Revert "pinctrl: amd: Disable
and mask interrupts on resume"") which fixed the wake on lid.

To fix this series of unfortunate events and prevent them in the future
this series corrects the GPIO0 debounce handling and reverts commit
4e5a04be88fe ("pinctrl: amd: disable and mask interrupts on probe"). A new
patch that is safer is included that will fix spurious interrupt handling
and is expected to fix the issues that both
commit 4e5a04be88fe ("pinctrl: amd: disable and mask interrupts on probe")
and
commit b26cd9325be4 ("pinctrl: amd: Disable and mask interrupts on
resume") attempted to fix in a more scalable way.

Kornel Dulęba (1):
  pinctrl: amd: Detect and mask spurious interrupts

Mario Limonciello (3):
  pinctrl: amd: Detect internal GPIO0 debounce handling
  pinctrl: amd: Fix mistake in handling clearing pins at startup
  pinctrl: amd: Revert "pinctrl: amd: disable and mask interrupts on
    probe"

 drivers/pinctrl/pinctrl-amd.c | 50 +++++++++--------------------------
 drivers/pinctrl/pinctrl-amd.h |  1 +
 2 files changed, 14 insertions(+), 37 deletions(-)

Comments

Linus Walleij May 5, 2023, 11:43 a.m. UTC | #1
On Fri, Apr 21, 2023 at 2:06 PM Mario Limonciello
<mario.limonciello@amd.com> wrote:

> commit 4e5a04be88fe ("pinctrl: amd: disable and mask interrupts on probe")
> had intended to work around firmware problems on a Microsoft Surface
> device but actually masked other real bugs in firmware and the driver.
>
> Before this commit, "wake on lid" doesn't work properly on a number of
> systems, but this is because debounce handling was improperly configured
> in the driver and due to a bug in this commit it gets configured a
> different way.
>
> commit b26cd9325be4 ("pinctrl: amd: Disable and mask interrupts on
> resume") attempted to build on top of this to mask issues on resume, but
> it happened to "fix" the bug in commit 4e5a04be88fe ("pinctrl: amd:
> disable and mask interrupts on probe") which "broke" wake on lid since
> the debounce handling was programmed differently.
>
> This was reverted in commit 534e465845eb ("Revert "pinctrl: amd: Disable
> and mask interrupts on resume"") which fixed the wake on lid.
>
> To fix this series of unfortunate events and prevent them in the future
> this series corrects the GPIO0 debounce handling and reverts commit
> 4e5a04be88fe ("pinctrl: amd: disable and mask interrupts on probe"). A new
> patch that is safer is included that will fix spurious interrupt handling
> and is expected to fix the issues that both
> commit 4e5a04be88fe ("pinctrl: amd: disable and mask interrupts on probe")
> and
> commit b26cd9325be4 ("pinctrl: amd: Disable and mask interrupts on
> resume") attempted to fix in a more scalable way.

I applied the series for the next kernel cycle (becoming v6.5).

If it gets urgent to get this in we can move it into the fixes (for v6.4 and
stable) but at least this way we get some rotation in linux-next and wide
testing of the patches.

I will push it once v6.4-rc1 is out.

Yours,
Linus Walleij
Limonciello, Mario May 5, 2023, 12:14 p.m. UTC | #2
On 5/5/2023 6:43 AM, Linus Walleij wrote:
> On Fri, Apr 21, 2023 at 2:06 PM Mario Limonciello
> <mario.limonciello@amd.com> wrote:
>
>> commit 4e5a04be88fe ("pinctrl: amd: disable and mask interrupts on probe")
>> had intended to work around firmware problems on a Microsoft Surface
>> device but actually masked other real bugs in firmware and the driver.
>>
>> Before this commit, "wake on lid" doesn't work properly on a number of
>> systems, but this is because debounce handling was improperly configured
>> in the driver and due to a bug in this commit it gets configured a
>> different way.
>>
>> commit b26cd9325be4 ("pinctrl: amd: Disable and mask interrupts on
>> resume") attempted to build on top of this to mask issues on resume, but
>> it happened to "fix" the bug in commit 4e5a04be88fe ("pinctrl: amd:
>> disable and mask interrupts on probe") which "broke" wake on lid since
>> the debounce handling was programmed differently.
>>
>> This was reverted in commit 534e465845eb ("Revert "pinctrl: amd: Disable
>> and mask interrupts on resume"") which fixed the wake on lid.
>>
>> To fix this series of unfortunate events and prevent them in the future
>> this series corrects the GPIO0 debounce handling and reverts commit
>> 4e5a04be88fe ("pinctrl: amd: disable and mask interrupts on probe"). A new
>> patch that is safer is included that will fix spurious interrupt handling
>> and is expected to fix the issues that both
>> commit 4e5a04be88fe ("pinctrl: amd: disable and mask interrupts on probe")
>> and
>> commit b26cd9325be4 ("pinctrl: amd: Disable and mask interrupts on
>> resume") attempted to fix in a more scalable way.
> I applied the series for the next kernel cycle (becoming v6.5).
>
> If it gets urgent to get this in we can move it into the fixes (for v6.4 and
> stable) but at least this way we get some rotation in linux-next and wide
> testing of the patches.
>
> I will push it once v6.4-rc1 is out.
>
> Yours,
> Linus Walleij

Thanks!  Especially given the regression we were dealing with before I 
think this is the right
approach.