The patch titled x86_64: Calgary IOMMU: fix reference counting of Calgary PCI devices has been added to the -mm tree. Its filename is calgary-iommu-fix-reference-counting-of.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: x86_64: Calgary IOMMU: fix reference counting of Calgary PCI devices From: Muli Ben-Yehuda <muli@xxxxxxxxxx> The pci_get_device() API decrements the reference count on the 'from' parameter when it continues searching. Therefore, take a ref count on Calgary bus when we initialize them in either translated or non-translated mode. Signed-off-by: Muli Ben-Yehuda <muli@xxxxxxxxxx> Signed-off-by: Jon Mason <jdmason@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- arch/x86_64/kernel/pci-calgary.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff -puN arch/x86_64/kernel/pci-calgary.c~calgary-iommu-fix-reference-counting-of arch/x86_64/kernel/pci-calgary.c --- a/arch/x86_64/kernel/pci-calgary.c~calgary-iommu-fix-reference-counting-of +++ a/arch/x86_64/kernel/pci-calgary.c @@ -786,6 +786,7 @@ static inline unsigned int __init locate static int __init calgary_init_one_nontraslated(struct pci_dev *dev) { + pci_dev_get(dev); dev->sysdata = NULL; dev->bus->self = dev; @@ -810,6 +811,7 @@ static int __init calgary_init_one(struc if (ret) goto iounmap; + pci_dev_get(dev); dev->bus->self = dev; calgary_enable_translation(dev); @@ -836,10 +838,9 @@ static int __init calgary_init(void) calgary_init_one_nontraslated(dev); continue; } - if (!bus_info[dev->bus->number].tce_space && !translate_empty_slots) { - pci_dev_put(dev); + if (!bus_info[dev->bus->number].tce_space && !translate_empty_slots) continue; - } + ret = calgary_init_one(dev); if (ret) goto error; @@ -860,9 +861,10 @@ error: } if (!bus_info[dev->bus->number].tce_space && !translate_empty_slots) continue; + calgary_disable_translation(dev); calgary_free_bus(dev); - pci_dev_put(dev); + pci_dev_put(dev); /* Undo calgary_init_one()'s pci_dev_get() */ } return ret; _ Patches currently in -mm which might be from muli@xxxxxxxxxx are calgary-iommu-rearrange-struct-iommu_table.patch calgary-iommu-consolidate-per-bus-data.patch calgary-iommu-break-out-of.patch calgary-iommu-fix-error-path-memleak-in.patch calgary-iommu-fix-reference-counting-of.patch calgary-iommu.patch calgary-iommu-save-a-bit-of-space-in-bus_info.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html