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]
Message-ID:
 <AS8PR04MB8676CBDB399711DB1BFE363E8CAF2@AS8PR04MB8676.eurprd04.prod.outlook.com>
Date: Wed, 2 Apr 2025 07:40:41 +0000
From: Hongxing Zhu <hongxing.zhu@....com>
To: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
CC: Frank Li <frank.li@....com>, "l.stach@...gutronix.de"
	<l.stach@...gutronix.de>, "lpieralisi@...nel.org" <lpieralisi@...nel.org>,
	"kw@...ux.com" <kw@...ux.com>, "robh@...nel.org" <robh@...nel.org>,
	"bhelgaas@...gle.com" <bhelgaas@...gle.com>, "shawnguo@...nel.org"
	<shawnguo@...nel.org>, "s.hauer@...gutronix.de" <s.hauer@...gutronix.de>,
	"kernel@...gutronix.de" <kernel@...gutronix.de>, "festevam@...il.com"
	<festevam@...il.com>, "linux-pci@...r.kernel.org"
	<linux-pci@...r.kernel.org>, "linux-arm-kernel@...ts.infradead.org"
	<linux-arm-kernel@...ts.infradead.org>, "imx@...ts.linux.dev"
	<imx@...ts.linux.dev>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v3 6/6] PCI: imx6: Save and restore the LUT setting for
 i.MX95 PCIe

> -----Original Message-----
> From: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
> Sent: 2025年4月2日 15:12
> To: Hongxing Zhu <hongxing.zhu@....com>
> Cc: Frank Li <frank.li@....com>; l.stach@...gutronix.de; lpieralisi@...nel.org;
> kw@...ux.com; robh@...nel.org; bhelgaas@...gle.com;
> shawnguo@...nel.org; s.hauer@...gutronix.de; kernel@...gutronix.de;
> festevam@...il.com; linux-pci@...r.kernel.org;
> linux-arm-kernel@...ts.infradead.org; imx@...ts.linux.dev;
> linux-kernel@...r.kernel.org
> Subject: Re: [PATCH v3 6/6] PCI: imx6: Save and restore the LUT setting for
> i.MX95 PCIe
> 
> On Fri, Mar 28, 2025 at 11:02:13AM +0800, Richard Zhu wrote:
> > The look up table(LUT) setting would be lost during PCIe suspend on i.MX95.
> >
> > To ensure proper functionality after resume, save and restore the LUT
> > setting in suspend and resume operations.
> >
> 
> There should be a fixes tag pointing to the commit added suspend/resume
> support.
> 
Okay, fixes tag would be added later.
Thanks.

Best Regards
Richard Zhu
> > Signed-off-by: Richard Zhu <hongxing.zhu@....com>
> 
> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
> 
> - Mani
> 
> > ---
> >  drivers/pci/controller/dwc/pci-imx6.c | 47
> > +++++++++++++++++++++++++++
> >  1 file changed, 47 insertions(+)
> >
> > diff --git a/drivers/pci/controller/dwc/pci-imx6.c
> > b/drivers/pci/controller/dwc/pci-imx6.c
> > index 40eeb02ffb5d..d8f4608eb7da 100644
> > --- a/drivers/pci/controller/dwc/pci-imx6.c
> > +++ b/drivers/pci/controller/dwc/pci-imx6.c
> > @@ -138,6 +138,11 @@ struct imx_pcie_drvdata {
> >  	const struct dw_pcie_host_ops *ops;
> >  };
> >
> > +struct imx_lut_data {
> > +	u32 data1;
> > +	u32 data2;
> > +};
> > +
> >  struct imx_pcie {
> >  	struct dw_pcie		*pci;
> >  	struct gpio_desc	*reset_gpiod;
> > @@ -157,6 +162,8 @@ struct imx_pcie {
> >  	struct regulator	*vph;
> >  	void __iomem		*phy_base;
> >
> > +	/* LUT data for pcie */
> > +	struct imx_lut_data	luts[IMX95_MAX_LUT];
> >  	/* power domain for pcie */
> >  	struct device		*pd_pcie;
> >  	/* power domain for pcie phy */
> > @@ -1505,6 +1512,42 @@ static void imx_pcie_msi_save_restore(struct
> imx_pcie *imx_pcie, bool save)
> >  	}
> >  }
> >
> > +static void imx_pcie_lut_save(struct imx_pcie *imx_pcie) {
> > +	u32 data1, data2;
> > +	int i;
> > +
> > +	for (i = 0; i < IMX95_MAX_LUT; i++) {
> > +		regmap_write(imx_pcie->iomuxc_gpr, IMX95_PE0_LUT_ACSCTRL,
> > +			     IMX95_PEO_LUT_RWA | i);
> > +		regmap_read(imx_pcie->iomuxc_gpr, IMX95_PE0_LUT_DATA1,
> &data1);
> > +		regmap_read(imx_pcie->iomuxc_gpr, IMX95_PE0_LUT_DATA2,
> &data2);
> > +		if (data1 & IMX95_PE0_LUT_VLD) {
> > +			imx_pcie->luts[i].data1 = data1;
> > +			imx_pcie->luts[i].data2 = data2;
> > +		} else {
> > +			imx_pcie->luts[i].data1 = 0;
> > +			imx_pcie->luts[i].data2 = 0;
> > +		}
> > +	}
> > +}
> > +
> > +static void imx_pcie_lut_restore(struct imx_pcie *imx_pcie) {
> > +	int i;
> > +
> > +	for (i = 0; i < IMX95_MAX_LUT; i++) {
> > +		if ((imx_pcie->luts[i].data1 & IMX95_PE0_LUT_VLD) == 0)
> > +			continue;
> > +
> > +		regmap_write(imx_pcie->iomuxc_gpr, IMX95_PE0_LUT_DATA1,
> > +			     imx_pcie->luts[i].data1);
> > +		regmap_write(imx_pcie->iomuxc_gpr, IMX95_PE0_LUT_DATA2,
> > +			     imx_pcie->luts[i].data2);
> > +		regmap_write(imx_pcie->iomuxc_gpr, IMX95_PE0_LUT_ACSCTRL, i);
> > +	}
> > +}
> > +
> >  static int imx_pcie_suspend_noirq(struct device *dev)  {
> >  	struct imx_pcie *imx_pcie = dev_get_drvdata(dev); @@ -1513,6 +1556,8
> > @@ static int imx_pcie_suspend_noirq(struct device *dev)
> >  		return 0;
> >
> >  	imx_pcie_msi_save_restore(imx_pcie, true);
> > +	if (imx_check_flag(imx_pcie, IMX_PCIE_FLAG_HAS_LUT))
> > +		imx_pcie_lut_save(imx_pcie);
> >  	if (imx_check_flag(imx_pcie, IMX_PCIE_FLAG_BROKEN_SUSPEND)) {
> >  		/*
> >  		 * The minimum for a workaround would be to set PERST# and to
> @@
> > -1557,6 +1602,8 @@ static int imx_pcie_resume_noirq(struct device *dev)
> >  		if (ret)
> >  			return ret;
> >  	}
> > +	if (imx_check_flag(imx_pcie, IMX_PCIE_FLAG_HAS_LUT))
> > +		imx_pcie_lut_restore(imx_pcie);
> >  	imx_pcie_msi_save_restore(imx_pcie, false);
> >
> >  	return 0;
> > --
> > 2.37.1
> >
> 
> --
> மணிவண்ணன் சதாசிவம்

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ