Skip to content

Commit 60658f8

Browse files
committed
Merge master.kernel.org:/home/rmk/linux-2.6-arm
* master.kernel.org:/home/rmk/linux-2.6-arm: ARM: 6524/1: GIC irq desciptor bug fix ARM: 6523/1: iop: ensure sched_clock() is notrace ARM: 6456/1: Fix for building DEBUG with sa11xx_base.c as a module. ARM: 6519/1: kuser: Fix incorrect cmpxchg syscall in kuser helpers ARM: 6505/1: kprobes: Don't HAVE_KPROBES when CONFIG_THUMB2_KERNEL is selected ARM: 6508/1: vexpress: Correct data alignment in headsmp.S for CONFIG_THUMB2_KERNEL ARM: 6507/1: RealView: Correct data alignment in headsmp.S for CONFIG_THUMB2_KERNEL ARM: 6504/1: Thumb-2: Fix long-distance conditional branches in head.S for Thumb-2. ARM: 6503/1: Thumb-2: Restore sensible zImage header layout for CONFIG_THUMB2_KERNEL ARM: 6502/1: Thumb-2: Fix CONFIG_THUMB2_KERNEL breakage in compressed/head.S ARM: 6501/1: Thumb-2: Correct data alignment for CONFIG_THUMB2_KERNEL in mm/proc-v7.S ARM: 6500/1: Thumb-2: Correct data alignment for CONFIG_THUMB2_KERNEL in kernel/head.S ARM: 6499/1: Thumb-2: Correct data alignment for CONFIG_THUMB2_KERNEL in bootp/init.S ARM: 6498/1: vfp: Correct data alignment for CONFIG_THUMB2_KERNEL ARM: 6497/1: kexec: Correct data alignment for CONFIG_THUMB2_KERNEL ARM: 6496/1: GIC: Do not try to register more then NR_IRQS interrupts ARM: cns3xxx: Fix build with CONFIG_PCI=y
2 parents 771f8bc + f444a57 commit 60658f8

File tree

15 files changed

+56
-30
lines changed

15 files changed

+56
-30
lines changed

arch/arm/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ config ARM
99
select GENERIC_ATOMIC64 if (!CPU_32v6K || !AEABI)
1010
select HAVE_OPROFILE if (HAVE_PERF_EVENTS)
1111
select HAVE_ARCH_KGDB
12-
select HAVE_KPROBES if (!XIP_KERNEL)
12+
select HAVE_KPROBES if (!XIP_KERNEL && !THUMB2_KERNEL)
1313
select HAVE_KRETPROBES if (HAVE_KPROBES)
1414
select HAVE_FUNCTION_TRACER if (!XIP_KERNEL)
1515
select HAVE_FTRACE_MCOUNT_RECORD if (!XIP_KERNEL)

arch/arm/boot/Makefile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,7 @@ else
7070
$(obj)/uImage: LOADADDR=$(ZRELADDR)
7171
endif
7272

73-
ifeq ($(CONFIG_THUMB2_KERNEL),y)
74-
# Set bit 0 to 1 so that "mov pc, rx" switches to Thumb-2 mode
75-
$(obj)/uImage: STARTADDR=$(shell echo $(LOADADDR) | sed -e "s/.$$/1/")
76-
else
7773
$(obj)/uImage: STARTADDR=$(LOADADDR)
78-
endif
7974

8075
$(obj)/uImage: $(obj)/zImage FORCE
8176
$(call if_changed,uimage)

arch/arm/boot/bootp/init.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ move: ldmia r4!, {r7 - r10} @ move 32-bytes at a time
7373

7474
.size _start, . - _start
7575

76+
.align
77+
7678
.type data,#object
7779
data: .word initrd_start @ source initrd address
7880
.word initrd_phys @ destination initrd address

arch/arm/boot/compressed/head.S

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,16 +125,21 @@ wait: mrc p14, 0, pc, c0, c1, 0
125125
* sort out different calling conventions
126126
*/
127127
.align
128+
.arm @ Always enter in ARM state
128129
start:
129130
.type start,#function
130-
.rept 8
131+
THUMB( adr r12, BSYM(1f) )
132+
THUMB( bx r12 )
133+
THUMB( .rept 6 )
134+
ARM( .rept 8 )
131135
mov r0, r0
132136
.endr
133137

134138
b 1f
135139
.word 0x016f2818 @ Magic numbers to help the loader
136140
.word start @ absolute load/run zImage address
137141
.word _edata @ zImage end address
142+
THUMB( .thumb )
138143
1: mov r7, r1 @ save architecture ID
139144
mov r8, r2 @ save atags pointer
140145

@@ -174,7 +179,8 @@ not_angel:
174179
ldr sp, [r0, #28]
175180
#ifdef CONFIG_AUTO_ZRELADDR
176181
@ determine final kernel image address
177-
and r4, pc, #0xf8000000
182+
mov r4, pc
183+
and r4, r4, #0xf8000000
178184
add r4, r4, #TEXT_OFFSET
179185
#else
180186
ldr r4, =zreladdr
@@ -445,7 +451,8 @@ __setup_mmu: sub r3, r4, #16384 @ Page directory size
445451
*/
446452
mov r1, #0x1e
447453
orr r1, r1, #3 << 10
448-
mov r2, pc, lsr #20
454+
mov r2, pc
455+
mov r2, r2, lsr #20
449456
orr r1, r1, r2, lsl #20
450457
add r0, r3, r2, lsl #2
451458
str r1, [r0], #4

arch/arm/common/gic.c

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,15 @@ static int gic_set_cpu(unsigned int irq, const struct cpumask *mask_val)
146146
unsigned int shift = (irq % 4) * 8;
147147
unsigned int cpu = cpumask_first(mask_val);
148148
u32 val;
149+
struct irq_desc *desc;
149150

150151
spin_lock(&irq_controller_lock);
151-
irq_desc[irq].node = cpu;
152+
desc = irq_to_desc(irq);
153+
if (desc == NULL) {
154+
spin_unlock(&irq_controller_lock);
155+
return -EINVAL;
156+
}
157+
desc->node = cpu;
152158
val = readl(reg) & ~(0xff << shift);
153159
val |= 1 << (cpu + shift);
154160
writel(val, reg);
@@ -210,7 +216,7 @@ void __init gic_cascade_irq(unsigned int gic_nr, unsigned int irq)
210216
void __init gic_dist_init(unsigned int gic_nr, void __iomem *base,
211217
unsigned int irq_start)
212218
{
213-
unsigned int max_irq, i;
219+
unsigned int gic_irqs, irq_limit, i;
214220
u32 cpumask = 1 << smp_processor_id();
215221

216222
if (gic_nr >= MAX_GIC_NR)
@@ -226,47 +232,49 @@ void __init gic_dist_init(unsigned int gic_nr, void __iomem *base,
226232

227233
/*
228234
* Find out how many interrupts are supported.
229-
*/
230-
max_irq = readl(base + GIC_DIST_CTR) & 0x1f;
231-
max_irq = (max_irq + 1) * 32;
232-
233-
/*
234235
* The GIC only supports up to 1020 interrupt sources.
235-
* Limit this to either the architected maximum, or the
236-
* platform maximum.
237236
*/
238-
if (max_irq > max(1020, NR_IRQS))
239-
max_irq = max(1020, NR_IRQS);
237+
gic_irqs = readl(base + GIC_DIST_CTR) & 0x1f;
238+
gic_irqs = (gic_irqs + 1) * 32;
239+
if (gic_irqs > 1020)
240+
gic_irqs = 1020;
240241

241242
/*
242243
* Set all global interrupts to be level triggered, active low.
243244
*/
244-
for (i = 32; i < max_irq; i += 16)
245+
for (i = 32; i < gic_irqs; i += 16)
245246
writel(0, base + GIC_DIST_CONFIG + i * 4 / 16);
246247

247248
/*
248249
* Set all global interrupts to this CPU only.
249250
*/
250-
for (i = 32; i < max_irq; i += 4)
251+
for (i = 32; i < gic_irqs; i += 4)
251252
writel(cpumask, base + GIC_DIST_TARGET + i * 4 / 4);
252253

253254
/*
254255
* Set priority on all global interrupts.
255256
*/
256-
for (i = 32; i < max_irq; i += 4)
257+
for (i = 32; i < gic_irqs; i += 4)
257258
writel(0xa0a0a0a0, base + GIC_DIST_PRI + i * 4 / 4);
258259

259260
/*
260261
* Disable all interrupts. Leave the PPI and SGIs alone
261262
* as these enables are banked registers.
262263
*/
263-
for (i = 32; i < max_irq; i += 32)
264+
for (i = 32; i < gic_irqs; i += 32)
264265
writel(0xffffffff, base + GIC_DIST_ENABLE_CLEAR + i * 4 / 32);
265266

267+
/*
268+
* Limit number of interrupts registered to the platform maximum
269+
*/
270+
irq_limit = gic_data[gic_nr].irq_offset + gic_irqs;
271+
if (WARN_ON(irq_limit > NR_IRQS))
272+
irq_limit = NR_IRQS;
273+
266274
/*
267275
* Setup the Linux IRQ subsystem.
268276
*/
269-
for (i = irq_start; i < gic_data[gic_nr].irq_offset + max_irq; i++) {
277+
for (i = irq_start; i < irq_limit; i++) {
270278
set_irq_chip(i, &gic_chip);
271279
set_irq_chip_data(i, &gic_data[gic_nr]);
272280
set_irq_handler(i, handle_level_irq);

arch/arm/kernel/entry-armv.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ __kuser_cmpxchg: @ 0xffff0fc0
911911
* A special ghost syscall is used for that (see traps.c).
912912
*/
913913
stmfd sp!, {r7, lr}
914-
ldr r7, =1f @ it's 20 bits
914+
ldr r7, 1f @ it's 20 bits
915915
swi __ARM_NR_cmpxchg
916916
ldmfd sp!, {r7, pc}
917917
1: .word __ARM_NR_cmpxchg

arch/arm/kernel/head.S

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,11 @@ ENTRY(stext)
8585
mrc p15, 0, r9, c0, c0 @ get processor id
8686
bl __lookup_processor_type @ r5=procinfo r9=cpuid
8787
movs r10, r5 @ invalid processor (r5=0)?
88+
THUMB( it eq ) @ force fixup-able long branch encoding
8889
beq __error_p @ yes, error 'p'
8990
bl __lookup_machine_type @ r5=machinfo
9091
movs r8, r5 @ invalid machine (r5=0)?
92+
THUMB( it eq ) @ force fixup-able long branch encoding
9193
beq __error_a @ yes, error 'a'
9294
bl __vet_atags
9395
#ifdef CONFIG_SMP_ON_UP
@@ -262,6 +264,7 @@ __create_page_tables:
262264
mov pc, lr
263265
ENDPROC(__create_page_tables)
264266
.ltorg
267+
.align
265268
__enable_mmu_loc:
266269
.long .
267270
.long __enable_mmu
@@ -282,6 +285,7 @@ ENTRY(secondary_startup)
282285
bl __lookup_processor_type
283286
movs r10, r5 @ invalid processor?
284287
moveq r0, #'p' @ yes, error 'p'
288+
THUMB( it eq ) @ force fixup-able long branch encoding
285289
beq __error_p
286290

287291
/*
@@ -308,6 +312,8 @@ ENTRY(__secondary_switched)
308312
b secondary_start_kernel
309313
ENDPROC(__secondary_switched)
310314

315+
.align
316+
311317
.type __secondary_data, %object
312318
__secondary_data:
313319
.long .
@@ -413,6 +419,7 @@ __fixup_smp_on_up:
413419
mov pc, lr
414420
ENDPROC(__fixup_smp)
415421

422+
.align
416423
1: .word .
417424
.word __smpalt_begin
418425
.word __smpalt_end

arch/arm/kernel/relocate_kernel.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ relocate_new_kernel:
5959
ldr r2,kexec_boot_atags
6060
mov pc,lr
6161

62+
.align
63+
6264
.globl kexec_start_address
6365
kexec_start_address:
6466
.long 0x0

arch/arm/mach-cns3xxx/pcie.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ static int __init cns3xxx_pcie_init(void)
369369
{
370370
int i;
371371

372-
hook_fault_code(16 + 6, cns3xxx_pcie_abort_handler, SIGBUS,
372+
hook_fault_code(16 + 6, cns3xxx_pcie_abort_handler, SIGBUS, 0,
373373
"imprecise external abort");
374374

375375
for (i = 0; i < ARRAY_SIZE(cns3xxx_pcie); i++) {

arch/arm/mach-realview/headsmp.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,6 @@ pen: ldr r7, [r6]
3535
*/
3636
b secondary_startup
3737

38+
.align
3839
1: .long .
3940
.long pen_release

arch/arm/mach-vexpress/headsmp.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,6 @@ pen: ldr r7, [r6]
3535
*/
3636
b secondary_startup
3737

38+
.align
3839
1: .long .
3940
.long pen_release

arch/arm/mm/proc-v7.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ __v7_ca9mp_proc_info:
381381
PMD_SECT_XN | \
382382
PMD_SECT_AP_WRITE | \
383383
PMD_SECT_AP_READ
384-
b __v7_ca9mp_setup
384+
W(b) __v7_ca9mp_setup
385385
.long cpu_arch_name
386386
.long cpu_elf_name
387387
.long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP|HWCAP_TLS
@@ -413,7 +413,7 @@ __v7_proc_info:
413413
PMD_SECT_XN | \
414414
PMD_SECT_AP_WRITE | \
415415
PMD_SECT_AP_READ
416-
b __v7_setup
416+
W(b) __v7_setup
417417
.long cpu_arch_name
418418
.long cpu_elf_name
419419
.long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP|HWCAP_TLS

arch/arm/plat-iop/time.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <linux/time.h>
1919
#include <linux/init.h>
2020
#include <linux/timex.h>
21+
#include <linux/sched.h>
2122
#include <linux/io.h>
2223
#include <linux/clocksource.h>
2324
#include <linux/clockchips.h>
@@ -36,7 +37,7 @@
3637
/*
3738
* IOP clocksource (free-running timer 1).
3839
*/
39-
static cycle_t iop_clocksource_read(struct clocksource *unused)
40+
static cycle_t notrace iop_clocksource_read(struct clocksource *unused)
4041
{
4142
return 0xffffffffu - read_tcr1();
4243
}

arch/arm/vfp/vfphw.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ ENTRY(vfp_save_state)
206206
mov pc, lr
207207
ENDPROC(vfp_save_state)
208208

209+
.align
209210
last_VFP_context_address:
210211
.word last_VFP_context
211212

drivers/pcmcia/soc_common.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ void soc_pcmcia_debug(struct soc_pcmcia_socket *skt, const char *func,
7070
va_end(args);
7171
}
7272
}
73+
EXPORT_SYMBOL(soc_pcmcia_debug);
7374

7475
#endif
7576

0 commit comments

Comments
 (0)