mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-28 01:28:59 +00:00
8cc7ac54b6
Manually rebased: generic/backport-5.4/370-netfilter-nf_flow_table-fix-offloaded-connection-tim.patch generic/pending-5.4/800-bcma-get-SoC-device-struct-copy-its-DMA-params-to-th.patch mvebu/patches-5.4/021-arm64-dts-marvell-armada-37xx-Move-PCIe-comphy-handl.patch Removed upstreamed: generic/backport-5.4/040-ARM-8918-2-only-build-return_address-if-needed.patch layerscape/patches-5.4/819-uart-0004-MLK-18137-fsl_lpuart-Fix-loopback-mode.patch All others updated automatically. Compile-tested on: lantiq/xrx200, armvirt/64 Runtime-tested on: lantiq/xrx200, armvirt/64 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
61 lines
2.2 KiB
Diff
61 lines
2.2 KiB
Diff
From 6964494582f56a3882c2c53b0edbfe99eb32b2e1 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <pali@kernel.org>
|
|
Date: Thu, 30 Apr 2020 10:06:14 +0200
|
|
Subject: [PATCH] PCI: aardvark: Train link immediately after enabling training
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
Adding even 100ms (PCI_PM_D3COLD_WAIT) delay between enabling link
|
|
training and starting link training causes detection issues with some
|
|
buggy cards (such as Compex WLE900VX).
|
|
|
|
Move the code which enables link training immediately before the one
|
|
which starts link traning.
|
|
|
|
This fixes detection issues of Compex WLE900VX card on Turris MOX after
|
|
cold boot.
|
|
|
|
Link: https://lore.kernel.org/r/20200430080625.26070-2-pali@kernel.org
|
|
Fixes: f4c7d053d7f7 ("PCI: aardvark: Wait for endpoint to be ready...")
|
|
Tested-by: Tomasz Maciej Nowak <tmn505@gmail.com>
|
|
Signed-off-by: Pali Rohár <pali@kernel.org>
|
|
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
|
|
Acked-by: Rob Herring <robh@kernel.org>
|
|
Acked-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
|
---
|
|
drivers/pci/controller/pci-aardvark.c | 15 +++++++++------
|
|
1 file changed, 9 insertions(+), 6 deletions(-)
|
|
|
|
--- a/drivers/pci/controller/pci-aardvark.c
|
|
+++ b/drivers/pci/controller/pci-aardvark.c
|
|
@@ -315,11 +315,6 @@ static void advk_pcie_setup_hw(struct ad
|
|
reg |= LANE_COUNT_1;
|
|
advk_writel(pcie, reg, PCIE_CORE_CTRL0_REG);
|
|
|
|
- /* Enable link training */
|
|
- reg = advk_readl(pcie, PCIE_CORE_CTRL0_REG);
|
|
- reg |= LINK_TRAINING_EN;
|
|
- advk_writel(pcie, reg, PCIE_CORE_CTRL0_REG);
|
|
-
|
|
/* Enable MSI */
|
|
reg = advk_readl(pcie, PCIE_CORE_CTRL2_REG);
|
|
reg |= PCIE_CORE_CTRL2_MSI_ENABLE;
|
|
@@ -361,7 +356,15 @@ static void advk_pcie_setup_hw(struct ad
|
|
*/
|
|
msleep(PCI_PM_D3COLD_WAIT);
|
|
|
|
- /* Start link training */
|
|
+ /* Enable link training */
|
|
+ reg = advk_readl(pcie, PCIE_CORE_CTRL0_REG);
|
|
+ reg |= LINK_TRAINING_EN;
|
|
+ advk_writel(pcie, reg, PCIE_CORE_CTRL0_REG);
|
|
+
|
|
+ /*
|
|
+ * Start link training immediately after enabling it.
|
|
+ * This solves problems for some buggy cards.
|
|
+ */
|
|
reg = advk_readl(pcie, PCIE_CORE_LINK_CTRL_STAT_REG);
|
|
reg |= PCIE_CORE_LINK_TRAINING;
|
|
advk_writel(pcie, reg, PCIE_CORE_LINK_CTRL_STAT_REG);
|