From: Sanjay R Mehta <Sanju.Mehta@amd.com>
To: bhelgaas@google.com, lukas@wunner.de,
andriy.shevchenko@linux.intel.com, stuart.w.hayes@gmail.com,
mr.nuke.me@gmail.com
Cc: linux-kernel@vger.kernel.org, Sanjay R Mehta <sanju.mehta@amd.com>
Subject: [PATCH v2] pciehp: Add check for DL_ACTIVE bit in pciehp_check_link_status()
Date: Mon, 19 Oct 2020 13:46:11 -0500 [thread overview]
Message-ID: <1603133171-87982-1-git-send-email-Sanju.Mehta@amd.com> (raw)
From: Sanjay R Mehta <sanju.mehta@amd.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@amd.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 53433b37e181..8ab2f6a2f388 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_LNKSTA_DLLLA)) ||
!(lnk_status & PCI_EXP_LNKSTA_NLW)) {
ctrl_err(ctrl, "link training error: status %#06x\n",
lnk_status);
--
2.25.1
next reply other threads:[~2020-10-19 18:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-19 18:46 Sanjay R Mehta [this message]
2020-10-20 8:33 ` Ethan Zhao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1603133171-87982-1-git-send-email-Sanju.Mehta@amd.com \
--to=sanju.mehta@amd.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bhelgaas@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=mr.nuke.me@gmail.com \
--cc=stuart.w.hayes@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®