Skip to content

Commit 3cfef95

Browse files
committed
Merge branch 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
* 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (27 commits) rtmutex: Add missing rcu_read_unlock() in debug_rt_mutex_print_deadlock() lockdep: Comment all warnings lib: atomic64: Change the type of local lock to raw_spinlock_t locking, lib/atomic64: Annotate atomic64_lock::lock as raw locking, x86, iommu: Annotate qi->q_lock as raw locking, x86, iommu: Annotate irq_2_ir_lock as raw locking, x86, iommu: Annotate iommu->register_lock as raw locking, dma, ipu: Annotate bank_lock as raw locking, ARM: Annotate low level hw locks as raw locking, drivers/dca: Annotate dca_lock as raw locking, powerpc: Annotate uic->lock as raw locking, x86: mce: Annotate cmci_discover_lock as raw locking, ACPI: Annotate c3_lock as raw locking, oprofile: Annotate oprofilefs lock as raw locking, video: Annotate vga console lock as raw locking, latencytop: Annotate latency_lock as raw locking, timer_stats: Annotate table_lock as raw locking, rwsem: Annotate inner lock as raw locking, semaphores: Annotate inner lock as raw locking, sched: Annotate thread_group_cputimer as raw ... Fix up conflicts in kernel/posix-cpu-timers.c manually: making cputimer->cputime a raw lock conflicted with the ABBA fix in commit bcd5cff ("cputimer: Cure lock inversion").
2 parents 9826530 + 68cc399 commit 3cfef95

61 files changed

Lines changed: 670 additions & 573 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎arch/arm/common/gic.c‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#include <asm/mach/irq.h>
3434
#include <asm/hardware/gic.h>
3535

36-
static DEFINE_SPINLOCK(irq_controller_lock);
36+
static DEFINE_RAW_SPINLOCK(irq_controller_lock);
3737

3838
/* Address of GIC 0 CPU interface */
3939
void __iomem *gic_cpu_base_addr __read_mostly;
@@ -82,30 +82,30 @@ static void gic_mask_irq(struct irq_data *d)
8282
{
8383
u32 mask = 1 << (d->irq % 32);
8484

85-
spin_lock(&irq_controller_lock);
85+
raw_spin_lock(&irq_controller_lock);
8686
writel_relaxed(mask, gic_dist_base(d) + GIC_DIST_ENABLE_CLEAR + (gic_irq(d) / 32) * 4);
8787
if (gic_arch_extn.irq_mask)
8888
gic_arch_extn.irq_mask(d);
89-
spin_unlock(&irq_controller_lock);
89+
raw_spin_unlock(&irq_controller_lock);
9090
}
9191

9292
static void gic_unmask_irq(struct irq_data *d)
9393
{
9494
u32 mask = 1 << (d->irq % 32);
9595

96-
spin_lock(&irq_controller_lock);
96+
raw_spin_lock(&irq_controller_lock);
9797
if (gic_arch_extn.irq_unmask)
9898
gic_arch_extn.irq_unmask(d);
9999
writel_relaxed(mask, gic_dist_base(d) + GIC_DIST_ENABLE_SET + (gic_irq(d) / 32) * 4);
100-
spin_unlock(&irq_controller_lock);
100+
raw_spin_unlock(&irq_controller_lock);
101101
}
102102

103103
static void gic_eoi_irq(struct irq_data *d)
104104
{
105105
if (gic_arch_extn.irq_eoi) {
106-
spin_lock(&irq_controller_lock);
106+
raw_spin_lock(&irq_controller_lock);
107107
gic_arch_extn.irq_eoi(d);
108-
spin_unlock(&irq_controller_lock);
108+
raw_spin_unlock(&irq_controller_lock);
109109
}
110110

111111
writel_relaxed(gic_irq(d), gic_cpu_base(d) + GIC_CPU_EOI);
@@ -129,7 +129,7 @@ static int gic_set_type(struct irq_data *d, unsigned int type)
129129
if (type != IRQ_TYPE_LEVEL_HIGH && type != IRQ_TYPE_EDGE_RISING)
130130
return -EINVAL;
131131

132-
spin_lock(&irq_controller_lock);
132+
raw_spin_lock(&irq_controller_lock);
133133

134134
if (gic_arch_extn.irq_set_type)
135135
gic_arch_extn.irq_set_type(d, type);
@@ -154,7 +154,7 @@ static int gic_set_type(struct irq_data *d, unsigned int type)
154154
if (enabled)
155155
writel_relaxed(enablemask, base + GIC_DIST_ENABLE_SET + enableoff);
156156

157-
spin_unlock(&irq_controller_lock);
157+
raw_spin_unlock(&irq_controller_lock);
158158

159159
return 0;
160160
}
@@ -182,10 +182,10 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val,
182182
mask = 0xff << shift;
183183
bit = 1 << (cpu_logical_map(cpu) + shift);
184184

185-
spin_lock(&irq_controller_lock);
185+
raw_spin_lock(&irq_controller_lock);
186186
val = readl_relaxed(reg) & ~mask;
187187
writel_relaxed(val | bit, reg);
188-
spin_unlock(&irq_controller_lock);
188+
raw_spin_unlock(&irq_controller_lock);
189189

190190
return IRQ_SET_MASK_OK;
191191
}
@@ -215,9 +215,9 @@ static void gic_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)
215215

216216
chained_irq_enter(chip, desc);
217217

218-
spin_lock(&irq_controller_lock);
218+
raw_spin_lock(&irq_controller_lock);
219219
status = readl_relaxed(chip_data->cpu_base + GIC_CPU_INTACK);
220-
spin_unlock(&irq_controller_lock);
220+
raw_spin_unlock(&irq_controller_lock);
221221

222222
gic_irq = (status & 0x3ff);
223223
if (gic_irq == 1023)

‎arch/arm/include/asm/dma.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@
3434
#define DMA_MODE_CASCADE 0xc0
3535
#define DMA_AUTOINIT 0x10
3636

37-
extern spinlock_t dma_spin_lock;
37+
extern raw_spinlock_t dma_spin_lock;
3838

3939
static inline unsigned long claim_dma_lock(void)
4040
{
4141
unsigned long flags;
42-
spin_lock_irqsave(&dma_spin_lock, flags);
42+
raw_spin_lock_irqsave(&dma_spin_lock, flags);
4343
return flags;
4444
}
4545

4646
static inline void release_dma_lock(unsigned long flags)
4747
{
48-
spin_unlock_irqrestore(&dma_spin_lock, flags);
48+
raw_spin_unlock_irqrestore(&dma_spin_lock, flags);
4949
}
5050

5151
/* Clear the 'DMA Pointer Flip Flop'.

‎arch/arm/include/asm/mmu.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
typedef struct {
77
#ifdef CONFIG_CPU_HAS_ASID
88
unsigned int id;
9-
spinlock_t id_lock;
9+
raw_spinlock_t id_lock;
1010
#endif
1111
unsigned int kvm_seq;
1212
} mm_context_t;
@@ -16,7 +16,7 @@ typedef struct {
1616

1717
/* init_mm.context.id_lock should be initialized. */
1818
#define INIT_MM_CONTEXT(name) \
19-
.context.id_lock = __SPIN_LOCK_UNLOCKED(name.context.id_lock),
19+
.context.id_lock = __RAW_SPIN_LOCK_UNLOCKED(name.context.id_lock),
2020
#else
2121
#define ASID(mm) (0)
2222
#endif

‎arch/arm/kernel/dma.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
#include <asm/mach/dma.h>
2525

26-
DEFINE_SPINLOCK(dma_spin_lock);
26+
DEFINE_RAW_SPINLOCK(dma_spin_lock);
2727
EXPORT_SYMBOL(dma_spin_lock);
2828

2929
static dma_t *dma_chan[MAX_DMA_CHANNELS];

‎arch/arm/kernel/smp.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ static void percpu_timer_stop(void)
566566
}
567567
#endif
568568

569-
static DEFINE_SPINLOCK(stop_lock);
569+
static DEFINE_RAW_SPINLOCK(stop_lock);
570570

571571
/*
572572
* ipi_cpu_stop - handle IPI from smp_send_stop()
@@ -575,10 +575,10 @@ static void ipi_cpu_stop(unsigned int cpu)
575575
{
576576
if (system_state == SYSTEM_BOOTING ||
577577
system_state == SYSTEM_RUNNING) {
578-
spin_lock(&stop_lock);
578+
raw_spin_lock(&stop_lock);
579579
printk(KERN_CRIT "CPU%u: stopping\n", cpu);
580580
dump_stack();
581-
spin_unlock(&stop_lock);
581+
raw_spin_unlock(&stop_lock);
582582
}
583583

584584
set_cpu_online(cpu, false);

‎arch/arm/kernel/traps.c‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ static int __die(const char *str, int err, struct thread_info *thread, struct pt
257257
return ret;
258258
}
259259

260-
static DEFINE_SPINLOCK(die_lock);
260+
static DEFINE_RAW_SPINLOCK(die_lock);
261261

262262
/*
263263
* This function is protected against re-entrancy.
@@ -269,7 +269,7 @@ void die(const char *str, struct pt_regs *regs, int err)
269269

270270
oops_enter();
271271

272-
spin_lock_irq(&die_lock);
272+
raw_spin_lock_irq(&die_lock);
273273
console_verbose();
274274
bust_spinlocks(1);
275275
if (!user_mode(regs))
@@ -281,7 +281,7 @@ void die(const char *str, struct pt_regs *regs, int err)
281281

282282
bust_spinlocks(0);
283283
add_taint(TAINT_DIE);
284-
spin_unlock_irq(&die_lock);
284+
raw_spin_unlock_irq(&die_lock);
285285
oops_exit();
286286

287287
if (in_interrupt())
@@ -324,24 +324,24 @@ int is_valid_bugaddr(unsigned long pc)
324324
#endif
325325

326326
static LIST_HEAD(undef_hook);
327-
static DEFINE_SPINLOCK(undef_lock);
327+
static DEFINE_RAW_SPINLOCK(undef_lock);
328328

329329
void register_undef_hook(struct undef_hook *hook)
330330
{
331331
unsigned long flags;
332332

333-
spin_lock_irqsave(&undef_lock, flags);
333+
raw_spin_lock_irqsave(&undef_lock, flags);
334334
list_add(&hook->node, &undef_hook);
335-
spin_unlock_irqrestore(&undef_lock, flags);
335+
raw_spin_unlock_irqrestore(&undef_lock, flags);
336336
}
337337

338338
void unregister_undef_hook(struct undef_hook *hook)
339339
{
340340
unsigned long flags;
341341

342-
spin_lock_irqsave(&undef_lock, flags);
342+
raw_spin_lock_irqsave(&undef_lock, flags);
343343
list_del(&hook->node);
344-
spin_unlock_irqrestore(&undef_lock, flags);
344+
raw_spin_unlock_irqrestore(&undef_lock, flags);
345345
}
346346

347347
static int call_undef_hook(struct pt_regs *regs, unsigned int instr)
@@ -350,12 +350,12 @@ static int call_undef_hook(struct pt_regs *regs, unsigned int instr)
350350
unsigned long flags;
351351
int (*fn)(struct pt_regs *regs, unsigned int instr) = NULL;
352352

353-
spin_lock_irqsave(&undef_lock, flags);
353+
raw_spin_lock_irqsave(&undef_lock, flags);
354354
list_for_each_entry(hook, &undef_hook, node)
355355
if ((instr & hook->instr_mask) == hook->instr_val &&
356356
(regs->ARM_cpsr & hook->cpsr_mask) == hook->cpsr_val)
357357
fn = hook->fn;
358-
spin_unlock_irqrestore(&undef_lock, flags);
358+
raw_spin_unlock_irqrestore(&undef_lock, flags);
359359

360360
return fn ? fn(regs, instr) : 1;
361361
}

‎arch/arm/mach-footbridge/include/mach/hardware.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
#define CPLD_FLASH_WR_ENABLE 1
9494

9595
#ifndef __ASSEMBLY__
96-
extern spinlock_t nw_gpio_lock;
96+
extern raw_spinlock_t nw_gpio_lock;
9797
extern void nw_gpio_modify_op(unsigned int mask, unsigned int set);
9898
extern void nw_gpio_modify_io(unsigned int mask, unsigned int in);
9999
extern unsigned int nw_gpio_read(void);

‎arch/arm/mach-footbridge/netwinder-hw.c‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ static inline void wb977_ww(int reg, int val)
6868
/*
6969
* This is a lock for accessing ports GP1_IO_BASE and GP2_IO_BASE
7070
*/
71-
DEFINE_SPINLOCK(nw_gpio_lock);
71+
DEFINE_RAW_SPINLOCK(nw_gpio_lock);
7272
EXPORT_SYMBOL(nw_gpio_lock);
7373

7474
static unsigned int current_gpio_op;
@@ -327,9 +327,9 @@ static inline void wb977_init_gpio(void)
327327
/*
328328
* Set Group1/Group2 outputs
329329
*/
330-
spin_lock_irqsave(&nw_gpio_lock, flags);
330+
raw_spin_lock_irqsave(&nw_gpio_lock, flags);
331331
nw_gpio_modify_op(-1, GPIO_RED_LED | GPIO_FAN);
332-
spin_unlock_irqrestore(&nw_gpio_lock, flags);
332+
raw_spin_unlock_irqrestore(&nw_gpio_lock, flags);
333333
}
334334

335335
/*
@@ -390,9 +390,9 @@ static void __init cpld_init(void)
390390
{
391391
unsigned long flags;
392392

393-
spin_lock_irqsave(&nw_gpio_lock, flags);
393+
raw_spin_lock_irqsave(&nw_gpio_lock, flags);
394394
nw_cpld_modify(-1, CPLD_UNMUTE | CPLD_7111_DISABLE);
395-
spin_unlock_irqrestore(&nw_gpio_lock, flags);
395+
raw_spin_unlock_irqrestore(&nw_gpio_lock, flags);
396396
}
397397

398398
static unsigned char rwa_unlock[] __initdata =
@@ -616,9 +616,9 @@ static int __init nw_hw_init(void)
616616
cpld_init();
617617
rwa010_init();
618618

619-
spin_lock_irqsave(&nw_gpio_lock, flags);
619+
raw_spin_lock_irqsave(&nw_gpio_lock, flags);
620620
nw_gpio_modify_op(GPIO_RED_LED|GPIO_GREEN_LED, DEFAULT_LEDS);
621-
spin_unlock_irqrestore(&nw_gpio_lock, flags);
621+
raw_spin_unlock_irqrestore(&nw_gpio_lock, flags);
622622
}
623623
return 0;
624624
}

‎arch/arm/mach-footbridge/netwinder-leds.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@
3131
static char led_state;
3232
static char hw_led_state;
3333

34-
static DEFINE_SPINLOCK(leds_lock);
34+
static DEFINE_RAW_SPINLOCK(leds_lock);
3535

3636
static void netwinder_leds_event(led_event_t evt)
3737
{
3838
unsigned long flags;
3939

40-
spin_lock_irqsave(&leds_lock, flags);
40+
raw_spin_lock_irqsave(&leds_lock, flags);
4141

4242
switch (evt) {
4343
case led_start:
@@ -117,12 +117,12 @@ static void netwinder_leds_event(led_event_t evt)
117117
break;
118118
}
119119

120-
spin_unlock_irqrestore(&leds_lock, flags);
120+
raw_spin_unlock_irqrestore(&leds_lock, flags);
121121

122122
if (led_state & LED_STATE_ENABLED) {
123-
spin_lock_irqsave(&nw_gpio_lock, flags);
123+
raw_spin_lock_irqsave(&nw_gpio_lock, flags);
124124
nw_gpio_modify_op(GPIO_RED_LED | GPIO_GREEN_LED, hw_led_state);
125-
spin_unlock_irqrestore(&nw_gpio_lock, flags);
125+
raw_spin_unlock_irqrestore(&nw_gpio_lock, flags);
126126
}
127127
}
128128

‎arch/arm/mach-integrator/core.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ static struct amba_pl010_data integrator_uart_data = {
209209

210210
#define CM_CTRL IO_ADDRESS(INTEGRATOR_HDR_CTRL)
211211

212-
static DEFINE_SPINLOCK(cm_lock);
212+
static DEFINE_RAW_SPINLOCK(cm_lock);
213213

214214
/**
215215
* cm_control - update the CM_CTRL register.
@@ -221,10 +221,10 @@ void cm_control(u32 mask, u32 set)
221221
unsigned long flags;
222222
u32 val;
223223

224-
spin_lock_irqsave(&cm_lock, flags);
224+
raw_spin_lock_irqsave(&cm_lock, flags);
225225
val = readl(CM_CTRL) & ~mask;
226226
writel(val | set, CM_CTRL);
227-
spin_unlock_irqrestore(&cm_lock, flags);
227+
raw_spin_unlock_irqrestore(&cm_lock, flags);
228228
}
229229

230230
EXPORT_SYMBOL(cm_control);

0 commit comments

Comments
 (0)