Skip to content

Commit

Permalink
Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/l…
Browse files Browse the repository at this point in the history
…inux/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
  • Loading branch information
torvalds committed Nov 19, 2013
2 parents 801a760 + 00d1a39 commit 4007162
Show file tree
Hide file tree
Showing 50 changed files with 55 additions and 275 deletions.
2 changes: 0 additions & 2 deletions arch/alpha/include/asm/thread_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions arch/arc/include/asm/thread_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions arch/arm/include/asm/thread_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions arch/arm64/include/asm/thread_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions arch/avr32/include/asm/thread_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions arch/blackfin/include/asm/hardirq.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 0 additions & 2 deletions arch/blackfin/include/asm/thread_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 0 additions & 2 deletions arch/c6x/include/asm/thread_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 0 additions & 12 deletions arch/cris/include/asm/hardirq.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
2 changes: 0 additions & 2 deletions arch/cris/include/asm/thread_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ struct thread_info {

#endif

#define PREEMPT_ACTIVE 0x10000000

/*
* macros/functions for gaining access to the thread information structure
*/
Expand Down
2 changes: 0 additions & 2 deletions arch/frv/include/asm/thread_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ struct thread_info {

#endif

#define PREEMPT_ACTIVE 0x10000000

/*
* macros/functions for gaining access to the thread information structure
*/
Expand Down
4 changes: 0 additions & 4 deletions arch/hexagon/include/asm/thread_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down
3 changes: 0 additions & 3 deletions arch/ia64/include/asm/thread_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__

/*
Expand Down
15 changes: 1 addition & 14 deletions arch/ia64/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
16 changes: 0 additions & 16 deletions arch/m32r/include/asm/hardirq.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 0 additions & 2 deletions arch/m32r/include/asm/thread_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ struct thread_info {

#endif

#define PREEMPT_ACTIVE 0x10000000

#define THREAD_SIZE (PAGE_SIZE << 1)
#define THREAD_SIZE_ORDER 1
/*
Expand Down
8 changes: 1 addition & 7 deletions arch/m32r/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
11 changes: 0 additions & 11 deletions arch/m68k/include/asm/hardirq.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions arch/m68k/include/asm/thread_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ struct thread_info {
};
#endif /* __ASSEMBLY__ */

#define PREEMPT_ACTIVE 0x4000000

#define INIT_THREAD_INFO(tsk) \
{ \
.task = &tsk, \
Expand Down
40 changes: 4 additions & 36 deletions arch/m68k/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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:
/*
Expand Down
6 changes: 0 additions & 6 deletions arch/m68k/kernel/ints.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Loading

0 comments on commit 4007162

Please sign in to comment.