Re: [PATCH 5/5] PCI/pwrctrl: Switch to the new pwrctrl APIs

From: Manivannan Sadhasivam
Date: Tue Nov 25 2025 - 02:30:40 EST


On Tue, Nov 25, 2025 at 03:18:12PM +0800, Chen-Yu Tsai wrote:
> On Tue, Nov 25, 2025 at 3:15 PM Manivannan Sadhasivam
> <manivannan.sadhasivam@xxxxxxxxxxxxxxxx> wrote:
> >
> > Adopt the recently introduced pwrctrl APIs to create, power on, destroy,
> > and power off pwrctrl devices. In qcom_pcie_host_init(), call
> > pci_pwrctrl_create_devices() to create devices, then
> > pci_pwrctrl_power_on_devices() to power them on, both after controller
> > resource initialization. Once successful, deassert PERST# for all devices.
> >
> > In qcom_pcie_host_deinit(), call pci_pwrctrl_power_off_devices() after
> > asserting PERST#. Note that pci_pwrctrl_destroy_devices() is not called
> > here, as deinit is only invoked during system suspend where device
> > destruction is unnecessary. If the driver becomes removable in future,
> > pci_pwrctrl_destroy_devices() should be called in the remove() handler.
> >
> > At last, remove the old pwrctrl framework code from the PCI core, as the
> > new APIs are now the sole consumer of pwrctrl functionality. And also do
> > not power on the pwrctrl drivers during probe() as this is now handled by
> > the APIs.
> >
> > Co-developed-by: Krishna Chaitanya Chundru <krishna.chundru@xxxxxxxxxxxxxxxx>
> > Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@xxxxxxxxxxxxxxxx>
> > Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxxxxxxxx>
> > ---
> > drivers/pci/controller/dwc/pcie-qcom.c | 22 ++++++++++--
> > drivers/pci/probe.c | 59 --------------------------------
> > drivers/pci/pwrctrl/core.c | 15 --------
> > drivers/pci/pwrctrl/pci-pwrctrl-pwrseq.c | 5 ---
> > drivers/pci/pwrctrl/slot.c | 2 --
> > drivers/pci/remove.c | 20 -----------
> > 6 files changed, 20 insertions(+), 103 deletions(-)
>
> [...]
>
> > @@ -66,7 +47,6 @@ static void pci_destroy_dev(struct pci_dev *dev)
> > pci_doe_destroy(dev);
> > pcie_aspm_exit_link_state(dev);
> > pci_bridge_d3_update(dev);
> > - pci_pwrctrl_unregister(&dev->dev);
> > pci_free_resources(dev);
> > put_device(&dev->dev);
>
> This hunk has a minor conflict with
>
> 079115370d00 PCI/IDE: Initialize an ID for all IDE streams
>
> already in linux-next.
>

This series in based on v6.18-rc1, so there might be conflicts when applied to
-next. I'm not targeting v6.19 anyway as we are pretty close to merge window. We
have also merged a new pwrctrl driver for v6.19 recently and that too needs some
work, but shouldn't impact non-Qcom QCS6490 platforms.

- Mani

--
மணிவண்ணன் சதாசிவம்