All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Revert "arm64: a37xx: pci: Assert PERST# signal when unloading driver"
@ 2020-12-23 15:07 Pali Rohár
  2020-12-28  8:35 ` Stefan Roese
  0 siblings, 1 reply; 2+ messages in thread
From: Pali Rohár @ 2020-12-23 15:07 UTC (permalink / raw)
  To: u-boot

This reverts commit 828d32621686aec593076d16445d39b9b8d49c05.

This change revers code which asserting PERST# signal when unloading
driver. Driver's remove callback is still there as it is used for other
functionality.

Asserting PERST# signal prior booting kernel is causing that A3720 boards
(Turris MOX and Espressobin) with stable Linux kernel versions 4.14 and
4.19 are not able to detect some PCIe cards (e.g. Compex WLE200 and WLE900)
and anymore. When PERST# signal is not asserted these cards are detected
correctly. As this is regression for existing stable Linux kernel versions
revert this problematic change in U-Boot.

To make cards working with OpenWRT 4.14 kernel it is needed to disable link
training prior booting kernel, which is already done in driver's remove
callback.

Described issue is in Linux kernel pci aardvark driver which is (hopefully)
fixed in latest upstream versions. Latest upstream versions should be able
to initialize PCIe bus and detects cards independently of the link training
and PERST# signal state.

So with this change, U-Boot on A3720 boards should be able to boot OpenWRT
4.14 kernel, stable 4.14 and 4.19 kernels and also latest mainline kernels.

Signed-off-by: Pali Roh?r <pali@kernel.org>
---
Stefan, please include this patch for U-Boot 2020.01 release. It fixes
using PCIe cards on Espressobin with OpenWRT which G?rald reported to
me and I was reproduced it.

G?rald, if you have a time please this patch if it fixes this issue.

I have tested this patch with OpenWRT 4.14 kernel, stable 4.19 kernel
and mainline 5.10 on Espressobin. And with OpenWRT TurrisOS 4.14 kernel
and mainline 5.10 on Turris MOX. Both after cold boot and reboot with
Compex WLE900 and WLE200 cards.

I hope that there would not be any new regression.
---
 drivers/pci/pci-aardvark.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/pci/pci-aardvark.c b/drivers/pci/pci-aardvark.c
index babb84ca93..5c6e30e667 100644
--- a/drivers/pci/pci-aardvark.c
+++ b/drivers/pci/pci-aardvark.c
@@ -649,9 +649,6 @@ static int pcie_advk_remove(struct udevice *dev)
 	struct pcie_advk *pcie = dev_get_priv(dev);
 	u32 reg;
 
-	if (dm_gpio_is_valid(&pcie->reset_gpio))
-		dm_gpio_set_value(&pcie->reset_gpio, 1);
-
 	reg = advk_readl(pcie, PCIE_CORE_CTRL0_REG);
 	reg &= ~LINK_TRAINING_EN;
 	advk_writel(pcie, reg, PCIE_CORE_CTRL0_REG);
-- 
2.20.1

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

* [PATCH] Revert "arm64: a37xx: pci: Assert PERST# signal when unloading driver"
  2020-12-23 15:07 [PATCH] Revert "arm64: a37xx: pci: Assert PERST# signal when unloading driver" Pali Rohár
@ 2020-12-28  8:35 ` Stefan Roese
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Roese @ 2020-12-28  8:35 UTC (permalink / raw)
  To: u-boot

On 23.12.20 16:07, Pali Roh?r wrote:
> This reverts commit 828d32621686aec593076d16445d39b9b8d49c05.
> 
> This change revers code which asserting PERST# signal when unloading
> driver. Driver's remove callback is still there as it is used for other
> functionality.
> 
> Asserting PERST# signal prior booting kernel is causing that A3720 boards
> (Turris MOX and Espressobin) with stable Linux kernel versions 4.14 and
> 4.19 are not able to detect some PCIe cards (e.g. Compex WLE200 and WLE900)
> and anymore. When PERST# signal is not asserted these cards are detected
> correctly. As this is regression for existing stable Linux kernel versions
> revert this problematic change in U-Boot.
> 
> To make cards working with OpenWRT 4.14 kernel it is needed to disable link
> training prior booting kernel, which is already done in driver's remove
> callback.
> 
> Described issue is in Linux kernel pci aardvark driver which is (hopefully)
> fixed in latest upstream versions. Latest upstream versions should be able
> to initialize PCIe bus and detects cards independently of the link training
> and PERST# signal state.
> 
> So with this change, U-Boot on A3720 boards should be able to boot OpenWRT
> 4.14 kernel, stable 4.14 and 4.19 kernels and also latest mainline kernels.
> 
> Signed-off-by: Pali Roh?r <pali@kernel.org>
> ---
> Stefan, please include this patch for U-Boot 2020.01 release. It fixes
> using PCIe cards on Espressobin with OpenWRT which G?rald reported to
> me and I was reproduced it.

Will do.

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

Thanks,
Stefan

> G?rald, if you have a time please this patch if it fixes this issue.
> 
> I have tested this patch with OpenWRT 4.14 kernel, stable 4.19 kernel
> and mainline 5.10 on Espressobin. And with OpenWRT TurrisOS 4.14 kernel
> and mainline 5.10 on Turris MOX. Both after cold boot and reboot with
> Compex WLE900 and WLE200 cards.
> 
> I hope that there would not be any new regression.
> ---
>   drivers/pci/pci-aardvark.c | 3 ---
>   1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/pci/pci-aardvark.c b/drivers/pci/pci-aardvark.c
> index babb84ca93..5c6e30e667 100644
> --- a/drivers/pci/pci-aardvark.c
> +++ b/drivers/pci/pci-aardvark.c
> @@ -649,9 +649,6 @@ static int pcie_advk_remove(struct udevice *dev)
>   	struct pcie_advk *pcie = dev_get_priv(dev);
>   	u32 reg;
>   
> -	if (dm_gpio_is_valid(&pcie->reset_gpio))
> -		dm_gpio_set_value(&pcie->reset_gpio, 1);
> -
>   	reg = advk_readl(pcie, PCIE_CORE_CTRL0_REG);
>   	reg &= ~LINK_TRAINING_EN;
>   	advk_writel(pcie, reg, PCIE_CORE_CTRL0_REG);
> 


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 at denx.de

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

end of thread, other threads:[~2020-12-28  8:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-23 15:07 [PATCH] Revert "arm64: a37xx: pci: Assert PERST# signal when unloading driver" Pali Rohár
2020-12-28  8:35 ` 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.