diff mbox

[v2] PCI: check if bus has a proper bridge device before triggering SBR

Message ID 1245996286-2025-1-git-send-email-yu.zhao@intel.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Yu Zhao June 26, 2009, 6:04 a.m. UTC
For devices attached to the root bus, we can't trigger Secondary Bus
Reset because there is no bridge device associated with the bus. So
need to check bus->self again NULL first before using it.

Reviewd-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Yu Zhao <yu.zhao@intel.com>
---
 drivers/pci/pci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Jesse Barnes June 29, 2009, 7:21 p.m. UTC | #1
On Fri, 26 Jun 2009 14:04:46 +0800
Yu Zhao <yu.zhao@intel.com> wrote:

> For devices attached to the root bus, we can't trigger Secondary Bus
> Reset because there is no bridge device associated with the bus. So
> need to check bus->self again NULL first before using it.
> 
> Reviewd-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
> Signed-off-by: Yu Zhao <yu.zhao@intel.com>
> ---

Applied to my for-linus branch, thanks.
diff mbox

Patch

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 6c93af5..d5d6f56 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -2171,7 +2171,7 @@  static int pci_parent_bus_reset(struct pci_dev *dev, int probe)
 	u16 ctrl;
 	struct pci_dev *pdev;
 
-	if (dev->subordinate)
+	if (pci_is_root_bus(dev->bus) || dev->subordinate || !dev->bus->self)
 		return -ENOTTY;
 
 	list_for_each_entry(pdev, &dev->bus->devices, bus_list)