[patch 2/6 -rt] powerpc 2.6.20-rt8: to convert spinlocks to raw ones.

Tsutomu OWA
2007-03-07T01:38:21Z

To convert the spinlocks into the raw onces to fix the following warnings/errors.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Badness at arch/powerpc/kernel/entry_64.S:651
Call Trace:
[C0000000006133E0] [C00000000000FAAC] show_stack+0x68/0x1b0 (unreliable)
[C000000000613480] [C0000000001EF004] .repor000001EF004] .report_bug+0x94/0xe8
[C000000000613510] [C0000000003EAD58] .program_check_exception+0x170/0x5a8
[C00000000000487C] program_check_common+0xfc/0x100
--- Exception: 700 at .exception: 700 at .enter_rtas+0xa0/0x10c
LR = .rtas_call+0x144/0x1e8
[C0000000006138D0] [C000000000613980] 0xc000000000613980 (unreliabl0064a0d8 (unreliable)
[C000000000613AB0] [C00000000001DFA8] .rtas_call+0x144/0x1etas_call+0x144/0x1e8
:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
BUG: scheduling with irqs disabled: ash/0x00000000/462
caller is .rt_spin_lock_slowlock+0x14c/0x234
Call Trace:
[C00000001FE87580] [C00000000000FAAC] .show_stack+0x68/0x1b0 (unreliable)
[C00000001FE87620] [C0000000003E796C] .schedule+0x78/0x128
[C00000001FE876A0] [C0000000003E9378] .rt_spin_lock_slowlock+0x14c/0x234
[C00000001FE877B0] [C00000000002E3C4] .native_hpte_updatepp+0x158/0x274
[C00000001FE87850] [C00000000002C374] .htab_call_hpte_updatepp+0x4/0x18
[C00000001FE87950] [C00000000002BC74] .hash_preload+0x150/0x198
[C00000001FE87A00] [C00000000002A9E8] .update_mmu_cache+0x13c/0x1a4
[C00000001FE87A90] [C0000000000B28A0] .do_wp_page+0x7d0/0x888
[C00000001FE87B60] [C0000000000B4CB8] .__handle_mm_fault+0xee4/0x1004
[C00000001FE87C50] [C0000000003EC288] .do_page_fault+0x474/0x65c
[C00000001FE87E30] [C000000000004CFC] handle_page_fault+0x20/0x58
:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Signed-off-by: Tsutomu Owa <tsutomu.owa@toshiba.co.jp>
-- owa

diff -rup linux-rt8/include/asm-powerpc/rtas.h rt/include/asm-powerpc/rtas.h
--- linux-rt8/include/asm-powerpc/rtas.h 2007-02-20 09:37:27.000000000 +0900
+++ rt/include/asm-powerpc/rtas.h 2007-03-05 11:49:41.000000000 +0900
@@ -58,7 +58,7 @@ struct rtas_t {
unsigned long entry; /* physical address pointer */
unsigned long base; /* physical address pointer */
unsigned long size;
- spinlock_t lock;
+ raw_spinlock_t lock;
struct rtas_args args;
struct device_node *dev; /* virtual address pointer */
};
diff -rup linux-rt8/arch/powerpc/kernel/rtas.c rt/arch/powerpc/kernel/rtas.c
--- linux-rt8/arch/powerpc/kernel/rtas.c 2007-02-20 09:38:52.000000000 +0900
+++ rt/arch/powerpc/kernel/rtas.c 2007-03-05 11:50:58.000000000 +0900
@@ -36,7 +36,7 @@
#include <asm/syscalls.h>

struct rtas_t rtas = {
- .lock = SPIN_LOCK_UNLOCKED
+ .lock = RAW_SPIN_LOCK_UNLOCKED(lock)
};
EXPORT_SYMBOL(rtas);

diff -rup linux-rt8/arch/powerpc/mm/hash_native_64.c rt/arch/powerpc/mm/hash_native_64.c
--- linux-rt8/arch/powerpc/mm/hash_native_64.c 2007-02-20 09:38:58.000000000 +0900
+++ rt/arch/powerpc/mm/hash_native_64.c 2007-03-05 15:40:12.000000000 +0900
@@ -35,7 +35,7 @@

#define HPTE_LOCK_BIT 3

-static DEFINE_SPINLOCK(native_tlbie_lock);
+static DEFINE_RAW_SPINLOCK(native_tlbie_lock);

static inline void __tlbie(unsigned long va, unsigned int psize)
{
--- linux-rt8/arch/powerpc/kernel/irq.c 2007-02-20 14:30:38.000000000 +0900
+++ rt/arch/powerpc/kernel/irq.c 2007-03-05 18:54:34.000000000 +0900
@@ -392,7 +392,7 @@ EXPORT_SYMBOL(do_softirq);
#ifdef CONFIG_PPC_MERGE

static LIST_HEAD(irq_hosts);
-static spinlock_t irq_big_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_RAW_SPINLOCK(irq_big_lock);
static DEFINE_PER_CPU(unsigned int, irq_radix_reader);
static unsigned int irq_radix_writer;
struct irq_map_entry irq_map[NR_IRQS];