Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f055a0619aae795832ef6a783021184925758b67
Commit:     f055a0619aae795832ef6a783021184925758b67
Parent:     3320ad994afb2c44ad34b3b34c3c5cf0da297331
Author:     Murillo Fernandes Bernardes <[EMAIL PROTECTED]>
AuthorDate: Fri Aug 10 22:31:00 2007 +0200
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Sat Aug 11 15:58:12 2007 -0700

    x86_64: Calgary - Fix mis-handled PCI topology
    
    Current code assumed that devices were directly connected to a Calgary
    bridge, as it tried to get the iommu table directly from the parent bus
    controller.
    
    When we have another bridge between the Calgary/CalIOC2 bridge and the
    device we should look upwards until we get to the top (Calgary/CalIOC2
    bridge), where the iommu table resides.
    
    Signed-off-by: Murillo Fernandes Bernardes <[EMAIL PROTECTED]>
    Signed-off-by: Muli Ben-Yehuda <[EMAIL PROTECTED]>
    Signed-off-by: Andi Kleen <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 arch/x86_64/kernel/pci-calgary.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/arch/x86_64/kernel/pci-calgary.c b/arch/x86_64/kernel/pci-calgary.c
index ba16c96..71da01e 100644
--- a/arch/x86_64/kernel/pci-calgary.c
+++ b/arch/x86_64/kernel/pci-calgary.c
@@ -367,16 +367,15 @@ static inline struct iommu_table *find_iommu_table(struct 
device *dev)
 
        pdev = to_pci_dev(dev);
 
-       /* is the device behind a bridge? */
-       if (unlikely(pdev->bus->parent))
-               pbus = pdev->bus->parent;
-       else
-               pbus = pdev->bus;
+       pbus = pdev->bus;
+
+       /* is the device behind a bridge? Look for the root bus */
+       while (pbus->parent)
+               pbus = pbus->parent;
 
        tbl = pci_iommu(pbus);
 
-       BUG_ON(pdev->bus->parent &&
-              (tbl->it_busno != pdev->bus->parent->number));
+       BUG_ON(tbl && (tbl->it_busno != pbus->number));
 
        return tbl;
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to