linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pci: check PCI_EXP_FLAGS_SLOT before setting hotplug bridge
@ 2013-11-18  9:40 Adam Lee
  2013-11-18 17:38 ` Bjorn Helgaas
  0 siblings, 1 reply; 6+ messages in thread
From: Adam Lee @ 2013-11-18  9:40 UTC (permalink / raw)
  To: linux-pci; +Cc: Bjorn Helgaas, open list

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, &reg16);
+	if (!(reg16 & PCI_EXP_FLAGS_SLOT))
+		return;
+
 	pcie_capability_read_dword(pdev, PCI_EXP_SLTCAP, &reg32);
 	if (reg32 & PCI_EXP_SLTCAP_HPC)
 		pdev->is_hotplug_bridge = 1;
-- 
1.8.4.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-11-20  7:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-18  9:40 [PATCH] pci: check PCI_EXP_FLAGS_SLOT before setting hotplug bridge Adam Lee
2013-11-18 17:38 ` 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

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).