Skip to content

Commit 759dec2

Browse files
paliLorenzo Pieralisi
authored andcommitted
PCI: aardvark: Disable link training when unbinding driver
Disable link training circuit in driver unbind sequence. We want to leave link training in the same state as it was before the driver was probed. Link: https://lore.kernel.org/r/20211130172913.9727-11-kabel@kernel.org Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Marek Behún <kabel@kernel.org> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
1 parent 1f54391 commit 759dec2

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

drivers/pci/controller/pci-aardvark.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1741,6 +1741,11 @@ static int advk_pcie_remove(struct platform_device *pdev)
17411741
if (pcie->reset_gpio)
17421742
gpiod_set_value_cansleep(pcie->reset_gpio, 1);
17431743

1744+
/* Disable link training */
1745+
val = advk_readl(pcie, PCIE_CORE_CTRL0_REG);
1746+
val &= ~LINK_TRAINING_EN;
1747+
advk_writel(pcie, val, PCIE_CORE_CTRL0_REG);
1748+
17441749
/* Disable outbound address windows mapping */
17451750
for (i = 0; i < OB_WIN_COUNT; i++)
17461751
advk_pcie_disable_ob_win(pcie, i);

0 commit comments

Comments
 (0)