On Wed, Jul 06, 2022 at 08:10:24PM +0530, Krishna chaitanya chundru wrote: > Add suspend and resume pm callbacks. > > When system suspends, and if the link is in L1ss, disable the clocks > and power down the phy so that system enters into low power state to > save the maximum power. And when the system resumes, enable the clocks > back and power on phy if they are disabled in the suspend path. > > we are doing this only when link is in l1ss but not in L2/L3 as > no where we are forcing link to L2/L3 by sending PME turn off. > > is_suspended flag indicates if the clocks are disabled in the suspend > path or not. And this flag is being used to restrict the access to > config space, dbi etc when clock are turned-off. > Changes since v3: > - Powering down the phy in suspend and powering it on resume to > acheive maximum power savings. > Changes since v2: > - Replaced the enable, disable clks ops with suspend and resume > - Renamed support_pm_opsi flag with supports_system_suspend. > Changes since v1: > - Fixed compilation errors. Changelogs typically go below the --- line below so that they don't end up in the git logs. > Signed-off-by: Krishna chaitanya chundru <quic_krichai@xxxxxxxxxxx> > --- > drivers/pci/controller/dwc/pcie-qcom.c | 85 ++++++++++++++++++++++++++++++++++ > 1 file changed, 85 insertions(+) > +static int qcom_pcie_resume_2_7_0(struct qcom_pcie *pcie) > +{ > + struct qcom_pcie_resources_2_7_0 *res = &pcie->res.v2_7_0; > + int ret; > + > + clk_prepare_enable(res->pipe_clk); Note that pipe clock management has now been removed from this driver. Please consider rebasing on this branch: https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git/log/?h=pci/ctrl/qcom > + > + ret = clk_bulk_prepare_enable(res->num_clks, res->clks); > + > + phy_power_on(pcie->phy); > + > + return ret; > +} Johan