Skip to content

Commit adb3b1f

Browse files
committed
Merge tag 'parisc-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/parisc-2.6
Pull PARISC misc updates from James Bottomley: "This is a couple of minor updates (fixing lws futex locking and removing some obsolete cpu_*_map calls)." * tag 'parisc-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/parisc-2.6: [PARISC] remove references to cpu_*_map. [PARISC] futex: Use same lock set as lws calls
2 parents a75ee6e + 7ec6118 commit adb3b1f

File tree

2 files changed

+28
-6
lines changed

2 files changed

+28
-6
lines changed

arch/parisc/include/asm/futex.h

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,29 @@
88
#include <asm/atomic.h>
99
#include <asm/errno.h>
1010

11+
/* The following has to match the LWS code in syscall.S. We have
12+
sixteen four-word locks. */
13+
14+
static inline void
15+
_futex_spin_lock_irqsave(u32 __user *uaddr, unsigned long int *flags)
16+
{
17+
extern u32 lws_lock_start[];
18+
long index = ((long)uaddr & 0xf0) >> 2;
19+
arch_spinlock_t *s = (arch_spinlock_t *)&lws_lock_start[index];
20+
local_irq_save(*flags);
21+
arch_spin_lock(s);
22+
}
23+
24+
static inline void
25+
_futex_spin_unlock_irqrestore(u32 __user *uaddr, unsigned long int *flags)
26+
{
27+
extern u32 lws_lock_start[];
28+
long index = ((long)uaddr & 0xf0) >> 2;
29+
arch_spinlock_t *s = (arch_spinlock_t *)&lws_lock_start[index];
30+
arch_spin_unlock(s);
31+
local_irq_restore(*flags);
32+
}
33+
1134
static inline int
1235
futex_atomic_op_inuser (int encoded_op, u32 __user *uaddr)
1336
{
@@ -26,7 +49,7 @@ futex_atomic_op_inuser (int encoded_op, u32 __user *uaddr)
2649

2750
pagefault_disable();
2851

29-
_atomic_spin_lock_irqsave(uaddr, flags);
52+
_futex_spin_lock_irqsave(uaddr, &flags);
3053

3154
switch (op) {
3255
case FUTEX_OP_SET:
@@ -71,7 +94,7 @@ futex_atomic_op_inuser (int encoded_op, u32 __user *uaddr)
7194
ret = -ENOSYS;
7295
}
7396

74-
_atomic_spin_unlock_irqrestore(uaddr, flags);
97+
_futex_spin_unlock_irqrestore(uaddr, &flags);
7598

7699
pagefault_enable();
77100

@@ -113,7 +136,7 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
113136
* address. This should scale to a couple of CPUs.
114137
*/
115138

116-
_atomic_spin_lock_irqsave(uaddr, flags);
139+
_futex_spin_lock_irqsave(uaddr, &flags);
117140

118141
ret = get_user(val, uaddr);
119142

@@ -122,7 +145,7 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
122145

123146
*uval = val;
124147

125-
_atomic_spin_unlock_irqrestore(uaddr, flags);
148+
_futex_spin_unlock_irqrestore(uaddr, &flags);
126149

127150
return ret;
128151
}

arch/parisc/kernel/smp.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,7 @@ smp_cpu_init(int cpunum)
290290
mb();
291291

292292
/* Well, support 2.4 linux scheme as well. */
293-
if (cpu_isset(cpunum, cpu_online_map))
294-
{
293+
if (cpu_online(cpunum)) {
295294
extern void machine_halt(void); /* arch/parisc.../process.c */
296295

297296
printk(KERN_CRIT "CPU#%d already initialized!\n", cpunum);

0 commit comments

Comments
 (0)