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

From: Chen-Yu Tsai
Date: Tue Nov 25 2025 - 02:18:52 EST


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.

> }
>
> --
> 2.48.1
>