diff options
-rw-r--r-- | arch/alpha/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm64/Kconfig | 1 | ||||
-rw-r--r-- | arch/blackfin/Kconfig | 1 | ||||
-rw-r--r-- | arch/frv/Kconfig | 1 | ||||
-rw-r--r-- | arch/hexagon/Kconfig | 1 | ||||
-rw-r--r-- | arch/mips/Kconfig | 1 | ||||
-rw-r--r-- | arch/parisc/Kconfig | 1 | ||||
-rw-r--r-- | arch/powerpc/Kconfig | 1 | ||||
-rw-r--r-- | arch/s390/Kconfig | 1 | ||||
-rw-r--r-- | arch/sh/Kconfig | 1 | ||||
-rw-r--r-- | arch/sparc/Kconfig | 1 | ||||
-rw-r--r-- | arch/x86/Kconfig | 1 | ||||
-rw-r--r-- | drivers/staging/iio/trigger/Kconfig | 1 | ||||
-rw-r--r-- | init/Kconfig | 4 | ||||
-rw-r--r-- | kernel/irq_work.c | 21 |
16 files changed, 15 insertions, 24 deletions
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig index 9d5904cc7712..9b504af2e966 100644 --- a/arch/alpha/Kconfig +++ b/arch/alpha/Kconfig | |||
@@ -5,7 +5,6 @@ config ALPHA | |||
5 | select HAVE_IDE | 5 | select HAVE_IDE |
6 | select HAVE_OPROFILE | 6 | select HAVE_OPROFILE |
7 | select HAVE_SYSCALL_WRAPPERS | 7 | select HAVE_SYSCALL_WRAPPERS |
8 | select HAVE_IRQ_WORK | ||
9 | select HAVE_PCSPKR_PLATFORM | 8 | select HAVE_PCSPKR_PLATFORM |
10 | select HAVE_PERF_EVENTS | 9 | select HAVE_PERF_EVENTS |
11 | select HAVE_DMA_ATTRS | 10 | select HAVE_DMA_ATTRS |
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 67874b82a4ed..9bbe760f2352 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -36,7 +36,6 @@ config ARM | |||
36 | select HAVE_GENERIC_HARDIRQS | 36 | select HAVE_GENERIC_HARDIRQS |
37 | select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7)) | 37 | select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7)) |
38 | select HAVE_IDE if PCI || ISA || PCMCIA | 38 | select HAVE_IDE if PCI || ISA || PCMCIA |
39 | select HAVE_IRQ_WORK | ||
40 | select HAVE_KERNEL_GZIP | 39 | select HAVE_KERNEL_GZIP |
41 | select HAVE_KERNEL_LZMA | 40 | select HAVE_KERNEL_LZMA |
42 | select HAVE_KERNEL_LZO | 41 | select HAVE_KERNEL_LZO |
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index f8f362aafee9..75e915b72471 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig | |||
@@ -21,7 +21,6 @@ config ARM64 | |||
21 | select HAVE_GENERIC_DMA_COHERENT | 21 | select HAVE_GENERIC_DMA_COHERENT |
22 | select HAVE_GENERIC_HARDIRQS | 22 | select HAVE_GENERIC_HARDIRQS |
23 | select HAVE_HW_BREAKPOINT if PERF_EVENTS | 23 | select HAVE_HW_BREAKPOINT if PERF_EVENTS |
24 | select HAVE_IRQ_WORK | ||
25 | select HAVE_MEMBLOCK | 24 | select HAVE_MEMBLOCK |
26 | select HAVE_PERF_EVENTS | 25 | select HAVE_PERF_EVENTS |
27 | select IRQ_DOMAIN | 26 | select IRQ_DOMAIN |
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig index b6f3ad5441c5..86f891f0ae48 100644 --- a/arch/blackfin/Kconfig +++ b/arch/blackfin/Kconfig | |||
@@ -24,7 +24,6 @@ config BLACKFIN | |||
24 | select HAVE_FUNCTION_TRACER | 24 | select HAVE_FUNCTION_TRACER |
25 | select HAVE_FUNCTION_TRACE_MCOUNT_TEST | 25 | select HAVE_FUNCTION_TRACE_MCOUNT_TEST |
26 | select HAVE_IDE | 26 | select HAVE_IDE |
27 | select HAVE_IRQ_WORK | ||
28 | select HAVE_KERNEL_GZIP if RAMKERNEL | 27 | select HAVE_KERNEL_GZIP if RAMKERNEL |
29 | select HAVE_KERNEL_BZIP2 if RAMKERNEL | 28 | select HAVE_KERNEL_BZIP2 if RAMKERNEL |
30 | select HAVE_KERNEL_LZMA if RAMKERNEL | 29 | select HAVE_KERNEL_LZMA if RAMKERNEL |
diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig index 9d262645f667..17df48fc8f44 100644 --- a/arch/frv/Kconfig +++ b/arch/frv/Kconfig | |||
@@ -3,7 +3,6 @@ config FRV | |||
3 | default y | 3 | default y |
4 | select HAVE_IDE | 4 | select HAVE_IDE |
5 | select HAVE_ARCH_TRACEHOOK | 5 | select HAVE_ARCH_TRACEHOOK |
6 | select HAVE_IRQ_WORK | ||
7 | select HAVE_PERF_EVENTS | 6 | select HAVE_PERF_EVENTS |
8 | select HAVE_UID16 | 7 | select HAVE_UID16 |
9 | select HAVE_GENERIC_HARDIRQS | 8 | select HAVE_GENERIC_HARDIRQS |
diff --git a/arch/hexagon/Kconfig b/arch/hexagon/Kconfig index 0744f7d7b1fd..40a318594ae7 100644 --- a/arch/hexagon/Kconfig +++ b/arch/hexagon/Kconfig | |||
@@ -14,7 +14,6 @@ config HEXAGON | |||
14 | # select HAVE_CLK | 14 | # select HAVE_CLK |
15 | # select IRQ_PER_CPU | 15 | # select IRQ_PER_CPU |
16 | # select GENERIC_PENDING_IRQ if SMP | 16 | # select GENERIC_PENDING_IRQ if SMP |
17 | select HAVE_IRQ_WORK | ||
18 | select GENERIC_ATOMIC64 | 17 | select GENERIC_ATOMIC64 |
19 | select HAVE_PERF_EVENTS | 18 | select HAVE_PERF_EVENTS |
20 | select HAVE_GENERIC_HARDIRQS | 19 | select HAVE_GENERIC_HARDIRQS |
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 2ac626ab9d43..121ed51ac227 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig | |||
@@ -4,7 +4,6 @@ config MIPS | |||
4 | select HAVE_GENERIC_DMA_COHERENT | 4 | select HAVE_GENERIC_DMA_COHERENT |
5 | select HAVE_IDE | 5 | select HAVE_IDE |
6 | select HAVE_OPROFILE | 6 | select HAVE_OPROFILE |
7 | select HAVE_IRQ_WORK | ||
8 | select HAVE_PERF_EVENTS | 7 | select HAVE_PERF_EVENTS |
9 | select PERF_USE_VMALLOC | 8 | select PERF_USE_VMALLOC |
10 | select HAVE_ARCH_KGDB | 9 | select HAVE_ARCH_KGDB |
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig index b77feffbadea..9dd5c1888878 100644 --- a/arch/parisc/Kconfig +++ b/arch/parisc/Kconfig | |||
@@ -9,7 +9,6 @@ config PARISC | |||
9 | select RTC_DRV_GENERIC | 9 | select RTC_DRV_GENERIC |
10 | select INIT_ALL_POSSIBLE | 10 | select INIT_ALL_POSSIBLE |
11 | select BUG | 11 | select BUG |
12 | select HAVE_IRQ_WORK | ||
13 | select HAVE_PERF_EVENTS | 12 | select HAVE_PERF_EVENTS |
14 | select GENERIC_ATOMIC64 if !64BIT | 13 | select GENERIC_ATOMIC64 if !64BIT |
15 | select HAVE_GENERIC_HARDIRQS | 14 | select HAVE_GENERIC_HARDIRQS |
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 17903f1f356b..d45edca88b57 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
@@ -118,7 +118,6 @@ config PPC | |||
118 | select HAVE_SYSCALL_WRAPPERS if PPC64 | 118 | select HAVE_SYSCALL_WRAPPERS if PPC64 |
119 | select GENERIC_ATOMIC64 if PPC32 | 119 | select GENERIC_ATOMIC64 if PPC32 |
120 | select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE | 120 | select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE |
121 | select HAVE_IRQ_WORK | ||
122 | select HAVE_PERF_EVENTS | 121 | select HAVE_PERF_EVENTS |
123 | select HAVE_REGS_AND_STACK_ACCESS_API | 122 | select HAVE_REGS_AND_STACK_ACCESS_API |
124 | select HAVE_HW_BREAKPOINT if PERF_EVENTS && PPC_BOOK3S_64 | 123 | select HAVE_HW_BREAKPOINT if PERF_EVENTS && PPC_BOOK3S_64 |
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index b5ea38c25647..c15ba7d1be64 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig | |||
@@ -78,7 +78,6 @@ config S390 | |||
78 | select HAVE_KVM if 64BIT | 78 | select HAVE_KVM if 64BIT |
79 | select HAVE_ARCH_TRACEHOOK | 79 | select HAVE_ARCH_TRACEHOOK |
80 | select INIT_ALL_POSSIBLE | 80 | select INIT_ALL_POSSIBLE |
81 | select HAVE_IRQ_WORK | ||
82 | select HAVE_PERF_EVENTS | 81 | select HAVE_PERF_EVENTS |
83 | select ARCH_HAVE_NMI_SAFE_CMPXCHG | 82 | select ARCH_HAVE_NMI_SAFE_CMPXCHG |
84 | select HAVE_DEBUG_KMEMLEAK | 83 | select HAVE_DEBUG_KMEMLEAK |
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index babc2b826c5c..996e008aaa3e 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig | |||
@@ -11,7 +11,6 @@ config SUPERH | |||
11 | select HAVE_ARCH_TRACEHOOK | 11 | select HAVE_ARCH_TRACEHOOK |
12 | select HAVE_DMA_API_DEBUG | 12 | select HAVE_DMA_API_DEBUG |
13 | select HAVE_DMA_ATTRS | 13 | select HAVE_DMA_ATTRS |
14 | select HAVE_IRQ_WORK | ||
15 | select HAVE_PERF_EVENTS | 14 | select HAVE_PERF_EVENTS |
16 | select HAVE_DEBUG_BUGVERBOSE | 15 | select HAVE_DEBUG_BUGVERBOSE |
17 | select ARCH_HAVE_CUSTOM_GPIO_H | 16 | select ARCH_HAVE_CUSTOM_GPIO_H |
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index 9f2edb5c5551..ed937ae72df3 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig | |||
@@ -23,7 +23,6 @@ config SPARC | |||
23 | select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE | 23 | select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE |
24 | select RTC_CLASS | 24 | select RTC_CLASS |
25 | select RTC_DRV_M48T59 | 25 | select RTC_DRV_M48T59 |
26 | select HAVE_IRQ_WORK | ||
27 | select HAVE_DMA_ATTRS | 26 | select HAVE_DMA_ATTRS |
28 | select HAVE_DMA_API_DEBUG | 27 | select HAVE_DMA_API_DEBUG |
29 | select HAVE_ARCH_JUMP_LABEL | 28 | select HAVE_ARCH_JUMP_LABEL |
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 79795af59810..5d3d61f40b31 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -28,7 +28,6 @@ config X86 | |||
28 | select HAVE_OPROFILE | 28 | select HAVE_OPROFILE |
29 | select HAVE_PCSPKR_PLATFORM | 29 | select HAVE_PCSPKR_PLATFORM |
30 | select HAVE_PERF_EVENTS | 30 | select HAVE_PERF_EVENTS |
31 | select HAVE_IRQ_WORK | ||
32 | select HAVE_IOREMAP_PROT | 31 | select HAVE_IOREMAP_PROT |
33 | select HAVE_KPROBES | 32 | select HAVE_KPROBES |
34 | select HAVE_MEMBLOCK | 33 | select HAVE_MEMBLOCK |
diff --git a/drivers/staging/iio/trigger/Kconfig b/drivers/staging/iio/trigger/Kconfig index 7d3207559265..d44d3ad26fa5 100644 --- a/drivers/staging/iio/trigger/Kconfig +++ b/drivers/staging/iio/trigger/Kconfig | |||
@@ -21,7 +21,6 @@ config IIO_GPIO_TRIGGER | |||
21 | config IIO_SYSFS_TRIGGER | 21 | config IIO_SYSFS_TRIGGER |
22 | tristate "SYSFS trigger" | 22 | tristate "SYSFS trigger" |
23 | depends on SYSFS | 23 | depends on SYSFS |
24 | depends on HAVE_IRQ_WORK | ||
25 | select IRQ_WORK | 24 | select IRQ_WORK |
26 | help | 25 | help |
27 | Provides support for using SYSFS entry as IIO triggers. | 26 | Provides support for using SYSFS entry as IIO triggers. |
diff --git a/init/Kconfig b/init/Kconfig index be8b7f55312d..e3227d7ba35d 100644 --- a/init/Kconfig +++ b/init/Kconfig | |||
@@ -20,12 +20,8 @@ config CONSTRUCTORS | |||
20 | bool | 20 | bool |
21 | depends on !UML | 21 | depends on !UML |
22 | 22 | ||
23 | config HAVE_IRQ_WORK | ||
24 | bool | ||
25 | |||
26 | config IRQ_WORK | 23 | config IRQ_WORK |
27 | bool | 24 | bool |
28 | depends on HAVE_IRQ_WORK | ||
29 | 25 | ||
30 | config BUILDTIME_EXTABLE_SORT | 26 | config BUILDTIME_EXTABLE_SORT |
31 | bool | 27 | bool |
diff --git a/kernel/irq_work.c b/kernel/irq_work.c index 1588e3b2871b..64eddd59ed83 100644 --- a/kernel/irq_work.c +++ b/kernel/irq_work.c | |||
@@ -34,15 +34,21 @@ static DEFINE_PER_CPU(struct llist_head, irq_work_list); | |||
34 | */ | 34 | */ |
35 | static bool irq_work_claim(struct irq_work *work) | 35 | static bool irq_work_claim(struct irq_work *work) |
36 | { | 36 | { |
37 | unsigned long flags, nflags; | 37 | unsigned long flags, oflags, nflags; |
38 | 38 | ||
39 | /* | ||
40 | * Start with our best wish as a premise but only trust any | ||
41 | * flag value after cmpxchg() result. | ||
42 | */ | ||
43 | flags = work->flags & ~IRQ_WORK_PENDING; | ||
39 | for (;;) { | 44 | for (;;) { |
40 | flags = work->flags; | ||
41 | if (flags & IRQ_WORK_PENDING) | ||
42 | return false; | ||
43 | nflags = flags | IRQ_WORK_FLAGS; | 45 | nflags = flags | IRQ_WORK_FLAGS; |
44 | if (cmpxchg(&work->flags, flags, nflags) == flags) | 46 | oflags = cmpxchg(&work->flags, flags, nflags); |
47 | if (oflags == flags) | ||
45 | break; | 48 | break; |
49 | if (oflags & IRQ_WORK_PENDING) | ||
50 | return false; | ||
51 | flags = oflags; | ||
46 | cpu_relax(); | 52 | cpu_relax(); |
47 | } | 53 | } |
48 | 54 | ||
@@ -119,8 +125,11 @@ void irq_work_run(void) | |||
119 | /* | 125 | /* |
120 | * Clear the PENDING bit, after this point the @work | 126 | * Clear the PENDING bit, after this point the @work |
121 | * can be re-used. | 127 | * can be re-used. |
128 | * Make it immediately visible so that other CPUs trying | ||
129 | * to claim that work don't rely on us to handle their data | ||
130 | * while we are in the middle of the func. | ||
122 | */ | 131 | */ |
123 | work->flags = IRQ_WORK_BUSY; | 132 | xchg(&work->flags, IRQ_WORK_BUSY); |
124 | work->func(work); | 133 | work->func(work); |
125 | /* | 134 | /* |
126 | * Clear the BUSY bit and return to the free state if | 135 | * Clear the BUSY bit and return to the free state if |