kernel-ark/drivers/iommu
Mitchel Humpherys a18037b27e iommu/arm-smmu: avoid calling request_irq in atomic context
request_irq shouldn't be called from atomic context since it might
sleep, but we're calling it with a spinlock held, resulting in:

    [    9.172202] BUG: sleeping function called from invalid context at kernel/mm/slub.c:926
    [    9.182989] in_atomic(): 1, irqs_disabled(): 128, pid: 1, name: swapper/0
    [    9.189762] CPU: 1 PID: 1 Comm: swapper/0 Tainted: G        W    3.10.40-gbc1b510b-38437-g55831d3bd9-dirty #97
    [    9.199757] [<c020c448>] (unwind_backtrace+0x0/0x11c) from [<c02097d0>] (show_stack+0x10/0x14)
    [    9.208346] [<c02097d0>] (show_stack+0x10/0x14) from [<c0301d74>] (kmem_cache_alloc_trace+0x3c/0x210)
    [    9.217543] [<c0301d74>] (kmem_cache_alloc_trace+0x3c/0x210) from [<c0276a48>] (request_threaded_irq+0x88/0x11c)
    [    9.227702] [<c0276a48>] (request_threaded_irq+0x88/0x11c) from [<c0931ca4>] (arm_smmu_attach_dev+0x188/0x858)
    [    9.237686] [<c0931ca4>] (arm_smmu_attach_dev+0x188/0x858) from [<c0212cd8>] (arm_iommu_attach_device+0x18/0xd0)
    [    9.247837] [<c0212cd8>] (arm_iommu_attach_device+0x18/0xd0) from [<c093314c>] (arm_smmu_test_probe+0x68/0xd4)
    [    9.257823] [<c093314c>] (arm_smmu_test_probe+0x68/0xd4) from [<c05aadd0>] (driver_probe_device+0x12c/0x330)
    [    9.267629] [<c05aadd0>] (driver_probe_device+0x12c/0x330) from [<c05ab080>] (__driver_attach+0x68/0x8c)
    [    9.277090] [<c05ab080>] (__driver_attach+0x68/0x8c) from [<c05a92d4>] (bus_for_each_dev+0x70/0x84)
    [    9.286118] [<c05a92d4>] (bus_for_each_dev+0x70/0x84) from [<c05aa3b0>] (bus_add_driver+0x100/0x244)
    [    9.295233] [<c05aa3b0>] (bus_add_driver+0x100/0x244) from [<c05ab5d0>] (driver_register+0x9c/0x124)
    [    9.304347] [<c05ab5d0>] (driver_register+0x9c/0x124) from [<c0933088>] (arm_smmu_test_init+0x14/0x38)
    [    9.313635] [<c0933088>] (arm_smmu_test_init+0x14/0x38) from [<c0200618>] (do_one_initcall+0xb8/0x160)
    [    9.322926] [<c0200618>] (do_one_initcall+0xb8/0x160) from [<c1200b7c>] (kernel_init_freeable+0x108/0x1cc)
    [    9.332564] [<c1200b7c>] (kernel_init_freeable+0x108/0x1cc) from [<c0b924b0>] (kernel_init+0xc/0xe4)
    [    9.341675] [<c0b924b0>] (kernel_init+0xc/0xe4) from [<c0205e38>] (ret_from_fork+0x14/0x3c)

Fix this by moving the request_irq out of the critical section. This
should be okay since smmu_domain->smmu is still being protected by the
critical section. Also, we still don't program the Stream Match Register
until after registering our interrupt handler so we shouldn't be missing
any interrupts.

Cc: <stable@vger.kernel.org>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
[will: code cleanup and fixed request_irq token parameter]
Signed-off-by: Will Deacon <will.deacon@arm.com>
2014-09-01 16:48:55 +01:00
..
amd_iommu_init.c iommu/amd: Add sysfs support 2014-07-04 12:35:59 +02:00
amd_iommu_proto.h
amd_iommu_types.h Merge branches 'x86/vt-d', 'x86/amd', 'arm/omap', 'ppc/pamu', 'arm/smmu', 'arm/exynos' and 'core' into next 2014-07-31 20:29:02 +02:00
amd_iommu_v2.c iommu/amd: Fix 2 typos in comments 2014-07-30 16:07:50 +02:00
amd_iommu.c iommu/amd: Fix cleanup_domain for mass device removal 2014-08-18 13:37:56 +02:00
arm-smmu.c iommu/arm-smmu: avoid calling request_irq in atomic context 2014-09-01 16:48:55 +01:00
dmar.c ACPI and power management updates for 3.17-rc1 2014-08-06 20:34:19 -07:00
exynos-iommu.c iommu: Constify struct iommu_ops 2014-07-07 10:36:59 +02:00
fsl_pamu_domain.c Merge branches 'x86/vt-d', 'x86/amd', 'arm/omap', 'ppc/pamu', 'arm/smmu', 'arm/exynos' and 'core' into next 2014-07-31 20:29:02 +02:00
fsl_pamu_domain.h iommu/fsl: Freescale PAMU driver and iommu implementation. 2013-08-14 11:38:34 +02:00
fsl_pamu.c Merge branches 'x86/vt-d', 'x86/amd', 'arm/omap', 'ppc/pamu', 'arm/smmu', 'arm/exynos' and 'core' into next 2014-07-31 20:29:02 +02:00
fsl_pamu.h iommu/fsl: Freescale PAMU driver and iommu implementation. 2013-08-14 11:38:34 +02:00
intel_irq_remapping.c iommu/vt-d: Fix race setting IRQ CPU affinity while freeing IRQ 2014-07-31 13:45:05 +02:00
intel-iommu.c iommu/vt-d: Defer domain removal if device is assigned to a driver 2014-08-18 13:37:56 +02:00
iommu-sysfs.c iommu: Fix compile error in iommu-sysfs.c 2014-07-07 12:01:21 +02:00
iommu-traces.c iommu: Add iommu_error class event to iommu trace 2013-09-25 11:07:04 +02:00
iommu.c iommu/core: Check for the right function pointer in iommu_map() 2014-08-19 00:19:26 +02:00
iova.c iommu/vt-d: Update IOMMU state when memory hotplug happens 2014-03-04 17:51:06 +01:00
ipmmu-vmsa.c iommu: Constify struct iommu_ops 2014-07-07 10:36:59 +02:00
irq_remapping.c x86: irq_remapping: Use irq_alloc/free_hwirq() 2014-05-16 14:05:18 +02:00
irq_remapping.h
Kconfig Merge branches 'x86/vt-d', 'x86/amd', 'arm/omap', 'ppc/pamu', 'arm/smmu', 'arm/exynos' and 'core' into next 2014-07-31 20:29:02 +02:00
Makefile Merge branches 'x86/vt-d', 'x86/amd', 'arm/omap', 'ppc/pamu', 'arm/smmu', 'arm/exynos' and 'core' into next 2014-07-31 20:29:02 +02:00
msm_iommu_dev.c iommu/msm: Use devm_ioremap_resource to simplify code 2014-05-30 20:20:12 +02:00
msm_iommu_hw-8xxx.h iommu/msm: Move mach includes to iommu directory 2013-08-06 11:18:03 -07:00
msm_iommu.c iommu: Constify struct iommu_ops 2014-07-07 10:36:59 +02:00
msm_iommu.h iommu/msm: Move mach includes to iommu directory 2013-08-06 11:18:03 -07:00
of_iommu.c iommu: add missing include 2014-01-07 15:16:27 +01:00
omap-iommu2.c iommu/omap: Enable bus-error back on supported iommus 2014-03-04 17:02:08 +01:00
omap-iommu-debug.c iommu/omap: Remove virtual memory manager 2014-07-29 12:38:07 +02:00
omap-iommu.c Merge branches 'x86/vt-d', 'x86/amd', 'arm/omap', 'ppc/pamu', 'arm/smmu', 'arm/exynos' and 'core' into next 2014-07-31 20:29:02 +02:00
omap-iommu.h iommu/omap: Remove virtual memory manager 2014-07-29 12:38:07 +02:00
omap-iopgtable.h iommu/omap: Move to_iommu definition from omap-iopgtable.h 2014-04-16 16:30:15 +02:00
shmobile-iommu.c iommu: Constify struct iommu_ops 2014-07-07 10:36:59 +02:00
shmobile-ipmmu.c iommu/shmobile: Use devm_ioremap_resource() 2014-04-17 12:16:12 +02:00
shmobile-ipmmu.h iommu/shmobile: Turn the flush_lock mutex into a spinlock 2014-01-07 15:35:25 +01:00
tegra-gart.c iommu: Constify struct iommu_ops 2014-07-07 10:36:59 +02:00
tegra-smmu.c ARM: SoC cleanups for 3.17 2014-08-08 11:00:26 -07:00