Commit 9b91e15b authored by David S. Miller's avatar David S. Miller

Merge bk://bk.phunnypharm.org/sparc-2.6

into nuts.davemloft.net:/disk1/BK/sparc-2.6
parents 61e7d4eb d6c90be1
...@@ -1104,8 +1104,9 @@ void init_irqwork_curcpu(void) ...@@ -1104,8 +1104,9 @@ void init_irqwork_curcpu(void)
{ {
register struct irq_work_struct *workp asm("o2"); register struct irq_work_struct *workp asm("o2");
unsigned long tmp; unsigned long tmp;
int cpu = hard_smp_processor_id();
memset(__irq_work + smp_processor_id(), 0, sizeof(*workp)); memset(__irq_work + cpu, 0, sizeof(*workp));
/* Make sure we are called with PSTATE_IE disabled. */ /* Make sure we are called with PSTATE_IE disabled. */
__asm__ __volatile__("rdpr %%pstate, %0\n\t" __asm__ __volatile__("rdpr %%pstate, %0\n\t"
...@@ -1120,7 +1121,7 @@ void init_irqwork_curcpu(void) ...@@ -1120,7 +1121,7 @@ void init_irqwork_curcpu(void)
} }
/* Set interrupt globals. */ /* Set interrupt globals. */
workp = &__irq_work[smp_processor_id()]; workp = &__irq_work[cpu];
__asm__ __volatile__( __asm__ __volatile__(
"rdpr %%pstate, %0\n\t" "rdpr %%pstate, %0\n\t"
"wrpr %0, %1, %%pstate\n\t" "wrpr %0, %1, %%pstate\n\t"
......
...@@ -35,14 +35,17 @@ static inline void show_read (char *str, rwlock_t *lock, unsigned long caller) ...@@ -35,14 +35,17 @@ static inline void show_read (char *str, rwlock_t *lock, unsigned long caller)
static inline void show_write (char *str, rwlock_t *lock, unsigned long caller) static inline void show_write (char *str, rwlock_t *lock, unsigned long caller)
{ {
int cpu = smp_processor_id(); int cpu = smp_processor_id();
int i;
printk("%s(%p) CPU#%d stuck at %08x\n", printk("%s(%p) CPU#%d stuck at %08x\n",
str, lock, cpu, (unsigned int) caller); str, lock, cpu, (unsigned int) caller);
printk("Writer: PC(%08x):CPU(%x)\n", printk("Writer: PC(%08x):CPU(%x)\n",
lock->writer_pc, lock->writer_cpu); lock->writer_pc, lock->writer_cpu);
printk("Readers: 0[%08x] 1[%08x] 2[%08x] 4[%08x]\n", printk("Readers:");
lock->reader_pc[0], lock->reader_pc[1], for (i = 0; i < NR_CPUS; i++)
lock->reader_pc[2], lock->reader_pc[3]); if (lock->reader_pc[i])
printk(" %d[%08x]", i, lock->reader_pc[i]);
printk("\n");
} }
#undef INIT_STUCK #undef INIT_STUCK
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#define __SPARC64_SPINLOCK_H #define __SPARC64_SPINLOCK_H
#include <linux/config.h> #include <linux/config.h>
#include <linux/threads.h> /* For NR_CPUS */
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
...@@ -131,7 +132,7 @@ extern int __write_trylock(rwlock_t *); ...@@ -131,7 +132,7 @@ extern int __write_trylock(rwlock_t *);
typedef struct { typedef struct {
unsigned long lock; unsigned long lock;
unsigned int writer_pc, writer_cpu; unsigned int writer_pc, writer_cpu;
unsigned int reader_pc[4]; unsigned int reader_pc[NR_CPUS];
} rwlock_t; } rwlock_t;
#define RW_LOCK_UNLOCKED (rwlock_t) { 0, 0, 0xff, { 0, 0, 0, 0 } } #define RW_LOCK_UNLOCKED (rwlock_t) { 0, 0, 0xff, { 0, 0, 0, 0 } }
#define rwlock_init(lp) do { *(lp) = RW_LOCK_UNLOCKED; } while(0) #define rwlock_init(lp) do { *(lp) = RW_LOCK_UNLOCKED; } while(0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment