1 From 759dec2e3dfdbd261c41d2279f04f2351c971a49 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <pali@kernel.org>
3 Date: Tue, 30 Nov 2021 18:29:12 +0100
4 Subject: [PATCH] PCI: aardvark: Disable link training when unbinding driver
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 Disable link training circuit in driver unbind sequence. We want to
10 leave link training in the same state as it was before the driver was
13 Link: https://lore.kernel.org/r/20211130172913.9727-11-kabel@kernel.org
14 Signed-off-by: Pali Rohár <pali@kernel.org>
15 Signed-off-by: Marek Behún <kabel@kernel.org>
16 Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
18 drivers/pci/controller/pci-aardvark.c | 5 +++++
19 1 file changed, 5 insertions(+)
21 --- a/drivers/pci/controller/pci-aardvark.c
22 +++ b/drivers/pci/controller/pci-aardvark.c
23 @@ -1725,6 +1725,11 @@ static int advk_pcie_remove(struct platf
25 gpiod_set_value_cansleep(pcie->reset_gpio, 1);
27 + /* Disable link training */
28 + val = advk_readl(pcie, PCIE_CORE_CTRL0_REG);
29 + val &= ~LINK_TRAINING_EN;
30 + advk_writel(pcie, val, PCIE_CORE_CTRL0_REG);
32 /* Disable outbound address windows mapping */
33 for (i = 0; i < OB_WIN_COUNT; i++)
34 advk_pcie_disable_ob_win(pcie, i);