Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull irq cleanups from Ingo Molnar:
"This is a multi-arch cleanup series from Thomas Gleixner, which we
kept to near the end of the merge window, to not interfere with
architecture updates.

This series (motivated by the -rt kernel) unifies more aspects of IRQ
handling and generalizes PREEMPT_ACTIVE"

* 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
preempt: Make PREEMPT_ACTIVE generic
sparc: Use preempt_schedule_irq
ia64: Use preempt_schedule_irq
m32r: Use preempt_schedule_irq
hardirq: Make hardirq bits generic
m68k: Simplify low level interrupt handling code
genirq: Prevent spurious detection for unconditionally polled interrupts

+55 -275
-2
arch/alpha/include/asm/thread_info.h
··· 58 58 #define THREAD_SIZE_ORDER 1 59 59 #define THREAD_SIZE (2*PAGE_SIZE) 60 60 61 - #define PREEMPT_ACTIVE 0x40000000 62 - 63 61 /* 64 62 * Thread information flags: 65 63 * - these are process state flags and used from assembly
-2
arch/arc/include/asm/thread_info.h
··· 80 80 81 81 #endif /* !__ASSEMBLY__ */ 82 82 83 - #define PREEMPT_ACTIVE 0x10000000 84 - 85 83 /* 86 84 * thread information flags 87 85 * - these are process state flags that various assembly files may need to
-6
arch/arm/include/asm/thread_info.h
··· 141 141 #endif 142 142 143 143 /* 144 - * We use bit 30 of the preempt_count to indicate that kernel 145 - * preemption is occurring. See <asm/hardirq.h>. 146 - */ 147 - #define PREEMPT_ACTIVE 0x40000000 148 - 149 - /* 150 144 * thread information flags: 151 145 * TIF_SYSCALL_TRACE - syscall trace active 152 146 * TIF_SYSCAL_AUDIT - syscall auditing active
-6
arch/arm64/include/asm/thread_info.h
··· 89 89 #endif 90 90 91 91 /* 92 - * We use bit 30 of the preempt_count to indicate that kernel 93 - * preemption is occurring. See <asm/hardirq.h>. 94 - */ 95 - #define PREEMPT_ACTIVE 0x40000000 96 - 97 - /* 98 92 * thread information flags: 99 93 * TIF_SYSCALL_TRACE - syscall trace active 100 94 * TIF_SIGPENDING - signal pending
-2
arch/avr32/include/asm/thread_info.h
··· 66 66 67 67 #endif /* !__ASSEMBLY__ */ 68 68 69 - #define PREEMPT_ACTIVE 0x40000000 70 - 71 69 /* 72 70 * Thread information flags 73 71 * - these are process state flags that various assembly files may need to access
-3
arch/blackfin/include/asm/hardirq.h
··· 12 12 extern void ack_bad_irq(unsigned int irq); 13 13 #define ack_bad_irq ack_bad_irq 14 14 15 - /* Define until common code gets sane defaults */ 16 - #define HARDIRQ_BITS 9 17 - 18 15 #include <asm-generic/hardirq.h> 19 16 20 17 #endif
-2
arch/blackfin/include/asm/thread_info.h
··· 88 88 #define TI_CPU 12 89 89 #define TI_PREEMPT 16 90 90 91 - #define PREEMPT_ACTIVE 0x4000000 92 - 93 91 /* 94 92 * thread information flag bit numbers 95 93 */
-2
arch/c6x/include/asm/thread_info.h
··· 84 84 #define put_thread_info(ti) put_task_struct((ti)->task) 85 85 #endif /* __ASSEMBLY__ */ 86 86 87 - #define PREEMPT_ACTIVE 0x10000000 88 - 89 87 /* 90 88 * thread information flag bit numbers 91 89 * - pending work-to-be-done flags are in LSW
-12
arch/cris/include/asm/hardirq.h
··· 2 2 #define __ASM_HARDIRQ_H 3 3 4 4 #include <asm/irq.h> 5 - 6 - #define HARDIRQ_BITS 8 7 - 8 - /* 9 - * The hardirq mask has to be large enough to have 10 - * space for potentially all IRQ sources in the system 11 - * nesting on a single CPU: 12 - */ 13 - #if (1 << HARDIRQ_BITS) < NR_IRQS 14 - # error HARDIRQ_BITS is too low! 15 - #endif 16 - 17 5 #include <asm-generic/hardirq.h> 18 6 19 7 #endif /* __ASM_HARDIRQ_H */
-2
arch/cris/include/asm/thread_info.h
··· 44 44 45 45 #endif 46 46 47 - #define PREEMPT_ACTIVE 0x10000000 48 - 49 47 /* 50 48 * macros/functions for gaining access to the thread information structure 51 49 */
-2
arch/frv/include/asm/thread_info.h
··· 52 52 53 53 #endif 54 54 55 - #define PREEMPT_ACTIVE 0x10000000 56 - 57 55 /* 58 56 * macros/functions for gaining access to the thread information structure 59 57 */
-4
arch/hexagon/include/asm/thread_info.h
··· 73 73 74 74 #endif /* __ASSEMBLY__ */ 75 75 76 - /* looks like "linux/hardirq.h" uses this. */ 77 - 78 - #define PREEMPT_ACTIVE 0x10000000 79 - 80 76 #ifndef __ASSEMBLY__ 81 77 82 78 #define INIT_THREAD_INFO(tsk) \
-3
arch/ia64/include/asm/thread_info.h
··· 11 11 #include <asm/processor.h> 12 12 #include <asm/ptrace.h> 13 13 14 - #define PREEMPT_ACTIVE_BIT 30 15 - #define PREEMPT_ACTIVE (1 << PREEMPT_ACTIVE_BIT) 16 - 17 14 #ifndef __ASSEMBLY__ 18 15 19 16 /*
+1 -14
arch/ia64/kernel/entry.S
··· 1169 1169 .work_pending: 1170 1170 tbit.z p6,p0=r31,TIF_NEED_RESCHED // is resched not needed? 1171 1171 (p6) br.cond.sptk.few .notify 1172 - #ifdef CONFIG_PREEMPT 1173 - (pKStk) dep r21=-1,r0,PREEMPT_ACTIVE_BIT,1 1174 - ;; 1175 - (pKStk) st4 [r20]=r21 1176 - #endif 1177 - SSM_PSR_I(p0, p6, r2) // enable interrupts 1178 - br.call.spnt.many rp=schedule 1172 + br.call.spnt.many rp=preempt_schedule_irq 1179 1173 .ret9: cmp.eq p6,p0=r0,r0 // p6 <- 1 (re-check) 1180 - RSM_PSR_I(p0, r2, r20) // disable interrupts 1181 - ;; 1182 - #ifdef CONFIG_PREEMPT 1183 - (pKStk) adds r20=TI_PRE_COUNT+IA64_TASK_SIZE,r13 1184 - ;; 1185 - (pKStk) st4 [r20]=r0 // preempt_count() <- 0 1186 - #endif 1187 1174 (pLvSys)br.cond.sptk.few __paravirt_pending_syscall_end 1188 1175 br.cond.sptk.many .work_processed_kernel 1189 1176
-16
arch/m32r/include/asm/hardirq.h
··· 3 3 #define __ASM_HARDIRQ_H 4 4 5 5 #include <asm/irq.h> 6 - 7 - #if NR_IRQS > 256 8 - #define HARDIRQ_BITS 9 9 - #else 10 - #define HARDIRQ_BITS 8 11 - #endif 12 - 13 - /* 14 - * The hardirq mask has to be large enough to have 15 - * space for potentially all IRQ sources in the system 16 - * nesting on a single CPU: 17 - */ 18 - #if (1 << HARDIRQ_BITS) < NR_IRQS 19 - # error HARDIRQ_BITS is too low! 20 - #endif 21 - 22 6 #include <asm-generic/hardirq.h> 23 7 24 8 #endif /* __ASM_HARDIRQ_H */
-2
arch/m32r/include/asm/thread_info.h
··· 53 53 54 54 #endif 55 55 56 - #define PREEMPT_ACTIVE 0x10000000 57 - 58 56 #define THREAD_SIZE (PAGE_SIZE << 1) 59 57 #define THREAD_SIZE_ORDER 1 60 58 /*
+1 -7
arch/m32r/kernel/entry.S
··· 182 182 ld r4, PSW(sp) ; interrupts off (exception path) ? 183 183 and3 r4, r4, #0x4000 184 184 beqz r4, restore_all 185 - LDIMM (r4, PREEMPT_ACTIVE) 186 - st r4, @(TI_PRE_COUNT, r8) 187 - ENABLE_INTERRUPTS(r4) 188 - bl schedule 189 - ldi r4, #0 190 - st r4, @(TI_PRE_COUNT, r8) 191 - DISABLE_INTERRUPTS(r4) 185 + bl preempt_schedule_irq 192 186 bra need_resched 193 187 #endif 194 188
-11
arch/m68k/include/asm/hardirq.h
··· 5 5 #include <linux/cache.h> 6 6 #include <asm/irq.h> 7 7 8 - #define HARDIRQ_BITS 8 9 - 10 - /* 11 - * The hardirq mask has to be large enough to have 12 - * space for potentially all IRQ sources in the system 13 - * nesting on a single CPU: 14 - */ 15 - #if (1 << HARDIRQ_BITS) < NR_IRQS 16 - # error HARDIRQ_BITS is too low! 17 - #endif 18 - 19 8 #ifdef CONFIG_MMU 20 9 21 10 static inline void ack_bad_irq(unsigned int irq)
-2
arch/m68k/include/asm/thread_info.h
··· 35 35 }; 36 36 #endif /* __ASSEMBLY__ */ 37 37 38 - #define PREEMPT_ACTIVE 0x4000000 39 - 40 38 #define INIT_THREAD_INFO(tsk) \ 41 39 { \ 42 40 .task = &tsk, \
+4 -36
arch/m68k/kernel/entry.S
··· 45 45 .globl system_call, buserr, trap, resume 46 46 .globl sys_call_table 47 47 .globl __sys_fork, __sys_clone, __sys_vfork 48 - .globl ret_from_interrupt, bad_interrupt 48 + .globl bad_interrupt 49 49 .globl auto_irqhandler_fixup 50 50 .globl user_irqvec_fixup 51 51 ··· 275 275 ENTRY(auto_inthandler) 276 276 SAVE_ALL_INT 277 277 GET_CURRENT(%d0) 278 - movel %d0,%a1 279 - addqb #1,%a1@(TINFO_PREEMPT+1) 280 278 | put exception # in d0 281 279 bfextu %sp@(PT_OFF_FORMATVEC){#4,#10},%d0 282 280 subw #VEC_SPUR,%d0 ··· 284 286 auto_irqhandler_fixup = . + 2 285 287 jsr do_IRQ | process the IRQ 286 288 addql #8,%sp | pop parameters off stack 287 - 288 - ret_from_interrupt: 289 - movel %curptr@(TASK_STACK),%a1 290 - subqb #1,%a1@(TINFO_PREEMPT+1) 291 - jeq ret_from_last_interrupt 292 - 2: RESTORE_ALL 293 - 294 - ALIGN 295 - ret_from_last_interrupt: 296 - moveq #(~ALLOWINT>>8)&0xff,%d0 297 - andb %sp@(PT_OFF_SR),%d0 298 - jne 2b 299 - 300 - /* check if we need to do software interrupts */ 301 - tstl irq_stat+CPUSTAT_SOFTIRQ_PENDING 302 - jeq .Lret_from_exception 303 - pea ret_from_exception 304 - jra do_softirq 289 + jra ret_from_exception 305 290 306 291 /* Handler for user defined interrupt vectors */ 307 292 308 293 ENTRY(user_inthandler) 309 294 SAVE_ALL_INT 310 295 GET_CURRENT(%d0) 311 - movel %d0,%a1 312 - addqb #1,%a1@(TINFO_PREEMPT+1) 313 296 | put exception # in d0 314 297 bfextu %sp@(PT_OFF_FORMATVEC){#4,#10},%d0 315 298 user_irqvec_fixup = . + 2 ··· 300 321 movel %d0,%sp@- | put vector # on stack 301 322 jsr do_IRQ | process the IRQ 302 323 addql #8,%sp | pop parameters off stack 303 - 304 - movel %curptr@(TASK_STACK),%a1 305 - subqb #1,%a1@(TINFO_PREEMPT+1) 306 - jeq ret_from_last_interrupt 307 - RESTORE_ALL 324 + jra ret_from_exception 308 325 309 326 /* Handler for uninitialized and spurious interrupts */ 310 327 311 328 ENTRY(bad_inthandler) 312 329 SAVE_ALL_INT 313 330 GET_CURRENT(%d0) 314 - movel %d0,%a1 315 - addqb #1,%a1@(TINFO_PREEMPT+1) 316 331 317 332 movel %sp,%sp@- 318 333 jsr handle_badint 319 334 addql #4,%sp 320 - 321 - movel %curptr@(TASK_STACK),%a1 322 - subqb #1,%a1@(TINFO_PREEMPT+1) 323 - jeq ret_from_last_interrupt 324 - RESTORE_ALL 325 - 335 + jra ret_from_exception 326 336 327 337 resume: 328 338 /*
-6
arch/m68k/kernel/ints.c
··· 58 58 { 59 59 int i; 60 60 61 - /* assembly irq entry code relies on this... */ 62 - if (HARDIRQ_MASK != 0x00ff0000) { 63 - extern void hardirq_mask_is_broken(void); 64 - hardirq_mask_is_broken(); 65 - } 66 - 67 61 for (i = IRQ_AUTO_1; i <= IRQ_AUTO_7; i++) 68 62 irq_set_chip_and_handler(i, &auto_irq_chip, handle_simple_irq); 69 63
+8 -25
arch/m68k/platform/68000/entry.S
··· 27 27 .globl ret_from_exception 28 28 .globl ret_from_signal 29 29 .globl sys_call_table 30 - .globl ret_from_interrupt 31 30 .globl bad_interrupt 32 31 .globl inthandler1 33 32 .globl inthandler2 ··· 136 137 movel #65,%sp@- /* put vector # on stack*/ 137 138 jbsr process_int /* process the IRQ*/ 138 139 3: addql #8,%sp /* pop parameters off stack*/ 139 - bra ret_from_interrupt 140 + bra ret_from_exception 140 141 141 142 inthandler2: 142 143 SAVE_ALL_INT ··· 147 148 movel #66,%sp@- /* put vector # on stack*/ 148 149 jbsr process_int /* process the IRQ*/ 149 150 3: addql #8,%sp /* pop parameters off stack*/ 150 - bra ret_from_interrupt 151 + bra ret_from_exception 151 152 152 153 inthandler3: 153 154 SAVE_ALL_INT ··· 158 159 movel #67,%sp@- /* put vector # on stack*/ 159 160 jbsr process_int /* process the IRQ*/ 160 161 3: addql #8,%sp /* pop parameters off stack*/ 161 - bra ret_from_interrupt 162 + bra ret_from_exception 162 163 163 164 inthandler4: 164 165 SAVE_ALL_INT ··· 169 170 movel #68,%sp@- /* put vector # on stack*/ 170 171 jbsr process_int /* process the IRQ*/ 171 172 3: addql #8,%sp /* pop parameters off stack*/ 172 - bra ret_from_interrupt 173 + bra ret_from_exception 173 174 174 175 inthandler5: 175 176 SAVE_ALL_INT ··· 180 181 movel #69,%sp@- /* put vector # on stack*/ 181 182 jbsr process_int /* process the IRQ*/ 182 183 3: addql #8,%sp /* pop parameters off stack*/ 183 - bra ret_from_interrupt 184 + bra ret_from_exception 184 185 185 186 inthandler6: 186 187 SAVE_ALL_INT ··· 191 192 movel #70,%sp@- /* put vector # on stack*/ 192 193 jbsr process_int /* process the IRQ*/ 193 194 3: addql #8,%sp /* pop parameters off stack*/ 194 - bra ret_from_interrupt 195 + bra ret_from_exception 195 196 196 197 inthandler7: 197 198 SAVE_ALL_INT ··· 202 203 movel #71,%sp@- /* put vector # on stack*/ 203 204 jbsr process_int /* process the IRQ*/ 204 205 3: addql #8,%sp /* pop parameters off stack*/ 205 - bra ret_from_interrupt 206 + bra ret_from_exception 206 207 207 208 inthandler: 208 209 SAVE_ALL_INT ··· 213 214 movel %d0,%sp@- /* put vector # on stack*/ 214 215 jbsr process_int /* process the IRQ*/ 215 216 3: addql #8,%sp /* pop parameters off stack*/ 216 - bra ret_from_interrupt 217 - 218 - ret_from_interrupt: 219 - jeq 1f 220 - 2: 221 - RESTORE_ALL 222 - 1: 223 - moveb %sp@(PT_OFF_SR), %d0 224 - and #7, %d0 225 - jhi 2b 226 - 227 - /* check if we need to do software interrupts */ 228 - jeq ret_from_exception 229 - 230 - pea ret_from_exception 231 - jra do_softirq 232 - 217 + bra ret_from_exception 233 218 234 219 /* 235 220 * Handler for uninitialized and spurious interrupts.
+3 -21
arch/m68k/platform/68360/entry.S
··· 29 29 .globl ret_from_exception 30 30 .globl ret_from_signal 31 31 .globl sys_call_table 32 - .globl ret_from_interrupt 33 32 .globl bad_interrupt 34 33 .globl inthandler 35 34 ··· 131 132 132 133 movel %sp,%sp@- 133 134 movel %d0,%sp@- /* put vector # on stack*/ 134 - jbsr do_IRQ /* process the IRQ*/ 135 - 3: addql #8,%sp /* pop parameters off stack*/ 136 - bra ret_from_interrupt 137 - 138 - ret_from_interrupt: 139 - jeq 1f 140 - 2: 141 - RESTORE_ALL 142 - 1: 143 - moveb %sp@(PT_OFF_SR), %d0 144 - and #7, %d0 145 - jhi 2b 146 - /* check if we need to do software interrupts */ 147 - 148 - movel irq_stat+CPUSTAT_SOFTIRQ_PENDING,%d0 149 - jeq ret_from_exception 150 - 151 - pea ret_from_exception 152 - jra do_softirq 153 - 135 + jbsr do_IRQ /* process the IRQ */ 136 + addql #8,%sp /* pop parameters off stack*/ 137 + jra ret_from_exception 154 138 155 139 /* 156 140 * Handler for uninitialized and spurious interrupts.
-2
arch/metag/include/asm/thread_info.h
··· 46 46 47 47 #endif 48 48 49 - #define PREEMPT_ACTIVE 0x10000000 50 - 51 49 #ifdef CONFIG_4KSTACKS 52 50 #define THREAD_SHIFT 12 53 51 #else
-2
arch/microblaze/include/asm/thread_info.h
··· 106 106 /* thread information allocation */ 107 107 #endif /* __ASSEMBLY__ */ 108 108 109 - #define PREEMPT_ACTIVE 0x10000000 110 - 111 109 /* 112 110 * thread information flags 113 111 * - these are process state flags that various assembly files may
-2
arch/mips/include/asm/thread_info.h
··· 92 92 93 93 #define STACK_WARN (THREAD_SIZE / 8) 94 94 95 - #define PREEMPT_ACTIVE 0x10000000 96 - 97 95 /* 98 96 * thread information flags 99 97 * - these are process state flags that various assembly files may need to
-2
arch/mn10300/include/asm/thread_info.h
··· 16 16 17 17 #include <asm/page.h> 18 18 19 - #define PREEMPT_ACTIVE 0x10000000 20 - 21 19 #ifdef CONFIG_4KSTACKS 22 20 #define THREAD_SIZE (4096) 23 21 #define THREAD_SIZE_ORDER (0)
-3
arch/parisc/include/asm/thread_info.h
··· 46 46 #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER) 47 47 #define THREAD_SHIFT (PAGE_SHIFT + THREAD_SIZE_ORDER) 48 48 49 - #define PREEMPT_ACTIVE_BIT 28 50 - #define PREEMPT_ACTIVE (1 << PREEMPT_ACTIVE_BIT) 51 - 52 49 /* 53 50 * thread information flags 54 51 */
-2
arch/powerpc/include/asm/thread_info.h
··· 82 82 83 83 #endif /* __ASSEMBLY__ */ 84 84 85 - #define PREEMPT_ACTIVE 0x10000000 86 - 87 85 /* 88 86 * thread information flag bit numbers 89 87 */
-2
arch/s390/include/asm/hardirq.h
··· 18 18 #define __ARCH_HAS_DO_SOFTIRQ 19 19 #define __ARCH_IRQ_EXIT_IRQS_DISABLED 20 20 21 - #define HARDIRQ_BITS 8 22 - 23 21 static inline void ack_bad_irq(unsigned int irq) 24 22 { 25 23 printk(KERN_CRIT "unexpected IRQ trap at vector %02x\n", irq);
-2
arch/s390/include/asm/thread_info.h
··· 111 111 #define is_32bit_task() (1) 112 112 #endif 113 113 114 - #define PREEMPT_ACTIVE 0x4000000 115 - 116 114 #endif /* _ASM_THREAD_INFO_H */
-2
arch/score/include/asm/thread_info.h
··· 72 72 73 73 #endif /* !__ASSEMBLY__ */ 74 74 75 - #define PREEMPT_ACTIVE 0x10000000 76 - 77 75 /* 78 76 * thread information flags 79 77 * - these are process state flags that various assembly files may need to
-2
arch/sh/include/asm/thread_info.h
··· 41 41 42 42 #endif 43 43 44 - #define PREEMPT_ACTIVE 0x10000000 45 - 46 44 #if defined(CONFIG_4KSTACKS) 47 45 #define THREAD_SHIFT 12 48 46 #else
+2 -4
arch/sh/kernel/entry-common.S
··· 108 108 and #(0xf0>>1), r0 ! interrupts off (exception path)? 109 109 cmp/eq #(0xf0>>1), r0 110 110 bt noresched 111 - mov.l 3f, r0 111 + mov.l 1f, r0 112 112 jsr @r0 ! call preempt_schedule_irq 113 113 nop 114 114 bra need_resched ··· 119 119 nop 120 120 121 121 .align 2 122 - 1: .long PREEMPT_ACTIVE 123 - 2: .long schedule 124 - 3: .long preempt_schedule_irq 122 + 1: .long preempt_schedule_irq 125 123 #endif 126 124 127 125 ENTRY(resume_userspace)
-1
arch/sparc/include/asm/hardirq_32.h
··· 7 7 #ifndef __SPARC_HARDIRQ_H 8 8 #define __SPARC_HARDIRQ_H 9 9 10 - #define HARDIRQ_BITS 8 11 10 #include <asm-generic/hardirq.h> 12 11 13 12 #endif /* __SPARC_HARDIRQ_H */
-2
arch/sparc/include/asm/hardirq_64.h
··· 14 14 15 15 void ack_bad_irq(unsigned int irq); 16 16 17 - #define HARDIRQ_BITS 8 18 - 19 17 #endif /* !(__SPARC64_HARDIRQ_H) */
-2
arch/sparc/include/asm/thread_info_32.h
··· 105 105 #define TI_W_SAVED 0x250 106 106 /* #define TI_RESTART_BLOCK 0x25n */ /* Nobody cares */ 107 107 108 - #define PREEMPT_ACTIVE 0x4000000 109 - 110 108 /* 111 109 * thread information flag bit numbers 112 110 */
-2
arch/sparc/include/asm/thread_info_64.h
··· 111 111 #define THREAD_SHIFT PAGE_SHIFT 112 112 #endif /* PAGE_SHIFT == 13 */ 113 113 114 - #define PREEMPT_ACTIVE 0x10000000 115 - 116 114 /* 117 115 * macros/functions for gaining access to the thread information structure 118 116 */
+2 -4
arch/sparc/kernel/rtrap_64.S
··· 312 312 nop 313 313 cmp %l4, 0 314 314 bne,pn %xcc, kern_fpucheck 315 - sethi %hi(PREEMPT_ACTIVE), %l6 316 - stw %l6, [%g6 + TI_PRE_COUNT] 317 - call schedule 315 + nop 316 + call preempt_schedule_irq 318 317 nop 319 318 ba,pt %xcc, rtrap 320 - stw %g0, [%g6 + TI_PRE_COUNT] 321 319 #endif 322 320 kern_fpucheck: ldub [%g6 + TI_FPDEPTH], %l5 323 321 brz,pt %l5, rt_continue
-2
arch/tile/include/asm/hardirq.h
··· 42 42 43 43 #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */ 44 44 45 - #define HARDIRQ_BITS 8 46 - 47 45 #endif /* _ASM_TILE_HARDIRQ_H */
-2
arch/tile/include/asm/thread_info.h
··· 113 113 114 114 #endif /* !__ASSEMBLY__ */ 115 115 116 - #define PREEMPT_ACTIVE 0x10000000 117 - 118 116 /* 119 117 * Thread information flags that various assembly files may need to access. 120 118 * Keep flags accessed frequently in low bits, particular since it makes
-2
arch/um/include/asm/thread_info.h
··· 60 60 61 61 #endif 62 62 63 - #define PREEMPT_ACTIVE 0x10000000 64 - 65 63 #define TIF_SYSCALL_TRACE 0 /* syscall trace active */ 66 64 #define TIF_SIGPENDING 1 /* signal pending */ 67 65 #define TIF_NEED_RESCHED 2 /* rescheduling necessary */
-6
arch/unicore32/include/asm/thread_info.h
··· 118 118 #endif 119 119 120 120 /* 121 - * We use bit 30 of the preempt_count to indicate that kernel 122 - * preemption is occurring. See <asm/hardirq.h>. 123 - */ 124 - #define PREEMPT_ACTIVE 0x40000000 125 - 126 - /* 127 121 * thread information flags: 128 122 * TIF_SYSCALL_TRACE - syscall trace active 129 123 * TIF_SIGPENDING - signal pending
-2
arch/x86/include/asm/thread_info.h
··· 153 153 #define _TIF_WORK_CTXSW_PREV (_TIF_WORK_CTXSW|_TIF_USER_RETURN_NOTIFY) 154 154 #define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW) 155 155 156 - #define PREEMPT_ACTIVE 0x10000000 157 - 158 156 #ifdef CONFIG_X86_32 159 157 160 158 #define STACK_WARN (THREAD_SIZE/8)
-2
arch/xtensa/include/asm/thread_info.h
··· 76 76 77 77 #endif 78 78 79 - #define PREEMPT_ACTIVE 0x10000000 80 - 81 79 /* 82 80 * macros/functions for gaining access to the thread information structure 83 81 */
+6 -1
include/linux/irq.h
··· 70 70 * IRQ_MOVE_PCNTXT - Interrupt can be migrated from process context 71 71 * IRQ_NESTED_TRHEAD - Interrupt nests into another thread 72 72 * IRQ_PER_CPU_DEVID - Dev_id is a per-cpu variable 73 + * IRQ_IS_POLLED - Always polled by another interrupt. Exclude 74 + * it from the spurious interrupt detection 75 + * mechanism and from core side polling. 73 76 */ 74 77 enum { 75 78 IRQ_TYPE_NONE = 0x00000000, ··· 97 94 IRQ_NESTED_THREAD = (1 << 15), 98 95 IRQ_NOTHREAD = (1 << 16), 99 96 IRQ_PER_CPU_DEVID = (1 << 17), 97 + IRQ_IS_POLLED = (1 << 18), 100 98 }; 101 99 102 100 #define IRQF_MODIFY_MASK \ 103 101 (IRQ_TYPE_SENSE_MASK | IRQ_NOPROBE | IRQ_NOREQUEST | \ 104 102 IRQ_NOAUTOEN | IRQ_MOVE_PCNTXT | IRQ_LEVEL | IRQ_NO_BALANCING | \ 105 - IRQ_PER_CPU | IRQ_NESTED_THREAD | IRQ_NOTHREAD | IRQ_PER_CPU_DEVID) 103 + IRQ_PER_CPU | IRQ_NESTED_THREAD | IRQ_NOTHREAD | IRQ_PER_CPU_DEVID | \ 104 + IRQ_IS_POLLED) 106 105 107 106 #define IRQ_NO_BALANCING_MASK (IRQ_PER_CPU | IRQ_NO_BALANCING) 108 107
+11 -30
include/linux/preempt_mask.h
··· 11 11 * - bits 0-7 are the preemption count (max preemption depth: 256) 12 12 * - bits 8-15 are the softirq count (max # of softirqs: 256) 13 13 * 14 - * The hardirq count can in theory reach the same as NR_IRQS. 15 - * In reality, the number of nested IRQS is limited to the stack 16 - * size as well. For archs with over 1000 IRQS it is not practical 17 - * to expect that they will all nest. We give a max of 10 bits for 18 - * hardirq nesting. An arch may choose to give less than 10 bits. 19 - * m68k expects it to be 8. 14 + * The hardirq count could in theory be the same as the number of 15 + * interrupts in the system, but we run all interrupt handlers with 16 + * interrupts disabled, so we cannot have nesting interrupts. Though 17 + * there are a few palaeontologic drivers which reenable interrupts in 18 + * the handler, so we need more than one bit here. 20 19 * 21 - * - bits 16-25 are the hardirq count (max # of nested hardirqs: 1024) 22 - * - bit 26 is the NMI_MASK 23 - * - bit 27 is the PREEMPT_ACTIVE flag 24 - * 25 - * PREEMPT_MASK: 0x000000ff 26 - * SOFTIRQ_MASK: 0x0000ff00 27 - * HARDIRQ_MASK: 0x03ff0000 28 - * NMI_MASK: 0x04000000 20 + * PREEMPT_MASK: 0x000000ff 21 + * SOFTIRQ_MASK: 0x0000ff00 22 + * HARDIRQ_MASK: 0x000f0000 23 + * NMI_MASK: 0x00100000 24 + * PREEMPT_ACTIVE: 0x00200000 29 25 */ 30 26 #define PREEMPT_BITS 8 31 27 #define SOFTIRQ_BITS 8 28 + #define HARDIRQ_BITS 4 32 29 #define NMI_BITS 1 33 - 34 - #define MAX_HARDIRQ_BITS 10 35 - 36 - #ifndef HARDIRQ_BITS 37 - # define HARDIRQ_BITS MAX_HARDIRQ_BITS 38 - #endif 39 - 40 - #if HARDIRQ_BITS > MAX_HARDIRQ_BITS 41 - #error HARDIRQ_BITS too high! 42 - #endif 43 30 44 31 #define PREEMPT_SHIFT 0 45 32 #define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS) ··· 47 60 48 61 #define SOFTIRQ_DISABLE_OFFSET (2 * SOFTIRQ_OFFSET) 49 62 50 - #ifndef PREEMPT_ACTIVE 51 63 #define PREEMPT_ACTIVE_BITS 1 52 64 #define PREEMPT_ACTIVE_SHIFT (NMI_SHIFT + NMI_BITS) 53 65 #define PREEMPT_ACTIVE (__IRQ_MASK(PREEMPT_ACTIVE_BITS) << PREEMPT_ACTIVE_SHIFT) 54 - #endif 55 - 56 - #if PREEMPT_ACTIVE < (1 << (NMI_SHIFT + NMI_BITS)) 57 - #error PREEMPT_ACTIVE is too low! 58 - #endif 59 66 60 67 #define hardirq_count() (preempt_count() & HARDIRQ_MASK) 61 68 #define softirq_count() (preempt_count() & SOFTIRQ_MASK)
+1 -1
include/linux/sched.h
··· 22 22 #include <linux/errno.h> 23 23 #include <linux/nodemask.h> 24 24 #include <linux/mm_types.h> 25 - #include <linux/preempt.h> 25 + #include <linux/preempt_mask.h> 26 26 27 27 #include <asm/page.h> 28 28 #include <asm/ptrace.h>
+7
kernel/irq/settings.h
··· 14 14 _IRQ_NO_BALANCING = IRQ_NO_BALANCING, 15 15 _IRQ_NESTED_THREAD = IRQ_NESTED_THREAD, 16 16 _IRQ_PER_CPU_DEVID = IRQ_PER_CPU_DEVID, 17 + _IRQ_IS_POLLED = IRQ_IS_POLLED, 17 18 _IRQF_MODIFY_MASK = IRQF_MODIFY_MASK, 18 19 }; 19 20 ··· 27 26 #define IRQ_NOAUTOEN GOT_YOU_MORON 28 27 #define IRQ_NESTED_THREAD GOT_YOU_MORON 29 28 #define IRQ_PER_CPU_DEVID GOT_YOU_MORON 29 + #define IRQ_IS_POLLED GOT_YOU_MORON 30 30 #undef IRQF_MODIFY_MASK 31 31 #define IRQF_MODIFY_MASK GOT_YOU_MORON 32 32 ··· 148 146 static inline bool irq_settings_is_nested_thread(struct irq_desc *desc) 149 147 { 150 148 return desc->status_use_accessors & _IRQ_NESTED_THREAD; 149 + } 150 + 151 + static inline bool irq_settings_is_polled(struct irq_desc *desc) 152 + { 153 + return desc->status_use_accessors & _IRQ_IS_POLLED; 151 154 }
+9 -3
kernel/irq/spurious.c
··· 67 67 68 68 raw_spin_lock(&desc->lock); 69 69 70 - /* PER_CPU and nested thread interrupts are never polled */ 71 - if (irq_settings_is_per_cpu(desc) || irq_settings_is_nested_thread(desc)) 70 + /* 71 + * PER_CPU, nested thread interrupts and interrupts explicitely 72 + * marked polled are excluded from polling. 73 + */ 74 + if (irq_settings_is_per_cpu(desc) || 75 + irq_settings_is_nested_thread(desc) || 76 + irq_settings_is_polled(desc)) 72 77 goto out; 73 78 74 79 /* ··· 273 268 void note_interrupt(unsigned int irq, struct irq_desc *desc, 274 269 irqreturn_t action_ret) 275 270 { 276 - if (desc->istate & IRQS_POLL_INPROGRESS) 271 + if (desc->istate & IRQS_POLL_INPROGRESS || 272 + irq_settings_is_polled(desc)) 277 273 return; 278 274 279 275 /* we get here again via the threaded handler */