From: Adam Lee <adam.lee@canonical.com>
To: linux-pci@vger.kernel.org
Cc: Bjorn Helgaas <bhelgaas@google.com>,
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH] pci: check PCI_EXP_FLAGS_SLOT before setting hotplug bridge
Date: Mon, 18 Nov 2013 17:40:52 +0800 [thread overview]
Message-ID: <1384767652-20567-1-git-send-email-adam.lee@canonical.com> (raw)
This patch adds the PCI_EXP_FLAGS_SLOT check back before setting
hotplug bridge, which is omitted by an API switching commit,
59875ae489609b2267548dc85160c5f0f0c6f9d4 "PCI/core: Use PCI Express
Capability accessors".
Some Lenovo laptops hang in booting without this fix.
Signed-off-by: Adam Lee <adam.lee@canonical.com>
---
drivers/pci/probe.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 5e14f5a..b93d5ac 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -992,8 +992,13 @@ void set_pcie_port_type(struct pci_dev *pdev)
void set_pcie_hotplug_bridge(struct pci_dev *pdev)
{
+ u16 reg16;
u32 reg32;
+ pcie_capability_read_word(pdev, PCI_EXP_FLAGS, ®16);
+ if (!(reg16 & PCI_EXP_FLAGS_SLOT))
+ return;
+
pcie_capability_read_dword(pdev, PCI_EXP_SLTCAP, ®32);
if (reg32 & PCI_EXP_SLTCAP_HPC)
pdev->is_hotplug_bridge = 1;
--
1.8.4.3
next reply other threads:[~2013-11-18 9:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-18 9:40 Adam Lee [this message]
2013-11-18 17:38 ` [PATCH] pci: check PCI_EXP_FLAGS_SLOT before setting hotplug bridge Bjorn Helgaas
2013-11-19 5:57 ` Adam Lee
2013-11-19 17:40 ` Bjorn Helgaas
2013-11-19 18:08 ` Myron Stowe
2013-11-20 7:09 ` Adam Lee
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=1384767652-20567-1-git-send-email-adam.lee@canonical.com \
--to=adam.lee@canonical.com \
--cc=bhelgaas@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).