linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sachi King <nakato@nakato.io>
To: linux-gpio@vger.kernel.org, basavaraj.natikar@amd.com
Subject: Pinctrl-amd interrupt states on boot
Date: Fri, 24 Sep 2021 23:53:13 +1000	[thread overview]
Message-ID: <5303579.8qqCIou7Ap@youmu> (raw)

I've been working on getting Linux running on the AMD variant of the Microsoft 
Surface Laptop 4, and have tracked down high power consumption and spurious 
wakes in the s2idle state to the interrupt states configured on the AMD GPIO 
chip under pinctrl-amd, in this case an AMDI0031.
I don't think pinctrl-amd has has been used as a wakeup source yet, as it 
never called enable_irq_wake until this[0] patch, which has not hit mainline 
yet.

I read the gpio state before allowing pinctrl-amd to setup, there's 183 pins,
and there are a number configured.  Pin 6 and 11 for example are configured 
with.
6: 0x00c50000: Driver Strength 2, Output enabled, Output high
11: 0x00052800: Interrupt Enabled, Wake in Si03, Driver Strength 2, Input high

My understanding is that on boot Linux expects interrupts to be disabled and 
masked on boot, and I have found that on boot, on this device, the interrupts 
are in various states of configuration.  I'm not sure if this is a quirk of the 
firmware of the Surface Laptop 4 and if I should add a quirk for this device, 
or if the pinctrl-amd driver needs to loop over the pins and disable, mask, 
and clear the wakeup flags in general.  In either case I'm assuming output pins 
should be left alone.  I'm hoping for some thoughts on this.

[0]: https://lore.kernel.org/linux-gpio/20210831120613.1514899-1-Basavaraj.Natikar@amd.com/

Thanks,
Sachi



                 reply	other threads:[~2021-09-24 13:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=5303579.8qqCIou7Ap@youmu \
    --to=nakato@nakato.io \
    --cc=basavaraj.natikar@amd.com \
    --cc=linux-gpio@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).