aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/pci-calgary_64.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c
index 849a0995d970..c563e4c8ff39 100644
--- a/arch/x86/kernel/pci-calgary_64.c
+++ b/arch/x86/kernel/pci-calgary_64.c
@@ -316,13 +316,15 @@ static inline struct iommu_table *find_iommu_table(struct device *dev)
316 316
317 pdev = to_pci_dev(dev); 317 pdev = to_pci_dev(dev);
318 318
319 /* search up the device tree for an iommu */
319 pbus = pdev->bus; 320 pbus = pdev->bus;
320 321 do {
321 /* is the device behind a bridge? Look for the root bus */ 322 tbl = pci_iommu(pbus);
322 while (pbus->parent) 323 if (tbl && tbl->it_busno == pbus->number)
324 break;
325 tbl = NULL;
323 pbus = pbus->parent; 326 pbus = pbus->parent;
324 327 } while (pbus);
325 tbl = pci_iommu(pbus);
326 328
327 BUG_ON(tbl && (tbl->it_busno != pbus->number)); 329 BUG_ON(tbl && (tbl->it_busno != pbus->number));
328 330