Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 19 Nov 2013 18:40:00 +0000 (10:40 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 19 Nov 2013 18:40:00 +0000 (10:40 -0800)
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

50 files changed:
arch/alpha/include/asm/thread_info.h
arch/arc/include/asm/thread_info.h
arch/arm/include/asm/thread_info.h
arch/arm64/include/asm/thread_info.h
arch/avr32/include/asm/thread_info.h
arch/blackfin/include/asm/hardirq.h
arch/blackfin/include/asm/thread_info.h
arch/c6x/include/asm/thread_info.h
arch/cris/include/asm/hardirq.h
arch/cris/include/asm/thread_info.h
arch/frv/include/asm/thread_info.h
arch/hexagon/include/asm/thread_info.h
arch/ia64/include/asm/thread_info.h
arch/ia64/kernel/entry.S
arch/m32r/include/asm/hardirq.h
arch/m32r/include/asm/thread_info.h
arch/m32r/kernel/entry.S
arch/m68k/include/asm/hardirq.h
arch/m68k/include/asm/thread_info.h
arch/m68k/kernel/entry.S
arch/m68k/kernel/ints.c
arch/m68k/platform/68000/entry.S
arch/m68k/platform/68360/entry.S
arch/metag/include/asm/thread_info.h
arch/microblaze/include/asm/thread_info.h
arch/mips/include/asm/thread_info.h
arch/mn10300/include/asm/thread_info.h
arch/parisc/include/asm/thread_info.h
arch/powerpc/include/asm/thread_info.h
arch/s390/include/asm/hardirq.h
arch/s390/include/asm/thread_info.h
arch/score/include/asm/thread_info.h
arch/sh/include/asm/thread_info.h
arch/sh/kernel/entry-common.S
arch/sparc/include/asm/hardirq_32.h
arch/sparc/include/asm/hardirq_64.h
arch/sparc/include/asm/thread_info_32.h
arch/sparc/include/asm/thread_info_64.h
arch/sparc/kernel/rtrap_64.S
arch/tile/include/asm/hardirq.h
arch/tile/include/asm/thread_info.h
arch/um/include/asm/thread_info.h
arch/unicore32/include/asm/thread_info.h
arch/x86/include/asm/thread_info.h
arch/xtensa/include/asm/thread_info.h
include/linux/irq.h
include/linux/preempt_mask.h
include/linux/sched.h
kernel/irq/settings.h
kernel/irq/spurious.c

index 52cd2a4a3ff486c8e7acefb35c6e6d24a911f025..453597b91f3a6560320524e4ef7a4338a5ae8e10 100644 (file)
@@ -58,8 +58,6 @@ register struct thread_info *__current_thread_info __asm__("$8");
 #define THREAD_SIZE_ORDER 1
 #define THREAD_SIZE (2*PAGE_SIZE)
 
-#define PREEMPT_ACTIVE         0x40000000
-
 /*
  * Thread information flags:
  * - these are process state flags and used from assembly
index 2d50a4cdd7f3dacb8828aaa5c40133a2fc6c7681..45be2167201183172695d0a788c0b20b87ec7ce2 100644 (file)
@@ -80,8 +80,6 @@ static inline __attribute_const__ struct thread_info *current_thread_info(void)
 
 #endif /* !__ASSEMBLY__ */
 
-#define PREEMPT_ACTIVE      0x10000000
-
 /*
  * thread information flags
  * - these are process state flags that various assembly files may need to
index df5e13d64f2c02b28963c23b319a7634cf5dacc8..71a06b293489ddffd1b4177eca38572501c0ce36 100644 (file)
@@ -140,12 +140,6 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *,
                                    struct user_vfp_exc __user *);
 #endif
 
-/*
- * We use bit 30 of the preempt_count to indicate that kernel
- * preemption is occurring.  See <asm/hardirq.h>.
- */
-#define PREEMPT_ACTIVE 0x40000000
-
 /*
  * thread information flags:
  *  TIF_SYSCALL_TRACE  - syscall trace active
index 23a3c4791d86cb71f9a2520e2176212b1e107503..720e70b66ffdcf6eff60efc964c32e9a0584325b 100644 (file)
@@ -88,12 +88,6 @@ static inline struct thread_info *current_thread_info(void)
 
 #endif
 
-/*
- * We use bit 30 of the preempt_count to indicate that kernel
- * preemption is occurring.  See <asm/hardirq.h>.
- */
-#define PREEMPT_ACTIVE 0x40000000
-
 /*
  * thread information flags:
  *  TIF_SYSCALL_TRACE  - syscall trace active
index 6dc62e1f94c7801532c9a3bc0be13abe3f8009e4..a978f3fe7c25a2fc651b19179b846f3939047bd9 100644 (file)
@@ -66,8 +66,6 @@ static inline struct thread_info *current_thread_info(void)
 
 #endif /* !__ASSEMBLY__ */
 
-#define PREEMPT_ACTIVE         0x40000000
-
 /*
  * Thread information flags
  * - these are process state flags that various assembly files may need to access
index c078dd78d998b54a5e39889bfa545dc58b964030..58b54a6d5a1627285ccfcfe76dae5eb0b5fec7ff 100644 (file)
@@ -12,9 +12,6 @@
 extern void ack_bad_irq(unsigned int irq);
 #define ack_bad_irq ack_bad_irq
 
-/* Define until common code gets sane defaults */
-#define HARDIRQ_BITS 9
-
 #include <asm-generic/hardirq.h>
 
 #endif
index 3894005337ba7d8628de4f7de2f9f7dd8f5b603d..55f473bdad361a42ca625433a8d8bfb629f378bf 100644 (file)
@@ -88,8 +88,6 @@ static inline struct thread_info *current_thread_info(void)
 #define TI_CPU         12
 #define TI_PREEMPT     16
 
-#define        PREEMPT_ACTIVE  0x4000000
-
 /*
  * thread information flag bit numbers
  */
index 4c8dc562bd90dce27d0236140434a34120fe33d7..d4e9ef87076dbe4e0013876c27fdd84d69840d75 100644 (file)
@@ -84,8 +84,6 @@ struct thread_info *current_thread_info(void)
 #define put_thread_info(ti)    put_task_struct((ti)->task)
 #endif /* __ASSEMBLY__ */
 
-#define        PREEMPT_ACTIVE  0x10000000
-
 /*
  * thread information flag bit numbers
  * - pending work-to-be-done flags are in LSW
index 17bb12d760b2eb2858cb39bb8e057fd51c5c96e5..04126f7bfab2a918e4e8c509d9fd989a2e7217b5 100644 (file)
@@ -2,18 +2,6 @@
 #define __ASM_HARDIRQ_H
 
 #include <asm/irq.h>
-
-#define HARDIRQ_BITS   8
-
-/*
- * The hardirq mask has to be large enough to have
- * space for potentially all IRQ sources in the system
- * nesting on a single CPU:
- */
-#if (1 << HARDIRQ_BITS) < NR_IRQS
-# error HARDIRQ_BITS is too low!
-#endif
-
 #include <asm-generic/hardirq.h>
 
 #endif /* __ASM_HARDIRQ_H */
index 07c8c40c52b312ddfee756ca8ea5b0619ddb4a65..55dede18c032e37195cdb5c17ccebfddebc505a8 100644 (file)
@@ -44,8 +44,6 @@ struct thread_info {
 
 #endif
 
-#define PREEMPT_ACTIVE         0x10000000
-
 /*
  * macros/functions for gaining access to the thread information structure
  */
index bebd7eadc7720c3e3ddac4fe455a8bef37308042..af29e17c01814a2d88be2ca5d535f31441ddc474 100644 (file)
@@ -52,8 +52,6 @@ struct thread_info {
 
 #endif
 
-#define PREEMPT_ACTIVE         0x10000000
-
 /*
  * macros/functions for gaining access to the thread information structure
  */
index f7c32406a711a5b619d53037fe76d8689107e3c6..a59dad3b3695112e6f15633de0f3b9304af17532 100644 (file)
@@ -73,10 +73,6 @@ struct thread_info {
 
 #endif  /* __ASSEMBLY__  */
 
-/*  looks like "linux/hardirq.h" uses this.  */
-
-#define PREEMPT_ACTIVE         0x10000000
-
 #ifndef __ASSEMBLY__
 
 #define INIT_THREAD_INFO(tsk)                   \
index cade13dd0299f8754d18d87eded8661b64bf3eb8..5957cf61f8980641c54271ab4030b1d765570001 100644 (file)
@@ -11,9 +11,6 @@
 #include <asm/processor.h>
 #include <asm/ptrace.h>
 
-#define PREEMPT_ACTIVE_BIT 30
-#define PREEMPT_ACTIVE (1 << PREEMPT_ACTIVE_BIT)
-
 #ifndef __ASSEMBLY__
 
 /*
index 7a53530f22c219eb877d81d2392a85722e9503dc..ddea607f948aaa61932b022a14a390df9e816f8c 100644 (file)
@@ -1169,21 +1169,8 @@ skip_rbs_switch:
 .work_pending:
        tbit.z p6,p0=r31,TIF_NEED_RESCHED       // is resched not needed?
 (p6)   br.cond.sptk.few .notify
-#ifdef CONFIG_PREEMPT
-(pKStk) dep r21=-1,r0,PREEMPT_ACTIVE_BIT,1
-       ;;
-(pKStk) st4 [r20]=r21
-#endif
-       SSM_PSR_I(p0, p6, r2)   // enable interrupts
-       br.call.spnt.many rp=schedule
+       br.call.spnt.many rp=preempt_schedule_irq
 .ret9: cmp.eq p6,p0=r0,r0      // p6 <- 1 (re-check)
-       RSM_PSR_I(p0, r2, r20)  // disable interrupts
-       ;;
-#ifdef CONFIG_PREEMPT
-(pKStk)        adds r20=TI_PRE_COUNT+IA64_TASK_SIZE,r13
-       ;;
-(pKStk)        st4 [r20]=r0            // preempt_count() <- 0
-#endif
 (pLvSys)br.cond.sptk.few  __paravirt_pending_syscall_end
        br.cond.sptk.many .work_processed_kernel
 
index 4c31c0ae215e87928098a9b60e2d978ae710f800..5f2ac4f64ddfd125e197ee045bba122cde8fa900 100644 (file)
@@ -3,22 +3,6 @@
 #define __ASM_HARDIRQ_H
 
 #include <asm/irq.h>
-
-#if NR_IRQS > 256
-#define HARDIRQ_BITS   9
-#else
-#define HARDIRQ_BITS   8
-#endif
-
-/*
- * The hardirq mask has to be large enough to have
- * space for potentially all IRQ sources in the system
- * nesting on a single CPU:
- */
-#if (1 << HARDIRQ_BITS) < NR_IRQS
-# error HARDIRQ_BITS is too low!
-#endif
-
 #include <asm-generic/hardirq.h>
 
 #endif /* __ASM_HARDIRQ_H */
index c074f4c2e858e6cc76b16476a9fc24aea2566793..00171703402f19b576612f699bf733fe12252390 100644 (file)
@@ -53,8 +53,6 @@ struct thread_info {
 
 #endif
 
-#define PREEMPT_ACTIVE         0x10000000
-
 #define THREAD_SIZE            (PAGE_SIZE << 1)
 #define THREAD_SIZE_ORDER      1
 /*
index 0c01543f10cd9c1ad53c9453294d185fc18730cd..7c3db9940ce1f1e1254561ff0992c3980127beeb 100644 (file)
@@ -182,13 +182,7 @@ need_resched:
        ld      r4, PSW(sp)             ; interrupts off (exception path) ?
        and3    r4, r4, #0x4000
        beqz    r4, restore_all
-       LDIMM   (r4, PREEMPT_ACTIVE)
-       st      r4, @(TI_PRE_COUNT, r8)
-       ENABLE_INTERRUPTS(r4)
-       bl      schedule
-       ldi     r4, #0
-       st      r4, @(TI_PRE_COUNT, r8)
-       DISABLE_INTERRUPTS(r4)
+       bl      preempt_schedule_irq
        bra     need_resched
 #endif
 
index db30ed276878dcbf793e667d6edb279c5234a60a..6c618529d9b96e3815568a486a146c31b4b6a005 100644 (file)
@@ -5,17 +5,6 @@
 #include <linux/cache.h>
 #include <asm/irq.h>
 
-#define HARDIRQ_BITS   8
-
-/*
- * The hardirq mask has to be large enough to have
- * space for potentially all IRQ sources in the system
- * nesting on a single CPU:
- */
-#if (1 << HARDIRQ_BITS) < NR_IRQS
-# error HARDIRQ_BITS is too low!
-#endif
-
 #ifdef CONFIG_MMU
 
 static inline void ack_bad_irq(unsigned int irq)
index 126131f94a2ca951a2db9c9a414e3c30a142baeb..21a4784ca5a186256cfbb5bc6d1d1b7cd4de3e1c 100644 (file)
@@ -35,8 +35,6 @@ struct thread_info {
 };
 #endif /* __ASSEMBLY__ */
 
-#define PREEMPT_ACTIVE         0x4000000
-
 #define INIT_THREAD_INFO(tsk)                  \
 {                                              \
        .task           = &tsk,                 \
index a78f5649e8decf3fbd80c3d1a54567644f6fd385..b54ac7aba850eaf02ac995a857e673102039f3be 100644 (file)
@@ -45,7 +45,7 @@
 .globl system_call, buserr, trap, resume
 .globl sys_call_table
 .globl __sys_fork, __sys_clone, __sys_vfork
-.globl ret_from_interrupt, bad_interrupt
+.globl bad_interrupt
 .globl auto_irqhandler_fixup
 .globl user_irqvec_fixup
 
@@ -275,8 +275,6 @@ do_delayed_trace:
 ENTRY(auto_inthandler)
        SAVE_ALL_INT
        GET_CURRENT(%d0)
-       movel   %d0,%a1
-       addqb   #1,%a1@(TINFO_PREEMPT+1)
                                        |  put exception # in d0
        bfextu  %sp@(PT_OFF_FORMATVEC){#4,#10},%d0
        subw    #VEC_SPUR,%d0
@@ -286,32 +284,13 @@ ENTRY(auto_inthandler)
 auto_irqhandler_fixup = . + 2
        jsr     do_IRQ                  |  process the IRQ
        addql   #8,%sp                  |  pop parameters off stack
-
-ret_from_interrupt:
-       movel   %curptr@(TASK_STACK),%a1
-       subqb   #1,%a1@(TINFO_PREEMPT+1)
-       jeq     ret_from_last_interrupt
-2:     RESTORE_ALL
-
-       ALIGN
-ret_from_last_interrupt:
-       moveq   #(~ALLOWINT>>8)&0xff,%d0
-       andb    %sp@(PT_OFF_SR),%d0
-       jne     2b
-
-       /* check if we need to do software interrupts */
-       tstl    irq_stat+CPUSTAT_SOFTIRQ_PENDING
-       jeq     .Lret_from_exception
-       pea     ret_from_exception
-       jra     do_softirq
+       jra     ret_from_exception
 
 /* Handler for user defined interrupt vectors */
 
 ENTRY(user_inthandler)
        SAVE_ALL_INT
        GET_CURRENT(%d0)
-       movel   %d0,%a1
-       addqb   #1,%a1@(TINFO_PREEMPT+1)
                                        |  put exception # in d0
        bfextu  %sp@(PT_OFF_FORMATVEC){#4,#10},%d0
 user_irqvec_fixup = . + 2
@@ -321,29 +300,18 @@ user_irqvec_fixup = . + 2
        movel   %d0,%sp@-               |  put vector # on stack
        jsr     do_IRQ                  |  process the IRQ
        addql   #8,%sp                  |  pop parameters off stack
-
-       movel   %curptr@(TASK_STACK),%a1
-       subqb   #1,%a1@(TINFO_PREEMPT+1)
-       jeq     ret_from_last_interrupt
-       RESTORE_ALL
+       jra     ret_from_exception
 
 /* Handler for uninitialized and spurious interrupts */
 
 ENTRY(bad_inthandler)
        SAVE_ALL_INT
        GET_CURRENT(%d0)
-       movel   %d0,%a1
-       addqb   #1,%a1@(TINFO_PREEMPT+1)
 
        movel   %sp,%sp@-
        jsr     handle_badint
        addql   #4,%sp
-
-       movel   %curptr@(TASK_STACK),%a1
-       subqb   #1,%a1@(TINFO_PREEMPT+1)
-       jeq     ret_from_last_interrupt
-       RESTORE_ALL
-
+       jra     ret_from_exception
 
 resume:
        /*
index 4d7da384eea03d5a1101859a5814c7dccce53a9e..077d3a70fed1995611f89e0f5795c40da07378df 100644 (file)
@@ -58,12 +58,6 @@ void __init init_IRQ(void)
 {
        int i;
 
-       /* assembly irq entry code relies on this... */
-       if (HARDIRQ_MASK != 0x00ff0000) {
-               extern void hardirq_mask_is_broken(void);
-               hardirq_mask_is_broken();
-       }
-
        for (i = IRQ_AUTO_1; i <= IRQ_AUTO_7; i++)
                irq_set_chip_and_handler(i, &auto_irq_chip, handle_simple_irq);
 
index 7f91c2fde5096b9eaaef2e33334cf0339b896352..23ac054c6e1ad929fa40e8aa033e51251c96538d 100644 (file)
@@ -27,7 +27,6 @@
 .globl ret_from_exception
 .globl ret_from_signal
 .globl sys_call_table
-.globl ret_from_interrupt
 .globl bad_interrupt
 .globl inthandler1
 .globl inthandler2
@@ -137,7 +136,7 @@ inthandler1:
        movel   #65,%sp@-               /*  put vector # on stack*/
        jbsr    process_int             /*  process the IRQ*/
 3:             addql   #8,%sp                  /*  pop parameters off stack*/
-       bra     ret_from_interrupt
+       bra     ret_from_exception
 
 inthandler2:
        SAVE_ALL_INT
@@ -148,7 +147,7 @@ inthandler2:
        movel   #66,%sp@-               /*  put vector # on stack*/
        jbsr    process_int             /*  process the IRQ*/
 3:             addql   #8,%sp                  /*  pop parameters off stack*/
-       bra     ret_from_interrupt
+       bra     ret_from_exception
 
 inthandler3:
        SAVE_ALL_INT
@@ -159,7 +158,7 @@ inthandler3:
        movel   #67,%sp@-               /*  put vector # on stack*/
        jbsr    process_int             /*  process the IRQ*/
 3:             addql   #8,%sp                  /*  pop parameters off stack*/
-       bra     ret_from_interrupt
+       bra     ret_from_exception
 
 inthandler4:
        SAVE_ALL_INT
@@ -170,7 +169,7 @@ inthandler4:
        movel   #68,%sp@-               /*  put vector # on stack*/
        jbsr    process_int             /*  process the IRQ*/
 3:             addql   #8,%sp                  /*  pop parameters off stack*/
-       bra     ret_from_interrupt
+       bra     ret_from_exception
 
 inthandler5:
        SAVE_ALL_INT
@@ -181,7 +180,7 @@ inthandler5:
        movel   #69,%sp@-               /*  put vector # on stack*/
        jbsr    process_int             /*  process the IRQ*/
 3:             addql   #8,%sp                  /*  pop parameters off stack*/
-       bra     ret_from_interrupt
+       bra     ret_from_exception
 
 inthandler6:
        SAVE_ALL_INT
@@ -192,7 +191,7 @@ inthandler6:
        movel   #70,%sp@-               /*  put vector # on stack*/
        jbsr    process_int             /*  process the IRQ*/
 3:             addql   #8,%sp                  /*  pop parameters off stack*/
-       bra     ret_from_interrupt
+       bra     ret_from_exception
 
 inthandler7:
        SAVE_ALL_INT
@@ -203,7 +202,7 @@ inthandler7:
        movel   #71,%sp@-               /*  put vector # on stack*/
        jbsr    process_int             /*  process the IRQ*/
 3:             addql   #8,%sp                  /*  pop parameters off stack*/
-       bra     ret_from_interrupt
+       bra     ret_from_exception
 
 inthandler:
        SAVE_ALL_INT
@@ -214,23 +213,7 @@ inthandler:
        movel   %d0,%sp@-               /*  put vector # on stack*/
        jbsr    process_int             /*  process the IRQ*/
 3:             addql   #8,%sp                  /*  pop parameters off stack*/
-       bra     ret_from_interrupt
-
-ret_from_interrupt:
-       jeq     1f
-2:
-       RESTORE_ALL
-1:
-       moveb   %sp@(PT_OFF_SR), %d0
-       and     #7, %d0
-       jhi     2b
-
-       /* check if we need to do software interrupts */
-       jeq     ret_from_exception
-
-       pea     ret_from_exception
-       jra     do_softirq
-
+       bra     ret_from_exception
 
 /*
  * Handler for uninitialized and spurious interrupts.
index 904fd9a4af4e45d472a121fdc678a523655059cc..447c33ef37fda3456b5fad22d705f123c91b4f84 100644 (file)
@@ -29,7 +29,6 @@
 .globl ret_from_exception
 .globl ret_from_signal
 .globl sys_call_table
-.globl ret_from_interrupt
 .globl bad_interrupt
 .globl inthandler
 
@@ -132,26 +131,9 @@ inthandler:
 
        movel   %sp,%sp@-
        movel   %d0,%sp@-               /*  put vector # on stack*/
-       jbsr    do_IRQ                  /*  process the IRQ*/
-3:             addql   #8,%sp                  /*  pop parameters off stack*/
-       bra     ret_from_interrupt
-
-ret_from_interrupt:
-       jeq     1f
-2:
-       RESTORE_ALL
-1:
-       moveb   %sp@(PT_OFF_SR), %d0
-       and     #7, %d0
-       jhi     2b
-       /* check if we need to do software interrupts */
-
-       movel   irq_stat+CPUSTAT_SOFTIRQ_PENDING,%d0
-       jeq     ret_from_exception
-
-       pea     ret_from_exception
-       jra     do_softirq
-
+       jbsr    do_IRQ                  /*  process the IRQ */
+       addql   #8,%sp                  /*  pop parameters off stack*/
+       jra     ret_from_exception
 
 /*
  * Handler for uninitialized and spurious interrupts.
index 7c4a3300614230ce8d956257412e8e0ab0ade8fb..b19e9c588a16733e81f5495593c881d2d9c7c170 100644 (file)
@@ -46,8 +46,6 @@ struct thread_info {
 
 #endif
 
-#define PREEMPT_ACTIVE         0x10000000
-
 #ifdef CONFIG_4KSTACKS
 #define THREAD_SHIFT           12
 #else
index de26ea6373ded64af3d7793489be9343a1ee1075..8c9d36591a031d6a84e81ae7485185aea125a5e3 100644 (file)
@@ -106,8 +106,6 @@ static inline struct thread_info *current_thread_info(void)
 /* thread information allocation */
 #endif /* __ASSEMBLY__ */
 
-#define PREEMPT_ACTIVE         0x10000000
-
 /*
  * thread information flags
  * - these are process state flags that various assembly files may
index f9b24bfbdbae96f8cc31d58d7cb0318130ceab9f..4f58ef6d0eed5c58c9e58595fac36b4b7f747a2e 100644 (file)
@@ -92,8 +92,6 @@ static inline struct thread_info *current_thread_info(void)
 
 #define STACK_WARN     (THREAD_SIZE / 8)
 
-#define PREEMPT_ACTIVE         0x10000000
-
 /*
  * thread information flags
  * - these are process state flags that various assembly files may need to
index 224b4262486dbca41453861f95461b635bb40bcc..bf280eaccd36fd7e7b963176184450fb98126340 100644 (file)
@@ -16,8 +16,6 @@
 
 #include <asm/page.h>
 
-#define PREEMPT_ACTIVE         0x10000000
-
 #ifdef CONFIG_4KSTACKS
 #define THREAD_SIZE            (4096)
 #define THREAD_SIZE_ORDER      (0)
index bc7cf120106b30e477264850e373f346eeb9bf82..d5f97ea3a4e1ab13a018de4d5d549f90efe4f299 100644 (file)
@@ -46,9 +46,6 @@ struct thread_info {
 #define THREAD_SIZE             (PAGE_SIZE << THREAD_SIZE_ORDER)
 #define THREAD_SHIFT            (PAGE_SHIFT + THREAD_SIZE_ORDER)
 
-#define PREEMPT_ACTIVE_BIT     28
-#define PREEMPT_ACTIVE         (1 << PREEMPT_ACTIVE_BIT)
-
 /*
  * thread information flags
  */
index ba7b1973866e1933486f47ed59e3aa0efe799f34..8fd6cf6dcee854c8244010ce12d107abb0fa81d7 100644 (file)
@@ -82,8 +82,6 @@ static inline struct thread_info *current_thread_info(void)
 
 #endif /* __ASSEMBLY__ */
 
-#define PREEMPT_ACTIVE         0x10000000
-
 /*
  * thread information flag bit numbers
  */
index a908d2941c5d90ab305f8e7c490585e20113579a..b7eabaaeffbd09a1310c3a8de2fe73786f00169a 100644 (file)
@@ -18,8 +18,6 @@
 #define __ARCH_HAS_DO_SOFTIRQ
 #define __ARCH_IRQ_EXIT_IRQS_DISABLED
 
-#define HARDIRQ_BITS   8
-
 static inline void ack_bad_irq(unsigned int irq)
 {
        printk(KERN_CRIT "unexpected IRQ trap at vector %02x\n", irq);
index eb5f64d26d06190de4695d38e9190449859588df..10e0fcd3633d178f25b299a709b9c80706f05818 100644 (file)
@@ -111,6 +111,4 @@ static inline struct thread_info *current_thread_info(void)
 #define is_32bit_task()                (1)
 #endif
 
-#define PREEMPT_ACTIVE         0x4000000
-
 #endif /* _ASM_THREAD_INFO_H */
index 1425cc034872e5993320e6722f4965bdb34f1189..656b7ada9326ab63ba45b42f3404cc39979e16f5 100644 (file)
@@ -72,8 +72,6 @@ register struct thread_info *__current_thread_info __asm__("r28");
 
 #endif /* !__ASSEMBLY__ */
 
-#define PREEMPT_ACTIVE         0x10000000
-
 /*
  * thread information flags
  * - these are process state flags that various assembly files may need to
index 45a93669289da4d7ff53119d9d3ea69158fced7e..ad27ffa65e2eafd2fb89c959c812862b70ba8665 100644 (file)
@@ -41,8 +41,6 @@ struct thread_info {
 
 #endif
 
-#define PREEMPT_ACTIVE         0x10000000
-
 #if defined(CONFIG_4KSTACKS)
 #define THREAD_SHIFT   12
 #else
index 9b6e4beeb296261c2fb5b315377822e236c587cf..ca46834294b7fa9fbf7f99eb0958ae1c18af6df7 100644 (file)
@@ -108,7 +108,7 @@ need_resched:
        and     #(0xf0>>1), r0          ! interrupts off (exception path)?
        cmp/eq  #(0xf0>>1), r0
        bt      noresched
-       mov.l   3f, r0
+       mov.l   1f, r0
        jsr     @r0                     ! call preempt_schedule_irq
         nop
        bra     need_resched
@@ -119,9 +119,7 @@ noresched:
         nop
 
        .align 2
-1:     .long   PREEMPT_ACTIVE
-2:     .long   schedule
-3:     .long   preempt_schedule_irq
+1:     .long   preempt_schedule_irq
 #endif
 
 ENTRY(resume_userspace)
index 162007643cdcb94faac5ceec465c095a2520be51..ee93923b7f8252d8727515c5b1e0e57132bf6484 100644 (file)
@@ -7,7 +7,6 @@
 #ifndef __SPARC_HARDIRQ_H
 #define __SPARC_HARDIRQ_H
 
-#define HARDIRQ_BITS    8
 #include <asm-generic/hardirq.h>
 
 #endif /* __SPARC_HARDIRQ_H */
index 7c29fd1a87aa4289e78bb7297a4ce41c133cce63..f478ff1ddd028733fe735bcf619e77b8f02803ee 100644 (file)
@@ -14,6 +14,4 @@
 
 void ack_bad_irq(unsigned int irq);
 
-#define HARDIRQ_BITS   8
-
 #endif /* !(__SPARC64_HARDIRQ_H) */
index dd3807599bb9ac63573191e1086e506699e5d41a..96efa7adc22330d2684e67ab3c83dafa99e89e8a 100644 (file)
@@ -105,8 +105,6 @@ register struct thread_info *current_thread_info_reg asm("g6");
 #define TI_W_SAVED     0x250
 /* #define TI_RESTART_BLOCK 0x25n */ /* Nobody cares */
 
-#define PREEMPT_ACTIVE         0x4000000
-
 /*
  * thread information flag bit numbers
  */
index 5d9292ab10777bdae90bb8e61eb4d109090f8d15..a5f01ac6d0f1a2619cdac6b639248cb5a7153dac 100644 (file)
@@ -111,8 +111,6 @@ struct thread_info {
 #define THREAD_SHIFT PAGE_SHIFT
 #endif /* PAGE_SHIFT == 13 */
 
-#define PREEMPT_ACTIVE         0x10000000
-
 /*
  * macros/functions for gaining access to the thread information structure
  */
index a954eb81881bf37d45fd01b22dc1e42839318f40..39f0c662f4c81dcdf3050926a5a9525d352933a3 100644 (file)
@@ -312,12 +312,10 @@ to_kernel:
                 nop
                cmp                     %l4, 0
                bne,pn                  %xcc, kern_fpucheck
-                sethi                  %hi(PREEMPT_ACTIVE), %l6
-               stw                     %l6, [%g6 + TI_PRE_COUNT]
-               call                    schedule
+                nop
+               call                    preempt_schedule_irq
                 nop
                ba,pt                   %xcc, rtrap
-                stw                    %g0, [%g6 + TI_PRE_COUNT]
 #endif
 kern_fpucheck: ldub                    [%g6 + TI_FPDEPTH], %l5
                brz,pt                  %l5, rt_continue
index 822390f9a154a620768004d76124d9b7f266add1..54110af23985ab7a395d22d659c80e1ddc93f748 100644 (file)
@@ -42,6 +42,4 @@ DECLARE_PER_CPU(irq_cpustat_t, irq_stat);
 
 #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
 
-#define HARDIRQ_BITS   8
-
 #endif /* _ASM_TILE_HARDIRQ_H */
index b8aa6df3e102d0cf7a2dd7ba7e4f8e9309e983d6..729aa107f64e6391cb435ff1f5c038065eafe3b2 100644 (file)
@@ -113,8 +113,6 @@ extern void _cpu_idle(void);
 
 #endif /* !__ASSEMBLY__ */
 
-#define PREEMPT_ACTIVE         0x10000000
-
 /*
  * Thread information flags that various assembly files may need to access.
  * Keep flags accessed frequently in low bits, particular since it makes
index 2c8eeb2df8b43a6c21b4b10da99fe1042276229f..1c5b2a83046aab011e03c1e735b020a374608838 100644 (file)
@@ -60,8 +60,6 @@ static inline struct thread_info *current_thread_info(void)
 
 #endif
 
-#define PREEMPT_ACTIVE         0x10000000
-
 #define TIF_SYSCALL_TRACE      0       /* syscall trace active */
 #define TIF_SIGPENDING         1       /* signal pending */
 #define TIF_NEED_RESCHED       2       /* rescheduling necessary */
index 818b4a1edb5b1bd26e3d8eb7baffe212df50a6f0..af36d8eabdf1c1dd6650e10682eff053550c906a 100644 (file)
@@ -117,12 +117,6 @@ static inline struct thread_info *current_thread_info(void)
 
 #endif
 
-/*
- * We use bit 30 of the preempt_count to indicate that kernel
- * preemption is occurring.  See <asm/hardirq.h>.
- */
-#define PREEMPT_ACTIVE 0x40000000
-
 /*
  * thread information flags:
  *  TIF_SYSCALL_TRACE  - syscall trace active
index c46a46be1ec699c0a92180c4f584da150fd7f5eb..3ba3de457d053e77eb36d7d6fe78f7769a1df470 100644 (file)
@@ -153,8 +153,6 @@ struct thread_info {
 #define _TIF_WORK_CTXSW_PREV (_TIF_WORK_CTXSW|_TIF_USER_RETURN_NOTIFY)
 #define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW)
 
-#define PREEMPT_ACTIVE         0x10000000
-
 #ifdef CONFIG_X86_32
 
 #define STACK_WARN     (THREAD_SIZE/8)
index 9481004ac119e04ef8f6a80921561de071b445a1..470153e8547c19a6819ac4cfbea3aa095b3dd33e 100644 (file)
@@ -76,8 +76,6 @@ struct thread_info {
 
 #endif
 
-#define PREEMPT_ACTIVE         0x10000000
-
 /*
  * macros/functions for gaining access to the thread information structure
  */
index 56bb0dc8b7d44cbab1a5a3cefb9efc04a7440995..7dc10036eff552229cdd964e88669a7759a8152f 100644 (file)
@@ -70,6 +70,9 @@ typedef       void (*irq_preflow_handler_t)(struct irq_data *data);
  * IRQ_MOVE_PCNTXT             - Interrupt can be migrated from process context
  * IRQ_NESTED_TRHEAD           - Interrupt nests into another thread
  * IRQ_PER_CPU_DEVID           - Dev_id is a per-cpu variable
+ * IRQ_IS_POLLED               - Always polled by another interrupt. Exclude
+ *                               it from the spurious interrupt detection
+ *                               mechanism and from core side polling.
  */
 enum {
        IRQ_TYPE_NONE           = 0x00000000,
@@ -94,12 +97,14 @@ enum {
        IRQ_NESTED_THREAD       = (1 << 15),
        IRQ_NOTHREAD            = (1 << 16),
        IRQ_PER_CPU_DEVID       = (1 << 17),
+       IRQ_IS_POLLED           = (1 << 18),
 };
 
 #define IRQF_MODIFY_MASK       \
        (IRQ_TYPE_SENSE_MASK | IRQ_NOPROBE | IRQ_NOREQUEST | \
         IRQ_NOAUTOEN | IRQ_MOVE_PCNTXT | IRQ_LEVEL | IRQ_NO_BALANCING | \
-        IRQ_PER_CPU | IRQ_NESTED_THREAD | IRQ_NOTHREAD | IRQ_PER_CPU_DEVID)
+        IRQ_PER_CPU | IRQ_NESTED_THREAD | IRQ_NOTHREAD | IRQ_PER_CPU_DEVID | \
+        IRQ_IS_POLLED)
 
 #define IRQ_NO_BALANCING_MASK  (IRQ_PER_CPU | IRQ_NO_BALANCING)
 
index 931bc616219f626562364ba289d55a84f2ef2ba0..d169820203dd825e54bd35479954e162509e78d8 100644 (file)
  * - bits 0-7 are the preemption count (max preemption depth: 256)
  * - bits 8-15 are the softirq count (max # of softirqs: 256)
  *
- * The hardirq count can in theory reach the same as NR_IRQS.
- * In reality, the number of nested IRQS is limited to the stack
- * size as well. For archs with over 1000 IRQS it is not practical
- * to expect that they will all nest. We give a max of 10 bits for
- * hardirq nesting. An arch may choose to give less than 10 bits.
- * m68k expects it to be 8.
+ * The hardirq count could in theory be the same as the number of
+ * interrupts in the system, but we run all interrupt handlers with
+ * interrupts disabled, so we cannot have nesting interrupts. Though
+ * there are a few palaeontologic drivers which reenable interrupts in
+ * the handler, so we need more than one bit here.
  *
- * - bits 16-25 are the hardirq count (max # of nested hardirqs: 1024)
- * - bit 26 is the NMI_MASK
- * - bit 27 is the PREEMPT_ACTIVE flag
- *
- * PREEMPT_MASK: 0x000000ff
- * SOFTIRQ_MASK: 0x0000ff00
- * HARDIRQ_MASK: 0x03ff0000
- *     NMI_MASK: 0x04000000
+ * PREEMPT_MASK:       0x000000ff
+ * SOFTIRQ_MASK:       0x0000ff00
+ * HARDIRQ_MASK:       0x000f0000
+ *     NMI_MASK:       0x00100000
+ * PREEMPT_ACTIVE:     0x00200000
  */
 #define PREEMPT_BITS   8
 #define SOFTIRQ_BITS   8
+#define HARDIRQ_BITS   4
 #define NMI_BITS       1
 
-#define MAX_HARDIRQ_BITS 10
-
-#ifndef HARDIRQ_BITS
-# define HARDIRQ_BITS  MAX_HARDIRQ_BITS
-#endif
-
-#if HARDIRQ_BITS > MAX_HARDIRQ_BITS
-#error HARDIRQ_BITS too high!
-#endif
-
 #define PREEMPT_SHIFT  0
 #define SOFTIRQ_SHIFT  (PREEMPT_SHIFT + PREEMPT_BITS)
 #define HARDIRQ_SHIFT  (SOFTIRQ_SHIFT + SOFTIRQ_BITS)
 
 #define SOFTIRQ_DISABLE_OFFSET (2 * SOFTIRQ_OFFSET)
 
-#ifndef PREEMPT_ACTIVE
 #define PREEMPT_ACTIVE_BITS    1
 #define PREEMPT_ACTIVE_SHIFT   (NMI_SHIFT + NMI_BITS)
 #define PREEMPT_ACTIVE (__IRQ_MASK(PREEMPT_ACTIVE_BITS) << PREEMPT_ACTIVE_SHIFT)
-#endif
-
-#if PREEMPT_ACTIVE < (1 << (NMI_SHIFT + NMI_BITS))
-#error PREEMPT_ACTIVE is too low!
-#endif
 
 #define hardirq_count()        (preempt_count() & HARDIRQ_MASK)
 #define softirq_count()        (preempt_count() & SOFTIRQ_MASK)
index 6f7ffa460089796b324682e2a1c1fc5047f97da3..7e35d4b9e14a45cba37fd8a7f234e5a3a50ec4b5 100644 (file)
@@ -22,7 +22,7 @@ struct sched_param {
 #include <linux/errno.h>
 #include <linux/nodemask.h>
 #include <linux/mm_types.h>
-#include <linux/preempt.h>
+#include <linux/preempt_mask.h>
 
 #include <asm/page.h>
 #include <asm/ptrace.h>
index 1162f1030f18f9326c23522417a3de87feb18ef4..3320b84cc60f79ac09501d6f4d55acc01b0cebe6 100644 (file)
@@ -14,6 +14,7 @@ enum {
        _IRQ_NO_BALANCING       = IRQ_NO_BALANCING,
        _IRQ_NESTED_THREAD      = IRQ_NESTED_THREAD,
        _IRQ_PER_CPU_DEVID      = IRQ_PER_CPU_DEVID,
+       _IRQ_IS_POLLED          = IRQ_IS_POLLED,
        _IRQF_MODIFY_MASK       = IRQF_MODIFY_MASK,
 };
 
@@ -26,6 +27,7 @@ enum {
 #define IRQ_NOAUTOEN           GOT_YOU_MORON
 #define IRQ_NESTED_THREAD      GOT_YOU_MORON
 #define IRQ_PER_CPU_DEVID      GOT_YOU_MORON
+#define IRQ_IS_POLLED          GOT_YOU_MORON
 #undef IRQF_MODIFY_MASK
 #define IRQF_MODIFY_MASK       GOT_YOU_MORON
 
@@ -147,3 +149,8 @@ static inline bool irq_settings_is_nested_thread(struct irq_desc *desc)
 {
        return desc->status_use_accessors & _IRQ_NESTED_THREAD;
 }
+
+static inline bool irq_settings_is_polled(struct irq_desc *desc)
+{
+       return desc->status_use_accessors & _IRQ_IS_POLLED;
+}
index 7b5f012bde9d73ff246652fe48d49e5b1aebc12c..a1d8cc63b56e55ddbb83741b1d20db58e5ab3b7c 100644 (file)
@@ -67,8 +67,13 @@ static int try_one_irq(int irq, struct irq_desc *desc, bool force)
 
        raw_spin_lock(&desc->lock);
 
-       /* PER_CPU and nested thread interrupts are never polled */
-       if (irq_settings_is_per_cpu(desc) || irq_settings_is_nested_thread(desc))
+       /*
+        * PER_CPU, nested thread interrupts and interrupts explicitely
+        * marked polled are excluded from polling.
+        */
+       if (irq_settings_is_per_cpu(desc) ||
+           irq_settings_is_nested_thread(desc) ||
+           irq_settings_is_polled(desc))
                goto out;
 
        /*
@@ -268,7 +273,8 @@ try_misrouted_irq(unsigned int irq, struct irq_desc *desc,
 void note_interrupt(unsigned int irq, struct irq_desc *desc,
                    irqreturn_t action_ret)
 {
-       if (desc->istate & IRQS_POLL_INPROGRESS)
+       if (desc->istate & IRQS_POLL_INPROGRESS ||
+           irq_settings_is_polled(desc))
                return;
 
        /* we get here again via the threaded handler */