[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1602008668-43646-1-git-send-email-Sanju.Mehta@amd.com>
Date: Tue, 6 Oct 2020 13:24:28 -0500
From: Sanjay R Mehta <Sanju.Mehta@....com>
To: bhelgaas@...gle.com, lukas@...ner.de,
andriy.shevchenko@...ux.intel.com, stuart.w.hayes@...il.com,
mr.nuke.me@...il.com
Cc: linux-kernel@...r.kernel.org, Sanjay R Mehta <sanju.mehta@....com>
Subject: [PATCH] PCI: pciehp: Add check for DL_ACTIVE bit in pciehp_check_link_status()
From: Sanjay R Mehta <sanju.mehta@....com>
if DL_ACTIVE bit is set it means that there is no need to check
PCI_EXP_LNKSTA_LT bit, as DL_ACTIVE would have set only if the link
is already trained. Hence adding a check which takes care of this
scenario.
Signed-off-by: Sanjay R Mehta <sanju.mehta@....com>
---
drivers/pci/hotplug/pciehp_hpc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
index 53433b3..81d1348 100644
--- a/drivers/pci/hotplug/pciehp_hpc.c
+++ b/drivers/pci/hotplug/pciehp_hpc.c
@@ -309,7 +309,8 @@ int pciehp_check_link_status(struct controller *ctrl)
pcie_capability_read_word(pdev, PCI_EXP_LNKSTA, &lnk_status);
ctrl_dbg(ctrl, "%s: lnk_status = %x\n", __func__, lnk_status);
- if ((lnk_status & PCI_EXP_LNKSTA_LT) ||
+ if (((lnk_status & PCI_EXP_LNKSTA_LT) &
+ !(lnk_status & PCI_EXP_DPC_CAP_DL_ACTIVE)) ||
!(lnk_status & PCI_EXP_LNKSTA_NLW)) {
ctrl_err(ctrl, "link training error: status %#06x\n",
lnk_status);
--
2.7.4
Powered by blists - more mailing lists