aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikunj A Dadhania <nikunj@linux.vnet.ibm.com>2014-10-16 17:10:28 +0530
committerNikunj A Dadhania <nikunj@linux.vnet.ibm.com>2014-10-17 11:21:28 +0530
commit3a743ef6976213c3fa62b2237283b3fded359b0f (patch)
tree77a781518a1d77132692f4690372aeb7731a4a47
parent79db2275185f2dc2ac440f40e7d310490084e9f5 (diff)
downloadSLOF-3a743ef6976213c3fa62b2237283b3fded359b0f.zip
SLOF-3a743ef6976213c3fa62b2237283b3fded359b0f.tar.gz
SLOF-3a743ef6976213c3fa62b2237283b3fded359b0f.tar.bz2
pci: scan only type 0 and type 1
In certain cases when a PCI device is passthru and is frozen before it reaches SLOF. All PCI read result reading FF. This exposed a bug in the pci scan code which would wrongly take it as a pci brigde and try to scan devices below that and that would enter an infinite loop. Explicitly scan for type 0/1 and rest are not supported. Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
-rw-r--r--slof/fs/pci-scan.fs11
1 files changed, 6 insertions, 5 deletions
diff --git a/slof/fs/pci-scan.fs b/slof/fs/pci-scan.fs
index 7e860f4..8ab8cad 100644
--- a/slof/fs/pci-scan.fs
+++ b/slof/fs/pci-scan.fs
@@ -231,11 +231,12 @@ DEFER func-pci-bridge-range-props
dup set-space \ set the config addr for this device tree entry
dup pci-set-slot \ set the slot bit
dup pci-htype@ \ read HEADER-Type
- 1 and IF \ IF BRIDGE
- pci-bridge-setup \ | set up the bridge
- ELSE \ ELSE
- pci-device-setup \ | set up the device
- THEN \ FI
+ 7f and \ Mask bit 7 - multifunction device
+ CASE
+ 0 OF pci-device-setup ENDOF \ | set up the device
+ 1 OF pci-bridge-setup ENDOF \ | set up the bridge
+ dup OF dup pci-htype@ pci-out ENDOF
+ ENDCASE
finish-device \ and close the device-tree node
;