mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mario Limonciello <mario.limonciello@amd.com>
To: Hans de Goede <hdegoede@redhat.com>, linus.walleij@linaro.org
Cc: Shyam-sundar.S-k@amd.com, Basavaraj.Natikar@amd.com,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	regressions@lists.linux.dev, lucapgl2001@gmail.com
Subject: Re: [PATCH 3/3] pinctrl: amd: Add a quirk for Lenovo Ideapad 5
Date: Tue, 29 Aug 2023 16:37:25 -0500	[thread overview]
Message-ID: <07353676-bad0-44f8-a15a-4877f1898b6b@amd.com> (raw)
In-Reply-To: <1d891d34-053a-368d-cf47-bcaf35284c79@redhat.com>

On 8/29/2023 14:54, Hans de Goede wrote:
> Hi Mario,
> 
> On 8/29/23 18:56, Mario Limonciello wrote:
>> Lenovo ideapad 5 doesn't use interrupts for GPIO 0, and so internally
>> debouncing with WinBlue debounce behavior means that the GPIO doesn't
>> clear until a separate GPIO is used (such as touchpad).
>>
>> Prefer to use legacy debouncing to avoid problems.
>>
>> Reported-by: Luca Pigliacampo <lucapgl2001@gmail.com>
>> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217833
>> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> 
> I'm not happy to see yet another DMI quirk solution here.
> 
> and I guess you're not happy with this either...

Yeah I was really hoping the first patch was enough for the issue.

If we can't come up with anything else we can potentially drop patches 2 
and 3. Even patch 1 alone will "significantly" improve the situation.

The other option I considered is to hardcode WinBlue debounce behavior 
"off" in Linux.

I don't think this is a good idea though though because we will likely 
trade bugs because the debounce values in the AML for systems using _AEI 
aren't actually used in Windows and might not have good values.

> 
> Are we sure there is no other way? Did you check an acpidump
> for the laptop and specifically for its ACPI powerbutton handling?

I'm not sure there is another way or not, but yes there is an acpidump 
attached to the bug in case you or anyone else has some ideas.

> 
> I would expect the ACPI powerbutton handler to somehow clear
> the bit, like how patch 1/3 clears it from the GPIO chip's
> own IRQ handler.
> 
> I see that drivers/acpi/button.c does:
> 
> static u32 acpi_button_event(void *data)
> {
>          acpi_os_execute(OSL_NOTIFY_HANDLER, acpi_button_notify_run, data);
>          return ACPI_INTERRUPT_HANDLED;
> }
> 
> So unless I'm misreading something here, there is some AML being
> executed on power-button events. So maybe there is something wrong
> with how Linux interprets that AML ?
> 
The relevant ACPI spec section is here:

https://uefi.org/htmlspecs/ACPI_Spec_6_4_html/04_ACPI_Hardware_Specification/ACPI_Hardware_Specification.html#control-method-power-button

I did look at the acpidump.  GPE 08 notifies \_SB.PWRB (a PNP0C0C 
device) with 0x2.  According to the spec this is specifically for 
letting the system know the power button is waking up the system from G1.

I don't see any notifications with data 0x80 in the AML.  So I'm 
wondering if the AML designer made an assumption that pressing the power 
button caused the system to suspend or turn off.  That's the Windows 
behavior, isn't it?

The spec even says:

"While the system is in the working state, a power button press is a 
user request to transition the system into either the sleeping (G1) or 
soft-off state (G2)."

I think it would be a really good data point whether this happens with 
Windows if possible too.  Then we can know if we're looking at a Linux 
bug or a platform bug.

  reply	other threads:[~2023-08-29 21:38 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-29 16:56 [PATCH 0/3] pinctrl-amd powerbtn handling regression Mario Limonciello
2023-08-29 16:56 ` [PATCH 1/3] pinctrl: amd: Clear `Less2secSts` and `Less10secSts` for GPIO0 Mario Limonciello
2023-08-29 16:56 ` [PATCH 2/3] pinctrl: amd: Add a module parameter to configure power button behavior Mario Limonciello
2023-08-29 16:56 ` [PATCH 3/3] pinctrl: amd: Add a quirk for Lenovo Ideapad 5 Mario Limonciello
2023-08-29 19:54   ` Hans de Goede
2023-08-29 21:37     ` Mario Limonciello [this message]
2023-08-30 15:37       ` Hans de Goede
2023-08-30 15:47         ` Mario Limonciello
2023-08-30 16:18           ` Hans de Goede
2023-08-31 17:53             ` Mario Limonciello
2023-09-12  7:08               ` Linus Walleij
2023-09-12  8:58                 ` Hans de Goede
2023-09-12 18:21                   ` Mario Limonciello
2023-09-13 21:21                     ` Mario Limonciello
2023-09-14  8:43                       ` Linus Walleij
2023-09-14  9:08                         ` Luca Pigliacampo
2023-09-14 14:38                           ` Mario Limonciello

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=07353676-bad0-44f8-a15a-4877f1898b6b@amd.com \
    --to=mario.limonciello@amd.com \
    --cc=Basavaraj.Natikar@amd.com \
    --cc=Shyam-sundar.S-k@amd.com \
    --cc=hdegoede@redhat.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucapgl2001@gmail.com \
    --cc=regressions@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®