linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Hector Martin <marcan@marcan.st>
Cc: "Rob Herring" <robh@kernel.org>,
	"Lorenzo Pieralisi" <lorenzo.pieralisi@arm.com>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Alyssa Rosenzweig" <alyssa@rosenzweig.io>,
	"Sven Peter" <sven@svenpeter.dev>,
	PCI <linux-pci@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/3] PCI: apple: Add support for optional PWREN GPIO
Date: Thu, 05 May 2022 16:38:26 +0100	[thread overview]
Message-ID: <87wnf06lcd.wl-maz@kernel.org> (raw)
In-Reply-To: <57e47786-0b99-646e-9e73-694e47d14cf5@marcan.st>

On Wed, 04 May 2022 04:36:02 +0100,
Hector Martin <marcan@marcan.st> wrote:

[...]

> 
> So it'd go something like this:
> 
> - apcie driver, on slot activation, sees a pwren gpio/reg and powers it
> on prior to bringing up the link (and marks that port as d3cold supported)
> - sdhci-pci driver, on probe, sees an external card detect GPIO declared
> and considers that license to call pci_d3cold_enable and enable
> runtime-pm (since it won't need the internal card detect IRQ/GPIO)
> - No SD card is inserted, so SD driver goes into runtime suspend and
> saves whatever controller state it needs
> - PCI core saves whatever config space stuff it needs to save, SD
> controller is powered down via GPIO

I haven't quite found yet how this goes, but I can't say I tried in
anger. I guess that the root port device has to provide some standard
PM callbacks that would further tickle the regulator?

> - SD card is inserted, SMC GPIO IRQ notifies SD driver
> - SD driver goes out of runtime suspend
> - PCI core powers on controller, re-establishes link, restores config space
> - SD driver restores host controller registers and discovers the new card
> 
> No new APIs, this is all existing kernel stuff. PCI manages slot power
> same as it does on ACPI systems (that support it), driver interacts with
> it via runtime-pm and the d3cold control stuff.
> 
> I'm tempted to prototype this today and see how it goes...

Well, let us know how that goes.

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.

  reply	other threads:[~2022-05-05 15:38 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-02  9:38 [PATCH 0/3] PCI: apple: PWREN GPIO support & related fixes Hector Martin
2022-05-02  9:38 ` [PATCH 1/3] PCI: apple: GPIO handling nitfixes Hector Martin
2022-05-02 10:20   ` Marc Zyngier
2022-05-02 12:16     ` Hector Martin
2022-05-02 11:39   ` Greg KH
2022-05-02  9:38 ` [PATCH 2/3] PCI: apple: Probe all GPIOs for availability first Hector Martin
2022-05-02 10:23   ` Marc Zyngier
2022-05-02  9:38 ` [PATCH 3/3] PCI: apple: Add support for optional PWREN GPIO Hector Martin
2022-05-02 10:31   ` Marc Zyngier
2022-05-02 12:15     ` Hector Martin
2022-05-02 15:14   ` Rob Herring
2022-05-02 15:32     ` Hector Martin
2022-05-03  3:20       ` Hector Martin
2022-05-04  0:33         ` Rob Herring
2022-05-04  3:36           ` Hector Martin
2022-05-05 15:38             ` Marc Zyngier [this message]
2022-05-02 20:59 Mark Kettenis

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=87wnf06lcd.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=alyssa@rosenzweig.io \
    --cc=bhelgaas@google.com \
    --cc=kw@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=marcan@marcan.st \
    --cc=robh@kernel.org \
    --cc=sven@svenpeter.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;
as well as URLs for NNTP newsgroup(s).