[PATCH] PCI: dw-rockchip: Add system PM support

Damien Le Moal dlemoal at kernel.org
Thu Apr 10 19:02:52 PDT 2025


On 4/10/25 15:50, Shawn Lin wrote:
> +static int rockchip_pcie_suspend(struct device *dev)
> +{
> +	struct rockchip_pcie *rockchip = dev_get_drvdata(dev);
> +	struct dw_pcie *pci = &rockchip->pci;
> +	int ret;
> +
> +	rockchip->intx = rockchip_pcie_readl_apb(rockchip, PCIE_CLIENT_INTR_MASK_LEGACY);
> +
> +	ret = dw_pcie_suspend_noirq(pci);
> +	if (ret) {
> +		dev_err(dev, "failed to suspend\n");
> +		return ret;
> +	}
> +
> +	rockchip_pcie_phy_deinit(rockchip);
> +	clk_bulk_disable_unprepare(rockchip->clk_cnt, rockchip->clks);
> +	reset_control_assert(rockchip->rst);
> +	if (rockchip->vpcie3v3)
> +		regulator_disable(rockchip->vpcie3v3);
> +	gpiod_set_value_cansleep(rockchip->rst_gpio, 0);
> +
> +	return 0;
> +}

This function needs a __maybe_unused in its declaration, otherwise, you get a
compilation warning when PM is not enabled.

static int __maybe_unused rockchip_pcie_suspend(struct device *dev)


> +static int rockchip_pcie_resume(struct device *dev)

Same here too.


-- 
Damien Le Moal
Western Digital Research



More information about the Linux-rockchip mailing list