lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 25 Jul 2023 16:09:08 -0500
From:   Bjorn Helgaas <helgaas@...nel.org>
To:     Frank Li <Frank.Li@....com>
Cc:     lorenzo.pieralisi@....com, manivannan.sadhasivam@...aro.org,
        bhelgaas@...gle.com, devicetree@...r.kernel.org,
        gustavo.pimentel@...opsys.com, imx@...ts.linux.dev, kw@...ux.com,
        leoyang.li@....com, linux-arm-kernel@...ts.infradead.org,
        linux-imx@....com, linux-kernel@...r.kernel.org,
        linux-pci@...r.kernel.org, mani@...nel.org, minghuan.lian@....com,
        mingkai.hu@....com, robh+dt@...nel.org, roy.zang@....com,
        shawnguo@...nel.org, zhiqiang.hou@....com
Subject: Re: [PATCH v5 2/2] PCI: layerscape: Add power management support for
 ls1028a

On Mon, Jul 24, 2023 at 05:58:30PM -0400, Frank Li wrote:
> From: Hou Zhiqiang <Zhiqiang.Hou@....com>
> 
> Add PME_Turn_Off/PME_TO_Ack handshake sequence, and finally
> put the PCIe controller into D3 state after the L2/L3 ready
> state transition process completion.
> ...

> +#ifdef CONFIG_PM_SLEEP
> +static int ls_pcie_suspend_noirq(struct device *dev)
> +{
> +	struct ls_pcie *pcie = dev_get_drvdata(dev);
> +	struct dw_pcie *pci = pcie->pci;
> +
> +	if (!pcie->drvdata->pm_support)
> +		return 0;
> +
> +	return dw_pcie_suspend_noirq(pci);
> +}
> +
> +static int ls_pcie_resume_noirq(struct device *dev)
> +{
> +
> +	struct ls_pcie *pcie = dev_get_drvdata(dev);
> +	struct dw_pcie *pci = pcie->pci;
> +
> +	if (!pcie->drvdata->pm_support)
> +		return 0;
> +
> +	return dw_pcie_resume_noirq(pci);
> +}
> +#endif /* CONFIG_PM_SLEEP */

You may be able to dispense with some of these #ifdefs as in
https://lore.kernel.org/all/20220720224829.GA1667002@bhelgaas/

> +static const struct dev_pm_ops ls_pcie_pm_ops = {
> +	SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(ls_pcie_suspend_noirq,
> +				      ls_pcie_resume_noirq)
> +};
> +
>  static struct platform_driver ls_pcie_driver = {
>  	.probe = ls_pcie_probe,
>  	.driver = {
>  		.name = "layerscape-pcie",
>  		.of_match_table = ls_pcie_of_match,
>  		.suppress_bind_attrs = true,
> +		.pm = &ls_pcie_pm_ops,
>  	},
>  };
>  builtin_platform_driver(ls_pcie_driver);
> -- 
> 2.34.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ