CRISv32: don't enable irqs in INIT_THREAD
PATCH 1/6 CRISv32: don't enable irqs in INIT_THREAD
INIT_THREAD enables interrupts in the thread_struct's saved flags. This means that interrupts get enabled in the middle of context_switch() while switching to new tasks that get forked off the init task during boot. Don't do this.
Fixes the following splat on boot with spinlock debugging on:
BUG: spinlock cpu recursion on CPU#0, swapper/2 lock: runqueues+0x0/0x47c, .magic: dead4ead, .owner: swapper/0, .owner_cpu: 0 CPU: 0 PID: 2 Comm: swapper Not tainted 3.19.0-08796-ga747b55 #285 Call Trace: [<c0032b80>] spin_bug+0x2a/0x36 [<c0032c98>] do_raw_spin_lock+0xa2/0x126 [<c01964b0>] _raw_spin_lock+0x20/0x2a [<c00286c8>] scheduler_tick+0x22/0x76 [<c003db2c>] update_process_times+0x5e/0x72 [<c0007a94>] timer_interrupt+0x4e/0x6a [<c00378d6>] handle_irq_event_percpu+0x54/0xf2 [<c00379c4>] handle_irq_event+0x50/0x74 [<c003988e>] handle_simple_irq+0x6c/0xbe [<c0037270>] generic_handle_irq+0x2a/0x36 [<c0004c40>] do_IRQ+0x38/0x84 [<c000662e>] crisv32_do_IRQ+0x54/0x60 [<c0006204>] IRQ0x4b_interrupt+0x34/0x3c [<c0192baa>] __schedule+0x24a/0x532 [<c00056b4>] ret_from_kernel_thread+0x0/0x14
--- arch/cris/include/arch-v32/arch/processor.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/cris/include/arch-v32/arch/processor.h +1 -2
@@ -25,8 +25,7 @@ struct thread_struct {*/ #define TASK_SIZE (0xB0000000UL) -/* CCS I=1, enable interrupts. */ -#define INIT_THREAD { 0, 0, (1 << I_CCS_BITNR) } +#define INIT_THREAD { }#define KSTK_EIP (tsk) \ ({ \
Signature · 1 line
2.1.4
PATCH 2/6 CRIS: remove SMP code
The CRIS SMP code cannot be built since there is no (and appears to never have been) a CONFIG_SMP Kconfig option in arch/cris/. Remove it.
--- arch/cris/Kconfig | 1 - arch/cris/arch-v32/kernel/Makefile | 1 - arch/cris/arch-v32/kernel/head.S | 32 --- arch/cris/arch-v32/kernel/irq.c | 3 - arch/cris/arch-v32/kernel/setup.c | 5 - arch/cris/arch-v32/kernel/smp.c | 358 ----------------------------- arch/cris/arch-v32/kernel/time.c | 3 - arch/cris/arch-v32/lib/Makefile | 2 +- arch/cris/arch-v32/lib/spinlock.S | 40 ---- arch/cris/arch-v32/mm/init.c | 11 - arch/cris/arch-v32/mm/mmu.S | 4 - arch/cris/include/arch-v32/arch/atomic.h | 28 --- arch/cris/include/arch-v32/arch/spinlock.h | 131 ----------- arch/cris/include/asm/cmpxchg.h | 2 - arch/cris/include/asm/smp.h | 10 - arch/cris/include/asm/spinlock.h | 1 - arch/cris/include/asm/tlbflush.h | 7 - 17 files changed, 1 insertion(+), 638 deletions(-) delete mode 100644 arch/cris/arch-v32/kernel/smp.c delete mode 100644 arch/cris/arch-v32/lib/spinlock.S delete mode 100644 arch/cris/include/arch-v32/arch/spinlock.h delete mode 100644 arch/cris/include/asm/smp.h delete mode 100644 arch/cris/include/asm/spinlock.h
arch/cris/Kconfig +0 -1
@@ -46,7 +46,6 @@ config CRIS select ARCH_WANT_IPC_PARSE_VERSION select GENERIC_IRQ_SHOW select GENERIC_IOMAP - select GENERIC_SMP_IDLE_THREAD if ETRAX_ARCH_V32 select GENERIC_CMOS_UPDATE select MODULES_USE_ELF_RELA select CLONE_BACKWARDS2
arch/cris/arch-v32/kernel/Makefile +0 -1
@@ -9,7 +9,6 @@ obj-y := entry.o traps.o irq.o debugport.o \ process.o ptrace.o setup.o signal.o traps.o time.o \ cache.o cacheflush.o -obj-$(CONFIG_SMP) += smp.o obj-$(CONFIG_ETRAX_KGDB) += kgdb.o kgdb_asm.o obj-$(CONFIG_ETRAX_FAST_TIMER) += fasttimer.o obj-$(CONFIG_MODULES) += crisksyms.o
arch/cris/arch-v32/kernel/head.S +0 -32
@@ -52,11 +52,6 @@ tstart: GIO_INIT -#ifdef CONFIG_SMP -secondary_cpu_entry: /* Entry point for secondary CPUs */ - di -#endif - ;; Setup and enable the MMU. Use same configuration for both the data ;; and the instruction MMU. ;;
@@ -164,33 +159,6 @@ secondary_cpu_entry: /* Entry point for secondary CPUs */ nop nop -#ifdef CONFIG_SMP - ;; Read CPU ID - move 0, $srs - nop - nop - nop - move $s12, $r0 - cmpq 0, $r0 - beq master_cpu - nop -slave_cpu: - ; Time to boot-up. Get stack location provided by master CPU. - move.d smp_init_current_idle_thread, $r1 - move.d [$r1], $sp - add.d 8192, $sp - move.d ebp_start, $r0 ; Defined in linker-script. - move $r0, $ebp - jsr smp_callin - nop -master_cpu: - /* Set up entry point for secondary CPUs. The boot ROM has set up - * EBP at start of internal memory. The CPU will get there - * later when we issue an IPI to them... */ - move.d MEM_INTMEM_START + IPI_INTR_VECT * 4, $r0 - move.d secondary_cpu_entry, $r1 - move.d $r1, [$r0] -#endif ; Check if starting from DRAM (network->RAM boot or unpacked ; compressed kernel), or directly from flash. lapcq ., $r0
arch/cris/arch-v32/kernel/irq.c +0 -3
@@ -58,9 +58,6 @@ struct cris_irq_allocation irq_allocations[NR_REAL_IRQS] =static unsigned long irq_regs[NR_CPUS ] = { regi_irq, -#ifdef CONFIG_SMP - regi_irq2, -#endif };#if NR_REAL_IRQS >32
arch/cris/arch-v32/kernel/setup.c +0 -5
@@ -63,11 +63,6 @@ int show_cpuinfo(struct seq_file *m, void *v) info = &cpinfo[ARRAY_SIZE (cpinfo) -1 ]; -#ifdef CONFIG_SMP -if (!cpu_online (cpu)) -return 0 ; -#endif - revision =rdvr ();for (i =0 ; i <ARRAY_SIZE (cpinfo); i++) {
arch/cris/arch-v32/kernel/smp.c deleted +0 -358
358 lines not on this page · raw message
arch/cris/arch-v32/kernel/time.c +0 -3
@@ -60,9 +60,6 @@ arch_initcall(etrax_init_cont_rotime);unsigned long timer_regs[NR_CPUS ] = { regi_timer0, -#ifdef CONFIG_SMP - regi_timer2 -#endif };extern int set_rtc_mmss (unsigned long nowtime);
arch/cris/arch-v32/lib/Makefile +1 -1
@@ -3,5 +3,5 @@ # lib-y = checksum.o checksumcopy.o string.o usercopy.o memset.o \ - csumcpfruser.o spinlock.o delay.o strcmp.o + csumcpfruser.o delay.o strcmp.o
arch/cris/arch-v32/lib/spinlock.S deleted +0 -40
@@ -1,40 +0,0 @@ -;; Core of the spinlock implementation -;; -;; Copyright (C) 2004 Axis Communications AB. -;; -;; Author: Mikael Starvik - - - .global cris_spin_lock - .type cris_spin_lock,@function - .global cris_spin_trylock - .type cris_spin_trylock,@function - - .text - -cris_spin_lock: - clearf p -1: test.b [$r10] - beq 1b - clearf p - ax - clear.b [$r10] - bcs 1b - clearf p - ret - nop - - .size cris_spin_lock, . - cris_spin_lock - -cris_spin_trylock: - clearf p -1: move.b [$r10], $r11 - ax - clear.b [$r10] - bcs 1b - clearf p - ret - movu.b $r11,$r10 - - .size cris_spin_trylock, . - cris_spin_trylock -
arch/cris/arch-v32/mm/init.c +0 -11
@@ -40,17 +40,6 @@ void __init cris_mmu_init(void)*/ per_cpu (current_pgd,smp_processor_id ()) = init_mm.pgd; -#ifdef CONFIG_SMP - { -pgd_t **pgd; - pgd = (pgd_t **)&per_cpu (current_pgd,smp_processor_id ()); -SUPP_BANK_SEL (1 ); -SUPP_REG_WR (RW_MM_TLB_PGD , pgd); -SUPP_BANK_SEL (2 ); -SUPP_REG_WR (RW_MM_TLB_PGD , pgd); - } -#endif -/* Initialise the TLB. Function found in tlb.c. */ tlb_init ();
arch/cris/arch-v32/mm/mmu.S +0 -4
@@ -115,11 +115,7 @@ move.d $r0, [$r1] ; last_refill_cause = rw_mm_cause 3: ; Probably not in a loop, continue normal processing -#ifdef CONFIG_SMP - move $s7, $acr ; PGD -#else move.d current_pgd, $acr ; PGD -#endif ; Look up PMD in PGD lsrq 24, $r0 ; Get PMD index into PGD (bit 24-31) move.d [$acr], $acr ; PGD for the current process
arch/cris/include/arch-v32/arch/atomic.h +0 -28
@@ -1,36 +1,8 @@#ifndef __ASM_CRIS_ARCH_ATOMIC__#define __ASM_CRIS_ARCH_ATOMIC__ -#include <linux/spinlock_types.h> - -extern void cris_spin_unlock (void *l,int val); -extern void cris_spin_lock (void *l); -extern int cris_spin_trylock (void * l); - -#ifndef CONFIG_SMP #define cris_atomic_save (addr, flags) local_irq_save(flags);#define cris_atomic_restore (addr, flags) local_irq_restore(flags); -#else - -extern spinlock_t cris_atomic_locks[]; -#define LOCK_COUNT 128 -#define HASH_ADDR (a) (((int)a) & 127) - -#define cris_atomic_save (addr, flags) \ - local_irq_save(flags); \ - cris_spin_lock((void *)&cris_atomic_locks[HASH_ADDR(addr)].raw_lock.slock); - -#define cris_atomic_restore (addr, flags) \ - { \ - spinlock_t *lock = (void*)&cris_atomic_locks[HASH_ADDR(addr)]; \ - __asm__ volatile ("move.d %1,%0" \ - : "=m" (lock->raw_lock.slock) \ - : "r" (1) \ - : "memory"); \ - local_irq_restore(flags); \ - } - -#endif #endif
arch/cris/include/arch-v32/arch/spinlock.h deleted +0 -131
131 lines not on this page · raw message
arch/cris/include/asm/cmpxchg.h +0 -2
@@ -46,8 +46,6 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz (unsigned long)(n), sizeof(*(ptr))))#define cmpxchg64_local (ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) -#ifndef CONFIG_SMP #include <asm-generic/cmpxchg.h> -#endif #endif /* __ASM_CRIS_CMPXCHG__ */
arch/cris/include/asm/smp.h deleted +0 -10
@@ -1,10 +0,0 @@ -#ifndef __ASM_SMP_H -#define __ASM_SMP_H - -#include <linux/cpumask.h> - -extern cpumask_t phys_cpu_present_map; - -#define raw_smp_processor_id () (current_thread_info()->cpu) - -#endif
arch/cris/include/asm/spinlock.h deleted +0 -1
@@ -1 +0,0 @@ -#include <arch/spinlock.h>
arch/cris/include/asm/tlbflush.h +0 -7
@@ -22,16 +22,9 @@ extern void __flush_tlb_mm(struct mm_struct *mm);extern void __flush_tlb_page (struct vm_area_struct *vma,unsigned long addr); -#ifdef CONFIG_SMP -extern void flush_tlb_all (void ); -extern void flush_tlb_mm (struct mm_struct *mm); -extern void flush_tlb_page (struct vm_area_struct *vma, -unsigned long addr); -#else #define flush_tlb_all __flush_tlb_all#define flush_tlb_mm __flush_tlb_mm#define flush_tlb_page __flush_tlb_page -#endif static inline void flush_tlb_range (struct vm_area_struct * vma,unsigned long start,unsigned long end) {
Signature · 1 line
2.1.4
Re: [PATCH 2/6] CRIS: remove SMP code
Quoted 2 lines · Rabin Vincent
The CRIS SMP code cannot be built since there is no (and appears to never have been) a
CONFIG_SMPKconfigoption inarch/cris/. Remove it.
Yes, it appears there never was a Kconfig symbol SMP for cris so this probably was dead code ever since it was added in, I think, v2.6.13. (I should mention I didn't review this patch, or cris' apparently non-functional SMP code, in detail.)
Mind if I ask how you spotted this?
Paul Bolle
Re: [PATCH 2/6] CRIS: remove SMP code
There was a discussions about making a SMP CRIS once and the code actually ran on emulator. But I guess something went wrong during uppstreamimg. Anyway there is no real silicone so removing it is correct.
Quoted 16 lines
20 feb 2015 kl. 01:06 skrev "Paul Bolle" <[email protected]>:
Quoted 3 lines · Rabin Vincent
The CRIS SMP code cannot be built since there is no (and appears to never have been) a
CONFIG_SMPKconfigoption inarch/cris/. Remove it.Yes, it appears there never was a
Kconfigsymbol SMP for cris so this probably was dead code ever since it was added in, I think, v2.6.13. (I should mention I didn't review this patch, or cris' apparently non-functional SMP code, in detail.)Mind if I ask how you spotted this?
Paul Bolle
Re: [PATCH 2/6] CRIS: remove SMP code
In reply to Paul BolleQuoted 10 lines · Paul Bolle
Quoted 2 lines · Rabin Vincent
The CRIS SMP code cannot be built since there is no (and appears to never have been) a
CONFIG_SMPKconfigoption inarch/cris/. Remove it.Yes, it appears there never was a
Kconfigsymbol SMP for cris so this probably was dead code ever since it was added in, I think, v2.6.13. (I should mention I didn't review this patch, or cris' apparently non-functional SMP code, in detail.)Mind if I ask how you spotted this?
If you're asking if I used some kind of script, no, I didn't. I just noticed it while working on other CRIS patches.
Re: [PATCH 2/6] CRIS: remove SMP code
Quoted 10 lines · Rabin Vincent
Quoted 9 lines · Paul Bolle
Quoted 2 lines · Rabin Vincent
The CRIS SMP code cannot be built since there is no (and appears to never have been) a
CONFIG_SMPKconfigoption inarch/cris/. Remove it.Yes, it appears there never was a
Kconfigsymbol SMP for cris so this probably was dead code ever since it was added in, I think, v2.6.13. (I should mention I didn't review this patch, or cris' apparently non-functional SMP code, in detail.)
Quoted 4 lines
Quoted 1 line
Mind if I ask how you spotted this?
If you're asking if I used some kind of script, no, I didn't. I just noticed it while working on other CRIS patches.
Yes. See, I run a script locally. It is rather simple and only catches the more obvious kconfig related mistakes. I'm pretty sure I won't bother teaching it to spot mistakes like this one. But other people are working on a sophisticated bot that might be able to catch those.
But, anyhow, just paying attention when fiddling with a piece of code and spotting possible oddities is of course greatly appreciated!
Paul Bolle
Re: [PATCH 2/6] CRIS: remove SMP code
In reply to Rabin VincentQuoted 4 lines · Rabin Vincent
The CRIS SMP code cannot be built since there is no (and appears to never have been) a
CONFIG_SMPKconfigoption inarch/cris/. Remove it.Signed-off-by Rabin Vincent <[email protected]>
Nice, added to the queue for the CRIS-tree.
/^JN - Jesper Nilsson
Signature · 1 line
Jesper Nilsson -- [email protected]
PATCH 3/6 CRIS: use generic atomic bitops
In reply to Rabin VincentThe generic atomic bitops are the same as the CRIS-specific ones.
--- arch/cris/include/asm/bitops.h | 111 +---------------------------------------- 1 file changed, 1 insertion(+), 110 deletions(-)
arch/cris/include/asm/bitops.h +1 -110
@@ -19,119 +19,10 @@#endif #include <arch/bitops.h> -#include <linux/atomic.h> #include <linux/compiler.h> #include <asm/barrier.h> -/* -* set_bit - Atomically set a bit in memory -* @nr: the bit to set -* @addr: the address to start counting from -* -* This function is atomic and may not be reordered. See __set_bit() -* if you do not require the atomic guarantees. -* Note that @nr may be almost arbitrarily large; this function is not -* restricted to acting on a single-word quantity. -*/ - -#define set_bit (nr, addr) (void)test_and_set_bit(nr, addr) - -/* -* clear_bit - Clears a bit in memory -* @nr: Bit to clear -* @addr: Address to start counting from -* -* clear_bit() is atomic and may not be reordered. However, it does -* not contain a memory barrier, so if it is used for locking purposes, -* you should call smp_mb__before_atomic() and/or smp_mb__after_atomic() -* in order to ensure changes are visible on other processors. -*/ - -#define clear_bit (nr, addr) (void)test_and_clear_bit(nr, addr) - -/* -* change_bit - Toggle a bit in memory -* @nr: Bit to change -* @addr: Address to start counting from -* -* change_bit() is atomic and may not be reordered. -* Note that @nr may be almost arbitrarily large; this function is not -* restricted to acting on a single-word quantity. -*/ - -#define change_bit (nr, addr) (void)test_and_change_bit(nr, addr) - -/** -* test_and_set_bit - Set a bit and return its old value -* @nr: Bit to set -* @addr: Address to count from -* -* This operation is atomic and cannot be reordered. -* It also implies a memory barrier. -*/ - -static inline int test_and_set_bit (int nr,volatile unsigned long *addr) -{ -unsigned int mask, retval; -unsigned long flags; -unsigned int *adr = (unsigned int *)addr; - - adr += nr >>5 ; - mask =1 << (nr &0x1f ); -cris_atomic_save (addr, flags); - retval = (mask & *adr) !=0 ; - *adr |= mask; -cris_atomic_restore (addr, flags); -return retval; -} - -/** -* test_and_clear_bit - Clear a bit and return its old value -* @nr: Bit to clear -* @addr: Address to count from -* -* This operation is atomic and cannot be reordered. -* It also implies a memory barrier. -*/ - -static inline int test_and_clear_bit (int nr,volatile unsigned long *addr) -{ -unsigned int mask, retval; -unsigned long flags; -unsigned int *adr = (unsigned int *)addr; - - adr += nr >>5 ; - mask =1 << (nr &0x1f ); -cris_atomic_save (addr, flags); - retval = (mask & *adr) !=0 ; - *adr &= ~mask; -cris_atomic_restore (addr, flags); -return retval; -} - -/** -* test_and_change_bit - Change a bit and return its old value -* @nr: Bit to change -* @addr: Address to count from -* -* This operation is atomic and cannot be reordered. -* It also implies a memory barrier. -*/ - -static inline int test_and_change_bit (int nr,volatile unsigned long *addr) -{ -unsigned int mask, retval; -unsigned long flags; -unsigned int *adr = (unsigned int *)addr; - adr += nr >>5 ; - mask =1 << (nr &0x1f ); -cris_atomic_save (addr, flags); - retval = (mask & *adr) !=0 ; - *adr ^= mask; -cris_atomic_restore (addr, flags); -return retval; -} - +#include <asm-generic/bitops/atomic.h> #include <asm-generic/bitops/non-atomic.h> /*
Signature · 1 line
2.1.4
Re: [PATCH 3/6] CRIS: use generic atomic bitops
Quoted 3 lines · Rabin Vincent
The generic atomic bitops are the same as the CRIS-specific ones.
Signed-off-by Rabin Vincent <[email protected]>
Looks good, added to the CRIS-tree.
Thanks,
/^JN - Jesper Nilsson
Signature · 1 line
Jesper Nilsson -- [email protected]
PATCH 1/1 CRISv10: remove redundant macros from system.h
All of these are either unused or already provided by other headers, so they can be removed.
---
Should be applied before the patch which uses the generic atomic bitops to ensure that CRISv10 is bisectable.
arch/cris/include/arch-v10/arch/system.h | 8 -------- 1 file changed, 8 deletions(-)
arch/cris/include/arch-v10/arch/system.h +0 -8
@@ -36,12 +36,4 @@ static inline unsigned long _get_base(char * addr) return 0; } -#define nop () __asm__ __volatile__ ("nop"); - -#define xchg (ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) -#define tas (ptr) (xchg((ptr),1)) - -struct __xchg_dummy {unsigned long a[100 ]; }; -#define __xg (x) ((struct __xchg_dummy *)(x)) -#endif
Signature · 1 line
2.1.4
PATCH 4/6 CRIS: use generic atomic.h
In reply to Rabin VincentCRIS can use asm-generic's atomic.h.
--- arch/cris/include/arch-v10/arch/atomic.h | 7 -- arch/cris/include/arch-v32/arch/atomic.h | 8 -- arch/cris/include/asm/Kbuild | 2 +- arch/cris/include/asm/atomic.h | 149 ------------------------------- 4 files changed, 1 insertion(+), 165 deletions(-) delete mode 100644 arch/cris/include/arch-v10/arch/atomic.h delete mode 100644 arch/cris/include/arch-v32/arch/atomic.h delete mode 100644 arch/cris/include/asm/atomic.h
arch/cris/include/arch-v10/arch/atomic.h deleted +0 -7
@@ -1,7 +0,0 @@ -#ifndef __ASM_CRIS_ARCH_ATOMIC__ -#define __ASM_CRIS_ARCH_ATOMIC__ - -#define cris_atomic_save (addr, flags) local_irq_save(flags); -#define cris_atomic_restore (addr, flags) local_irq_restore(flags); - -#endif
arch/cris/include/arch-v32/arch/atomic.h deleted +0 -8
@@ -1,8 +0,0 @@ -#ifndef __ASM_CRIS_ARCH_ATOMIC__ -#define __ASM_CRIS_ARCH_ATOMIC__ - -#define cris_atomic_save (addr, flags) local_irq_save(flags); -#define cris_atomic_restore (addr, flags) local_irq_restore(flags); - -#endif -
arch/cris/include/asm/Kbuild +1 -1
@@ -1,4 +1,4 @@ - +generic-y += atomic.h generic-y += barrier.h generic-y += clkdev.h generic-y += cputime.h
arch/cris/include/asm/atomic.h deleted +0 -149
149 lines not on this page · raw message
Signature · 1 line
2.1.4
Re: [PATCH 4/6] CRIS: use generic atomic.h
Quoted 3 lines · Rabin Vincent
CRIS can use asm-generic's
atomic.h.Signed-off-by Rabin Vincent <[email protected]>
Agreed, added to the CRIS-tree.
/^JN - Jesper Nilsson
Signature · 1 line
Jesper Nilsson -- [email protected]
PATCH 5/6 CRIS: use generic cmpxchg.h
In reply to Rabin VincentCRIS can use asm-generic's cmpxchg.h
--- arch/cris/include/asm/Kbuild | 1 + arch/cris/include/asm/cmpxchg.h | 51 ----------------------------------------- 2 files changed, 1 insertion(+), 51 deletions(-) delete mode 100644 arch/cris/include/asm/cmpxchg.h
arch/cris/include/asm/Kbuild +1 -0
@@ -1,6 +1,7 @@ generic-y += atomic.h generic-y += barrier.h generic-y += clkdev.h +generic-y += cmpxchg.h generic-y += cputime.h generic-y += exec.h generic-y += irq_work.h
arch/cris/include/asm/cmpxchg.h deleted +0 -51
51 lines not on this page · raw message
Signature · 1 line
2.1.4
Re: [PATCH 5/6] CRIS: use generic cmpxchg.h
Quoted 3 lines · Rabin Vincent
CRIS can use asm-generic's
cmpxchg.hSigned-off-by Rabin Vincent <[email protected]>
Looks good, adding to the CRIS-tree.
Thanks!
/^JN - Jesper Nilsson
Signature · 1 line
Jesper Nilsson -- [email protected]
PATCH 6/6 CRIS: use generic headers via Kbuild
In reply to Rabin VincentDelete headers which do nothing but include the asm-generic versions and use Kbuild magic instead.
--- arch/cris/include/asm/Kbuild | 12 ++++++++++++ arch/cris/include/asm/device.h | 7 ------- arch/cris/include/asm/div64.h | 1 - arch/cris/include/asm/emergency-restart.h | 6 ------ arch/cris/include/asm/futex.h | 6 ------ arch/cris/include/asm/hardirq.h | 7 ------- arch/cris/include/asm/irq_regs.h | 1 - arch/cris/include/asm/kdebug.h | 1 - arch/cris/include/asm/kmap_types.h | 10 ---------- arch/cris/include/asm/local.h | 1 - arch/cris/include/asm/local64.h | 1 - arch/cris/include/asm/percpu.h | 6 ------ arch/cris/include/asm/topology.h | 6 ------ 13 files changed, 12 insertions(+), 53 deletions(-) delete mode 100644 arch/cris/include/asm/device.h delete mode 100644 arch/cris/include/asm/div64.h delete mode 100644 arch/cris/include/asm/emergency-restart.h delete mode 100644 arch/cris/include/asm/futex.h delete mode 100644 arch/cris/include/asm/hardirq.h delete mode 100644 arch/cris/include/asm/irq_regs.h delete mode 100644 arch/cris/include/asm/kdebug.h delete mode 100644 arch/cris/include/asm/kmap_types.h delete mode 100644 arch/cris/include/asm/local.h delete mode 100644 arch/cris/include/asm/local64.h delete mode 100644 arch/cris/include/asm/percpu.h delete mode 100644 arch/cris/include/asm/topology.h
arch/cris/include/asm/Kbuild +12 -0
@@ -3,15 +3,27 @@ generic-y += barrier.h generic-y += clkdev.h generic-y += cmpxchg.h generic-y += cputime.h +generic-y += device.h +generic-y += div64.h generic-y += exec.h +generic-y += emergency-restart.h +generic-y += futex.h +generic-y += hardirq.h +generic-y += irq_regs.h generic-y += irq_work.h +generic-y += kdebug.h +generic-y += kmap_types.h generic-y += kvm_para.h generic-y += linkage.h +generic-y += local.h +generic-y += local64.h generic-y += mcs_spinlock.h generic-y += module.h +generic-y += percpu.h generic-y += preempt.h generic-y += scatterlist.h generic-y += sections.h +generic-y += topology.h generic-y += trace_clock.h generic-y += vga.h generic-y += xor.h
arch/cris/include/asm/device.h deleted +0 -7
@@ -1,7 +0,0 @@ -/* -* Arch specific extensions to struct device -* -* This file is released under the GPLv2 -*/ -#include <asm-generic/device.h> -
arch/cris/include/asm/div64.h deleted +0 -1
@@ -1 +0,0 @@ -#include <asm-generic/div64.h>
arch/cris/include/asm/emergency-restart.h deleted +0 -6
@@ -1,6 +0,0 @@ -#ifndef _ASM_EMERGENCY_RESTART_H -#define _ASM_EMERGENCY_RESTART_H - -#include <asm-generic/emergency-restart.h> - -#endif /* _ASM_EMERGENCY_RESTART_H */
arch/cris/include/asm/futex.h deleted +0 -6
@@ -1,6 +0,0 @@ -#ifndef _ASM_FUTEX_H -#define _ASM_FUTEX_H - -#include <asm-generic/futex.h> - -#endif
arch/cris/include/asm/hardirq.h deleted +0 -7
@@ -1,7 +0,0 @@ -#ifndef __ASM_HARDIRQ_H -#define __ASM_HARDIRQ_H - -#include <asm/irq.h> -#include <asm-generic/hardirq.h> - -#endif /* __ASM_HARDIRQ_H */
arch/cris/include/asm/irq_regs.h deleted +0 -1
@@ -1 +0,0 @@ -#include <asm-generic/irq_regs.h>
arch/cris/include/asm/kdebug.h deleted +0 -1
@@ -1 +0,0 @@ -#include <asm-generic/kdebug.h>
arch/cris/include/asm/kmap_types.h deleted +0 -10
@@ -1,10 +0,0 @@ -#ifndef _ASM_KMAP_TYPES_H -#define _ASM_KMAP_TYPES_H - -/* Dummy header just to define km_type. None of this -* is actually used on cris. -*/ - -#include <asm-generic/kmap_types.h> - -#endif
arch/cris/include/asm/local.h deleted +0 -1
@@ -1 +0,0 @@ -#include <asm-generic/local.h>
arch/cris/include/asm/local64.h deleted +0 -1
@@ -1 +0,0 @@ -#include <asm-generic/local64.h>
arch/cris/include/asm/percpu.h deleted +0 -6
@@ -1,6 +0,0 @@ -#ifndef _CRIS_PERCPU_H -#define _CRIS_PERCPU_H - -#include <asm-generic/percpu.h> - -#endif /* _CRIS_PERCPU_H */
arch/cris/include/asm/topology.h deleted +0 -6
@@ -1,6 +0,0 @@ -#ifndef _ASM_CRIS_TOPOLOGY_H -#define _ASM_CRIS_TOPOLOGY_H - -#include <asm-generic/topology.h> - -#endif /* _ASM_CRIS_TOPOLOGY_H */
Signature · 1 line
2.1.4
Re: [PATCH 6/6] CRIS: use generic headers via Kbuild
Quoted 4 lines · Rabin Vincent
Delete headers which do nothing but include the asm-generic versions and use
Kbuildmagic instead.Signed-off-by Rabin Vincent <[email protected]>
Nice! Added to the CRIS-tree.
/^JN - Jesper Nilsson
Signature · 1 line
Jesper Nilsson -- [email protected]
Quoted 29 lines · Rabin Vincent
INIT_THREADenables interrupts in the thread_struct's saved flags. This means that interrupts get enabled in the middle ofcontext_switch()while switching to new tasks that get forked off the init task during boot. Don't do this.Fixes the following splat on boot with spinlock debugging on:
BUG: spinlock cpu recursion on CPU#0, swapper/2 lock: runqueues+0x0/0x47c, .magic: dead4ead, .owner: swapper/0, .owner_cpu: 0 CPU: 0 PID: 2 Comm: swapper Not tainted 3.19.0-08796-ga747b55 #285 Call Trace: [<c0032b80>] spin_bug+0x2a/0x36 [<c0032c98>] do_raw_spin_lock+0xa2/0x126 [<c01964b0>] _raw_spin_lock+0x20/0x2a [<c00286c8>] scheduler_tick+0x22/0x76 [<c003db2c>] update_process_times+0x5e/0x72 [<c0007a94>] timer_interrupt+0x4e/0x6a [<c00378d6>] handle_irq_event_percpu+0x54/0xf2 [<c00379c4>] handle_irq_event+0x50/0x74 [<c003988e>] handle_simple_irq+0x6c/0xbe [<c0037270>] generic_handle_irq+0x2a/0x36 [<c0004c40>] do_IRQ+0x38/0x84 [<c000662e>] crisv32_do_IRQ+0x54/0x60 [<c0006204>] IRQ0x4b_interrupt+0x34/0x3c [<c0192baa>] __schedule+0x24a/0x532 [<c00056b4>] ret_from_kernel_thread+0x0/0x14
Quoted 1 line
Signed-off-by Rabin Vincent <[email protected]>
Looks good, adding to the CRIS-tree.
/^JN - Jesper Nilsson
Signature · 1 line
Jesper Nilsson -- [email protected]