diff mbox series

[v2] PCI: imx6: Limit DBI register length for imx6qp PCIe

Message ID 1613789388-2495-2-git-send-email-hongxing.zhu@nxp.com
State New
Headers show
Series [v2] PCI: imx6: Limit DBI register length for imx6qp PCIe | expand

Commit Message

Hongxing Zhu Feb. 20, 2021, 2:49 a.m. UTC
Define the length of the DBI registers and limit config space to its
length. This makes sure that the kernel does not access registers beyond
that point that otherwise would lead to an abort on the i.MX 6QuadPlus.

See commit 075af61c19cd ("PCI: imx6: Limit DBI register length") that
resolves a similar issue on the i.MX 6Quad PCIe.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Krzysztof Wilczyński <kw@linux.com>
---
 drivers/pci/controller/dwc/pci-imx6.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Lorenzo Pieralisi June 21, 2021, 2:24 p.m. UTC | #1
On Sat, Feb 20, 2021 at 10:49:48AM +0800, Richard Zhu wrote:
> Define the length of the DBI registers and limit config space to its
> length. This makes sure that the kernel does not access registers beyond
> that point that otherwise would lead to an abort on the i.MX 6QuadPlus.
> 
> See commit 075af61c19cd ("PCI: imx6: Limit DBI register length") that
> resolves a similar issue on the i.MX 6Quad PCIe.
> 
> Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
> Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
> Reviewed-by: Krzysztof Wilczyński <kw@linux.com>
> ---
>  drivers/pci/controller/dwc/pci-imx6.c | 1 +
>  1 file changed, 1 insertion(+)

I'd like to merge this patch since I believe it is still required,
please let me know if that's not the case.

Lorenzo

> diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
> index 0cf1333c0440..853ea8e82952 100644
> --- a/drivers/pci/controller/dwc/pci-imx6.c
> +++ b/drivers/pci/controller/dwc/pci-imx6.c
> @@ -1175,6 +1175,7 @@ static const struct imx6_pcie_drvdata drvdata[] = {
>  		.variant = IMX6QP,
>  		.flags = IMX6_PCIE_FLAG_IMX6_PHY |
>  			 IMX6_PCIE_FLAG_IMX6_SPEED_CHANGE,
> +		.dbi_length = 0x200,
>  	},
>  	[IMX7D] = {
>  		.variant = IMX7D,
> -- 
> 2.17.1
>
Hongxing Zhu June 22, 2021, 12:41 a.m. UTC | #2
> -----Original Message-----
> From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Sent: Monday, June 21, 2021 10:24 PM
> To: Richard Zhu <hongxing.zhu@nxp.com>
> Cc: l.stach@pengutronix.de; kw@linux.com; bhelgaas@google.com;
> stefan@agner.ch; linux-pci@vger.kernel.org; dl-linux-imx
> <linux-imx@nxp.com>; linux-arm-kernel@lists.infradead.org;
> linux-kernel@vger.kernel.org; kernel@pengutronix.de
> Subject: Re: [PATCH v2] PCI: imx6: Limit DBI register length for imx6qp PCIe
> 
> On Sat, Feb 20, 2021 at 10:49:48AM +0800, Richard Zhu wrote:
> > Define the length of the DBI registers and limit config space to its
> > length. This makes sure that the kernel does not access registers
> > beyond that point that otherwise would lead to an abort on the i.MX
> 6QuadPlus.
> >
> > See commit 075af61c19cd ("PCI: imx6: Limit DBI register length") that
> > resolves a similar issue on the i.MX 6Quad PCIe.
> >
> > Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
> > Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
> > Reviewed-by: Krzysztof Wilczyński <kw@linux.com>
> > ---
> >  drivers/pci/controller/dwc/pci-imx6.c | 1 +
> >  1 file changed, 1 insertion(+)
> 
> I'd like to merge this patch since I believe it is still required, please let me
> know if that's not the case.
Hi Lorenzo:
Thanks for merging this patch.

Best Regards
Richard Zhu
> 
> Lorenzo
> 
> > diff --git a/drivers/pci/controller/dwc/pci-imx6.c
> > b/drivers/pci/controller/dwc/pci-imx6.c
> > index 0cf1333c0440..853ea8e82952 100644
> > --- a/drivers/pci/controller/dwc/pci-imx6.c
> > +++ b/drivers/pci/controller/dwc/pci-imx6.c
> > @@ -1175,6 +1175,7 @@ static const struct imx6_pcie_drvdata drvdata[] =
> {
> >  		.variant = IMX6QP,
> >  		.flags = IMX6_PCIE_FLAG_IMX6_PHY |
> >  			 IMX6_PCIE_FLAG_IMX6_SPEED_CHANGE,
> > +		.dbi_length = 0x200,
> >  	},
> >  	[IMX7D] = {
> >  		.variant = IMX7D,
> > --
> > 2.17.1
> >
diff mbox series

Patch

diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
index 0cf1333c0440..853ea8e82952 100644
--- a/drivers/pci/controller/dwc/pci-imx6.c
+++ b/drivers/pci/controller/dwc/pci-imx6.c
@@ -1175,6 +1175,7 @@  static const struct imx6_pcie_drvdata drvdata[] = {
 		.variant = IMX6QP,
 		.flags = IMX6_PCIE_FLAG_IMX6_PHY |
 			 IMX6_PCIE_FLAG_IMX6_SPEED_CHANGE,
+		.dbi_length = 0x200,
 	},
 	[IMX7D] = {
 		.variant = IMX7D,