diff mbox series

PCI: imx6: Limit DBI register length for imx6qp pcie

Message ID 1613624980-29382-1-git-send-email-hongxing.zhu@nxp.com (mailing list archive)
State Superseded
Headers show
Series PCI: imx6: Limit DBI register length for imx6qp pcie | expand

Commit Message

Hongxing Zhu Feb. 18, 2021, 5:09 a.m. UTC
Refer to commit 075af61c19cd ("PCI: imx6: Limit DBI register length"),
i.MX6QP PCIe has the similar issue.
Define the length of the DBI registers and limit config space to its
length for i.MX6QP PCIe too.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
---
 drivers/pci/controller/dwc/pci-imx6.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Lucas Stach Feb. 18, 2021, 8:59 a.m. UTC | #1
Am Donnerstag, dem 18.02.2021 um 13:09 +0800 schrieb Richard Zhu:
> Refer to commit 075af61c19cd ("PCI: imx6: Limit DBI register length"),
> i.MX6QP PCIe has the similar issue.
> Define the length of the DBI registers and limit config space to its
> length for i.MX6QP PCIe too.
> 
> Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>

Reviewed-by: Lucas Stach <l.stach@pengutronix.de>

> ---
>  drivers/pci/controller/dwc/pci-imx6.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> 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,
Krzysztof Wilczyński Feb. 18, 2021, 11:55 a.m. UTC | #2
Hi Richard,

Thank you for sending the patch over!

> Refer to commit 075af61c19cd ("PCI: imx6: Limit DBI register length"),
> i.MX6QP PCIe has the similar issue.
> Define the length of the DBI registers and limit config space to its
> length for i.MX6QP PCIe too.

You could probably flip these two sentences around to make the commit
message read slightly better, so what about this (a suggestion):

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 a i.MX 6QuadPlus.

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

> Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
> ---
>  drivers/pci/controller/dwc/pci-imx6.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> 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,

Reviewed-by: Krzysztof Wilczyński <kw@linux.com>

Krzysztof
Krzysztof Wilczyński Feb. 18, 2021, 5:34 p.m. UTC | #3
[...]
> > Refer to commit 075af61c19cd ("PCI: imx6: Limit DBI register length"),
> > i.MX6QP PCIe has the similar issue.
> > Define the length of the DBI registers and limit config space to its
> > length for i.MX6QP PCIe too.
> 
> You could probably flip these two sentences around to make the commit
> message read slightly better, so what about this (a suggestion):
> 
> 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 a i.MX 6QuadPlus.
> 
> See commit 075af61c19cd ("PCI: imx6: Limit DBI register length") that
> resolves a similar issue on a i.MX 6Quad PCIe.
[...]

If you do decide to send another version, then also use "PCIe" in the
subject, rather than "pcie".  I forgot to mention this in the previous
message, apologies.

Krzysztof
Hongxing Zhu Feb. 20, 2021, 1:27 a.m. UTC | #4
> -----Original Message-----
> From: Krzysztof Wilczyński <kw@linux.com>
> Sent: Friday, February 19, 2021 1:34 AM
> To: Richard Zhu <hongxing.zhu@nxp.com>
> Cc: l.stach@pengutronix.de; helgaas@kernel.org; stefan@agner.ch;
> lorenzo.pieralisi@arm.com; 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: [EXT] Re: [PATCH] PCI: imx6: Limit DBI register length for imx6qp pcie
> [...]
> > > Refer to commit 075af61c19cd ("PCI: imx6: Limit DBI register
> > > length"), i.MX6QP PCIe has the similar issue.
> > > Define the length of the DBI registers and limit config space to its
> > > length for i.MX6QP PCIe too.
> >
> > You could probably flip these two sentences around to make the commit
> > message read slightly better, so what about this (a suggestion):
> >
> > 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 a i.MX
> 6QuadPlus.
> >
> > See commit 075af61c19cd ("PCI: imx6: Limit DBI register length") that
> > resolves a similar issue on a i.MX 6Quad PCIe.
> [...]
> 
> If you do decide to send another version, then also use "PCIe" in the subject,
> rather than "pcie".  I forgot to mention this in the previous message,
> apologies.
> 
[Richard Zhu] Never mind. Thanks a lot for your comments.
Would issue another version a moment later.

Best Regards
Richard Zhu

> Krzysztof
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,