public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Niklas Cassel <cassel@kernel.org>
To: Manivannan Sadhasivam <mani@kernel.org>
Cc: "Sean Anderson" <sean.anderson@seco.com>,
	manivannan.sadhasivam@oss.qualcomm.com,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Bartosz Golaszewski" <brgl@bgdev.pl>,
	linux-pci@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org, "Chen-Yu Tsai" <wens@kernel.org>,
	"Brian Norris" <briannorris@chromium.org>,
	"Krishna Chaitanya Chundru" <krishna.chundru@oss.qualcomm.com>,
	"Alex Elder" <elder@riscstar.com>,
	"Bartosz Golaszewski" <bartosz.golaszewski@oss.qualcomm.com>,
	"Chen-Yu Tsai" <wenst@chromium.org>,
	"Bartosz Golaszewski" <bartosz.golaszewski@linaro.org>
Subject: Re: [PATCH v4 0/8] PCI/pwrctrl: Major rework to integrate pwrctrl devices with controller drivers
Date: Fri, 16 Jan 2026 14:40:36 +0100	[thread overview]
Message-ID: <aWo_kP170j7r4q1a@ryzen> (raw)
In-Reply-To: <55cqkglbgji7tz34hk7aishyq3wal3oba5hy2yfvdbnkugadyg@56yh35kcgtwf>

On Fri, Jan 16, 2026 at 11:54:26AM +0530, Manivannan Sadhasivam wrote:
> On Thu, Jan 15, 2026 at 02:26:32PM -0500, Sean Anderson wrote:
> > > 
> > > Not at all. We cannot model PERST# as a GPIO in all the cases. Some drivers
> > > implement PERST# as a set of MMIO operations in the Root Complex MMIO space and
> > > that space belongs to the controller driver.
> > 
> > That's what I mean. Implement a GPIO driver with one GPIO and perform
> > the MMIO operations as requested.
> > 
> > Or we can invert things and add a reset op to pci_ops. If present then
> > call it, and if absent use the PERST GPIO on the bridge.
> > 
> 
> Having a callback for controlling the PERST# will work for the addressing the
> PERST# issue, but it won't solve the PCIe switch issue we were talking above.
> And this API design will fix both the problems.
> 
> But even in this callback design, you need to have modifications in the existing
> controller drivers to integrate pwrctrl. So how that is different from calling
> just two (or one unified API for create/power_on)?

FWIW, I do think that it is a good idea to create a reset op to pci_ops
that will implement PERST# assertion/deassertion.

Right now, it is a mess, with various drivers doing this at various
different places.

Having a specific callback, the driver implement it however they want
GPIO, MMIO, whatever, and it could even be called by (in case of DWC,
the host_init, by pwrctrl, or potentially by the PCI core itself before
enumerating the bus.

If we don't do something about it now, the problem will just get worse
with time. Yes, it will take time before all drivers have migrated and
been tested to have a dedicated PERST# reset op, but for the long term
maintainability, I think it is something that we should do.

I also know that some drivers have some loops with retry logic, where
they might go down in link speed, but right now I don't see why those
drivers shouldn't be able to keep that retry logic just because we
add a dedicated PERST# callback.


All that said, that would be a separate endeavor and can be implemented
later.


Kind regards,
Niklas

  reply	other threads:[~2026-01-16 13:40 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-05 13:55 [PATCH v4 0/8] PCI/pwrctrl: Major rework to integrate pwrctrl devices with controller drivers Manivannan Sadhasivam via B4 Relay
2026-01-05 13:55 ` [PATCH v4 1/8] PCI/pwrctrl: tc9563: Use put_device() instead of i2c_put_adapter() Manivannan Sadhasivam via B4 Relay
2026-01-05 13:55 ` [PATCH v4 2/8] PCI/pwrctrl: Add 'struct pci_pwrctrl::power_{on/off}' callbacks Manivannan Sadhasivam via B4 Relay
2026-01-06 13:45   ` Bartosz Golaszewski
2026-01-12  3:27   ` Bjorn Helgaas
2026-01-14 16:17     ` Bjorn Helgaas
2026-01-14 16:36     ` Manivannan Sadhasivam
2026-01-05 13:55 ` [PATCH v4 3/8] PCI/pwrctrl: Add APIs for explicitly creating and destroying pwrctrl devices Manivannan Sadhasivam via B4 Relay
2026-01-05 13:55 ` [PATCH v4 4/8] PCI/pwrctrl: Add APIs to power on/off the " Manivannan Sadhasivam via B4 Relay
2026-01-12  3:27   ` Bjorn Helgaas
2026-01-05 13:55 ` [PATCH v4 5/8] PCI/pwrctrl: Switch to the new pwrctrl APIs Manivannan Sadhasivam via B4 Relay
2026-01-05 13:55 ` [PATCH v4 6/8] PCI: qcom: Drop the assert_perst() callbacks Manivannan Sadhasivam via B4 Relay
2026-01-05 13:55 ` [PATCH v4 7/8] PCI: Drop the assert_perst() callback Manivannan Sadhasivam via B4 Relay
2026-01-06 13:46   ` Bartosz Golaszewski
2026-01-05 13:55 ` [PATCH v4 8/8] PCI: qcom: Rename PERST# assert/deassert helpers for uniformity Manivannan Sadhasivam via B4 Relay
2026-01-12  3:31 ` [PATCH v4 0/8] PCI/pwrctrl: Major rework to integrate pwrctrl devices with controller drivers Bjorn Helgaas
2026-01-12  7:53   ` Manivannan Sadhasivam
2026-01-12 12:13     ` Bjorn Helgaas
2026-01-13 17:15 ` Sean Anderson
2026-01-14  8:48   ` Manivannan Sadhasivam
2026-01-14 10:02     ` Chen-Yu Tsai
2026-01-15 19:26     ` Sean Anderson
2026-01-16  6:24       ` Manivannan Sadhasivam
2026-01-16 13:40         ` Niklas Cassel [this message]
2026-01-16 14:13           ` Manivannan Sadhasivam
2026-01-16 14:48           ` Shawn Lin
2026-01-16 14:51           ` Manivannan Sadhasivam
2026-01-16  8:02 ` Shawn Lin
2026-01-16  8:30   ` Manivannan Sadhasivam
2026-01-16  8:43     ` Shawn Lin

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=aWo_kP170j7r4q1a@ryzen \
    --to=cassel@kernel.org \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=bartosz.golaszewski@oss.qualcomm.com \
    --cc=bhelgaas@google.com \
    --cc=brgl@bgdev.pl \
    --cc=briannorris@chromium.org \
    --cc=elder@riscstar.com \
    --cc=krishna.chundru@oss.qualcomm.com \
    --cc=kwilczynski@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=mani@kernel.org \
    --cc=manivannan.sadhasivam@oss.qualcomm.com \
    --cc=robh@kernel.org \
    --cc=sean.anderson@seco.com \
    --cc=wens@kernel.org \
    --cc=wenst@chromium.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