diff options
author | Dave Airlie <airlied@redhat.com> | 2015-03-09 10:58:30 +0100 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2015-03-09 10:58:30 +0100 |
commit | a8c6ecb3be7029881f7c95e5e201a629094a4e1a (patch) | |
tree | eb006541f40528f51334eefc725f155c4ce386a6 /arch/powerpc/kernel/iommu.c | |
parent | Merge tag 'drm-intel-next-2015-02-27' of git://anongit.freedesktop.org/drm-in... (diff) | |
parent | Linux 4.0-rc3 (diff) | |
download | linux-a8c6ecb3be7029881f7c95e5e201a629094a4e1a.tar.xz linux-a8c6ecb3be7029881f7c95e5e201a629094a4e1a.zip |
Merge tag 'v4.0-rc3' into drm-next
Linux 4.0-rc3 backmerge to fix two i915 conflicts, and get
some mainline bug fixes needed for my testing box
Conflicts:
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/intel_display.c
Diffstat (limited to 'arch/powerpc/kernel/iommu.c')
-rw-r--r-- | arch/powerpc/kernel/iommu.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c index 5d3968c4d799..b054f33ab1fb 100644 --- a/arch/powerpc/kernel/iommu.c +++ b/arch/powerpc/kernel/iommu.c @@ -1175,4 +1175,30 @@ void iommu_del_device(struct device *dev) } EXPORT_SYMBOL_GPL(iommu_del_device); +static int tce_iommu_bus_notifier(struct notifier_block *nb, + unsigned long action, void *data) +{ + struct device *dev = data; + + switch (action) { + case BUS_NOTIFY_ADD_DEVICE: + return iommu_add_device(dev); + case BUS_NOTIFY_DEL_DEVICE: + if (dev->iommu_group) + iommu_del_device(dev); + return 0; + default: + return 0; + } +} + +static struct notifier_block tce_iommu_bus_nb = { + .notifier_call = tce_iommu_bus_notifier, +}; + +int __init tce_iommu_bus_notifier_init(void) +{ + bus_register_notifier(&pci_bus_type, &tce_iommu_bus_nb); + return 0; +} #endif /* CONFIG_IOMMU_API */ |