All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm: a37xx: pci: Fix condition for CRS response
@ 2021-10-19  9:05 Pali Rohár
  2021-10-20  9:51 ` Stefan Roese
  2021-10-21  7:48 ` Stefan Roese
  0 siblings, 2 replies; 3+ messages in thread
From: Pali Rohár @ 2021-10-19  9:05 UTC (permalink / raw)
  To: Stefan Roese; +Cc: Konstantin Porotchkin, u-boot

As stated in comment above the code, CRS response can be returned to OS
only for 4-byte PCI_VENDOR_ID config read request. So fix the code.

Fixes: 1d7ad68559e2 ("arm: a37xx: pci: Handle propagation of CRSSVE bit from PCIe Root Port")
Signed-off-by: Pali Rohár <pali@kernel.org>
---
 drivers/pci/pci-aardvark.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/pci-aardvark.c b/drivers/pci/pci-aardvark.c
index ade5ab056f84..9e623b6e617b 100644
--- a/drivers/pci/pci-aardvark.c
+++ b/drivers/pci/pci-aardvark.c
@@ -445,7 +445,7 @@ static int pcie_advk_read_config(const struct udevice *bus, pci_dev_t bdf,
 	 * for returning CRS, so that if U-Boot does support CRS in the future,
 	 * it will work for Aardvark.
 	 */
-	allow_crs = pcie->cfgcrssve;
+	allow_crs = (offset == PCI_VENDOR_ID) && (size == PCI_SIZE_32) && pcie->cfgcrssve;
 
 	if (advk_readl(pcie, PIO_START)) {
 		dev_err(pcie->dev,
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] arm: a37xx: pci: Fix condition for CRS response
  2021-10-19  9:05 [PATCH] arm: a37xx: pci: Fix condition for CRS response Pali Rohár
@ 2021-10-20  9:51 ` Stefan Roese
  2021-10-21  7:48 ` Stefan Roese
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Roese @ 2021-10-20  9:51 UTC (permalink / raw)
  To: Pali Rohár; +Cc: Konstantin Porotchkin, u-boot

On 19.10.21 11:05, Pali Rohár wrote:
> As stated in comment above the code, CRS response can be returned to OS
> only for 4-byte PCI_VENDOR_ID config read request. So fix the code.
> 
> Fixes: 1d7ad68559e2 ("arm: a37xx: pci: Handle propagation of CRSSVE bit from PCIe Root Port")
> Signed-off-by: Pali Rohár <pali@kernel.org>

Reviewed-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan

> ---
>   drivers/pci/pci-aardvark.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/pci-aardvark.c b/drivers/pci/pci-aardvark.c
> index ade5ab056f84..9e623b6e617b 100644
> --- a/drivers/pci/pci-aardvark.c
> +++ b/drivers/pci/pci-aardvark.c
> @@ -445,7 +445,7 @@ static int pcie_advk_read_config(const struct udevice *bus, pci_dev_t bdf,
>   	 * for returning CRS, so that if U-Boot does support CRS in the future,
>   	 * it will work for Aardvark.
>   	 */
> -	allow_crs = pcie->cfgcrssve;
> +	allow_crs = (offset == PCI_VENDOR_ID) && (size == PCI_SIZE_32) && pcie->cfgcrssve;
>   
>   	if (advk_readl(pcie, PIO_START)) {
>   		dev_err(pcie->dev,
> 


Viele Grüße,
Stefan

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] arm: a37xx: pci: Fix condition for CRS response
  2021-10-19  9:05 [PATCH] arm: a37xx: pci: Fix condition for CRS response Pali Rohár
  2021-10-20  9:51 ` Stefan Roese
@ 2021-10-21  7:48 ` Stefan Roese
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Roese @ 2021-10-21  7:48 UTC (permalink / raw)
  To: Pali Rohár; +Cc: Konstantin Porotchkin, u-boot

On 19.10.21 11:05, Pali Rohár wrote:
> As stated in comment above the code, CRS response can be returned to OS
> only for 4-byte PCI_VENDOR_ID config read request. So fix the code.
> 
> Fixes: 1d7ad68559e2 ("arm: a37xx: pci: Handle propagation of CRSSVE bit from PCIe Root Port")
> Signed-off-by: Pali Rohár <pali@kernel.org>

Applied to u-boot-marvell/master

Thanks,
Stefan

> ---
>   drivers/pci/pci-aardvark.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/pci-aardvark.c b/drivers/pci/pci-aardvark.c
> index ade5ab056f84..9e623b6e617b 100644
> --- a/drivers/pci/pci-aardvark.c
> +++ b/drivers/pci/pci-aardvark.c
> @@ -445,7 +445,7 @@ static int pcie_advk_read_config(const struct udevice *bus, pci_dev_t bdf,
>   	 * for returning CRS, so that if U-Boot does support CRS in the future,
>   	 * it will work for Aardvark.
>   	 */
> -	allow_crs = pcie->cfgcrssve;
> +	allow_crs = (offset == PCI_VENDOR_ID) && (size == PCI_SIZE_32) && pcie->cfgcrssve;
>   
>   	if (advk_readl(pcie, PIO_START)) {
>   		dev_err(pcie->dev,
> 


Viele Grüße,
Stefan

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-21  7:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-19  9:05 [PATCH] arm: a37xx: pci: Fix condition for CRS response Pali Rohár
2021-10-20  9:51 ` Stefan Roese
2021-10-21  7:48 ` Stefan Roese

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.