Skip to content

Commit e1342f1

Browse files
Russell KingRussell King
authored andcommitted
Merge branch 'smp-fix'
2 parents 776abac + ee348d5 commit e1342f1

File tree

23 files changed

+228
-136
lines changed

23 files changed

+228
-136
lines changed

arch/arm/common/gic.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,9 @@ void __cpuinit gic_cpu_init(unsigned int gic_nr, void __iomem *base)
253253
}
254254

255255
#ifdef CONFIG_SMP
256-
void gic_raise_softirq(cpumask_t cpumask, unsigned int irq)
256+
void gic_raise_softirq(const struct cpumask *mask, unsigned int irq)
257257
{
258-
unsigned long map = *cpus_addr(cpumask);
258+
unsigned long map = *cpus_addr(*mask);
259259

260260
/* this always happens on GIC0 */
261261
writel(map << 16 | irq, gic_data[0].dist_base + GIC_DIST_SOFTINT);

arch/arm/include/asm/hardware/gic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
void gic_dist_init(unsigned int gic_nr, void __iomem *base, unsigned int irq_start);
3737
void gic_cpu_init(unsigned int gic_nr, void __iomem *base);
3838
void gic_cascade_irq(unsigned int gic_nr, unsigned int irq);
39-
void gic_raise_softirq(cpumask_t cpumask, unsigned int irq);
39+
void gic_raise_softirq(const struct cpumask *mask, unsigned int irq);
4040
#endif
4141

4242
#endif

arch/arm/include/asm/smp.h

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,12 @@ extern void smp_store_cpu_info(unsigned int cpuid);
5353
/*
5454
* Raise an IPI cross call on CPUs in callmap.
5555
*/
56-
extern void smp_cross_call(cpumask_t callmap);
57-
58-
/*
59-
* Broadcast a timer interrupt to the other CPUs.
60-
*/
61-
extern void smp_send_timer(void);
56+
extern void smp_cross_call(const struct cpumask *mask);
6257

6358
/*
6459
* Broadcast a clock event to other CPUs.
6560
*/
66-
extern void smp_timer_broadcast(cpumask_t mask);
61+
extern void smp_timer_broadcast(const struct cpumask *mask);
6762

6863
/*
6964
* Boot a secondary CPU, and assign it the specified idle task.
@@ -102,7 +97,8 @@ extern int platform_cpu_kill(unsigned int cpu);
10297
extern void platform_cpu_enable(unsigned int cpu);
10398

10499
extern void arch_send_call_function_single_ipi(int cpu);
105-
extern void arch_send_call_function_ipi(cpumask_t mask);
100+
extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
101+
#define arch_send_call_function_ipi_mask arch_send_call_function_ipi_mask
106102

107103
/*
108104
* Local timer interrupt handling function (can be IPI'ed).

arch/arm/kernel/smp.c

Lines changed: 16 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -326,14 +326,14 @@ void __init smp_prepare_boot_cpu(void)
326326
per_cpu(cpu_data, cpu).idle = current;
327327
}
328328

329-
static void send_ipi_message(cpumask_t callmap, enum ipi_msg_type msg)
329+
static void send_ipi_message(const struct cpumask *mask, enum ipi_msg_type msg)
330330
{
331331
unsigned long flags;
332332
unsigned int cpu;
333333

334334
local_irq_save(flags);
335335

336-
for_each_cpu_mask(cpu, callmap) {
336+
for_each_cpu(cpu, mask) {
337337
struct ipi_data *ipi = &per_cpu(ipi_data, cpu);
338338

339339
spin_lock(&ipi->lock);
@@ -344,19 +344,19 @@ static void send_ipi_message(cpumask_t callmap, enum ipi_msg_type msg)
344344
/*
345345
* Call the platform specific cross-CPU call function.
346346
*/
347-
smp_cross_call(callmap);
347+
smp_cross_call(mask);
348348

349349
local_irq_restore(flags);
350350
}
351351

352-
void arch_send_call_function_ipi(cpumask_t mask)
352+
void arch_send_call_function_ipi_mask(const struct cpumask *mask)
353353
{
354354
send_ipi_message(mask, IPI_CALL_FUNC);
355355
}
356356

357357
void arch_send_call_function_single_ipi(int cpu)
358358
{
359-
send_ipi_message(cpumask_of_cpu(cpu), IPI_CALL_FUNC_SINGLE);
359+
send_ipi_message(cpumask_of(cpu), IPI_CALL_FUNC_SINGLE);
360360
}
361361

362362
void show_ipi_list(struct seq_file *p)
@@ -498,17 +498,10 @@ asmlinkage void __exception do_IPI(struct pt_regs *regs)
498498

499499
void smp_send_reschedule(int cpu)
500500
{
501-
send_ipi_message(cpumask_of_cpu(cpu), IPI_RESCHEDULE);
501+
send_ipi_message(cpumask_of(cpu), IPI_RESCHEDULE);
502502
}
503503

504-
void smp_send_timer(void)
505-
{
506-
cpumask_t mask = cpu_online_map;
507-
cpu_clear(smp_processor_id(), mask);
508-
send_ipi_message(mask, IPI_TIMER);
509-
}
510-
511-
void smp_timer_broadcast(cpumask_t mask)
504+
void smp_timer_broadcast(const struct cpumask *mask)
512505
{
513506
send_ipi_message(mask, IPI_TIMER);
514507
}
@@ -517,7 +510,7 @@ void smp_send_stop(void)
517510
{
518511
cpumask_t mask = cpu_online_map;
519512
cpu_clear(smp_processor_id(), mask);
520-
send_ipi_message(mask, IPI_CPU_STOP);
513+
send_ipi_message(&mask, IPI_CPU_STOP);
521514
}
522515

523516
/*
@@ -528,20 +521,17 @@ int setup_profiling_timer(unsigned int multiplier)
528521
return -EINVAL;
529522
}
530523

531-
static int
532-
on_each_cpu_mask(void (*func)(void *), void *info, int wait, cpumask_t mask)
524+
static void
525+
on_each_cpu_mask(void (*func)(void *), void *info, int wait,
526+
const struct cpumask *mask)
533527
{
534-
int ret = 0;
535-
536528
preempt_disable();
537529

538-
ret = smp_call_function_mask(mask, func, info, wait);
539-
if (cpu_isset(smp_processor_id(), mask))
530+
smp_call_function_many(mask, func, info, wait);
531+
if (cpumask_test_cpu(smp_processor_id(), mask))
540532
func(info);
541533

542534
preempt_enable();
543-
544-
return ret;
545535
}
546536

547537
/**********************************************************************/
@@ -602,20 +592,17 @@ void flush_tlb_all(void)
602592

603593
void flush_tlb_mm(struct mm_struct *mm)
604594
{
605-
cpumask_t mask = mm->cpu_vm_mask;
606-
607-
on_each_cpu_mask(ipi_flush_tlb_mm, mm, 1, mask);
595+
on_each_cpu_mask(ipi_flush_tlb_mm, mm, 1, &mm->cpu_vm_mask);
608596
}
609597

610598
void flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr)
611599
{
612-
cpumask_t mask = vma->vm_mm->cpu_vm_mask;
613600
struct tlb_args ta;
614601

615602
ta.ta_vma = vma;
616603
ta.ta_start = uaddr;
617604

618-
on_each_cpu_mask(ipi_flush_tlb_page, &ta, 1, mask);
605+
on_each_cpu_mask(ipi_flush_tlb_page, &ta, 1, &vma->vm_mm->cpu_vm_mask);
619606
}
620607

621608
void flush_tlb_kernel_page(unsigned long kaddr)
@@ -630,14 +617,13 @@ void flush_tlb_kernel_page(unsigned long kaddr)
630617
void flush_tlb_range(struct vm_area_struct *vma,
631618
unsigned long start, unsigned long end)
632619
{
633-
cpumask_t mask = vma->vm_mm->cpu_vm_mask;
634620
struct tlb_args ta;
635621

636622
ta.ta_vma = vma;
637623
ta.ta_start = start;
638624
ta.ta_end = end;
639625

640-
on_each_cpu_mask(ipi_flush_tlb_range, &ta, 1, mask);
626+
on_each_cpu_mask(ipi_flush_tlb_range, &ta, 1, &vma->vm_mm->cpu_vm_mask);
641627
}
642628

643629
void flush_tlb_kernel_range(unsigned long start, unsigned long end)

arch/arm/mach-realview/core.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -750,14 +750,6 @@ void __init realview_timer_init(unsigned int timer_irq)
750750
{
751751
u32 val;
752752

753-
#ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
754-
/*
755-
* The dummy clock device has to be registered before the main device
756-
* so that the latter will broadcast the clock events
757-
*/
758-
local_timer_setup();
759-
#endif
760-
761753
/*
762754
* set clock frequency:
763755
* REALVIEW_REFCLK is 32KHz

arch/arm/mach-realview/include/mach/smp.h

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,9 @@
1515
/*
1616
* We use IRQ1 as the IPI
1717
*/
18-
static inline void smp_cross_call(cpumask_t callmap)
19-
{
20-
gic_raise_softirq(callmap, 1);
21-
}
22-
23-
/*
24-
* Do nothing on MPcore.
25-
*/
26-
static inline void smp_cross_call_done(cpumask_t callmap)
18+
static inline void smp_cross_call(const struct cpumask *mask)
2719
{
20+
gic_raise_softirq(mask, 1);
2821
}
2922

3023
#endif

arch/arm/mach-realview/localtimer.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,10 @@ void __cpuinit local_timer_setup(void)
189189
struct clock_event_device *clk = &per_cpu(local_clockevent, cpu);
190190

191191
clk->name = "dummy_timer";
192-
clk->features = CLOCK_EVT_FEAT_DUMMY;
193-
clk->rating = 200;
192+
clk->features = CLOCK_EVT_FEAT_ONESHOT |
193+
CLOCK_EVT_FEAT_PERIODIC |
194+
CLOCK_EVT_FEAT_DUMMY;
195+
clk->rating = 400;
194196
clk->mult = 1;
195197
clk->set_mode = dummy_timer_set_mode;
196198
clk->broadcast = smp_timer_broadcast;

arch/arm/mach-realview/platsmp.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,6 @@ void __cpuinit platform_secondary_init(unsigned int cpu)
7777
{
7878
trace_hardirqs_off();
7979

80-
/*
81-
* the primary core may have used a "cross call" soft interrupt
82-
* to get this processor out of WFI in the BootMonitor - make
83-
* sure that we are no longer being sent this soft interrupt
84-
*/
85-
smp_cross_call_done(cpumask_of_cpu(cpu));
86-
8780
/*
8881
* if any interrupts are already enabled for the primary
8982
* core (e.g. timer irq), then they will not have been enabled
@@ -136,7 +129,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
136129
* Use smp_cross_call() for this, since there's little
137130
* point duplicating the code here
138131
*/
139-
smp_cross_call(cpumask_of_cpu(cpu));
132+
smp_cross_call(cpumask_of(cpu));
140133

141134
timeout = jiffies + (1 * HZ);
142135
while (time_before(jiffies, timeout)) {
@@ -224,11 +217,9 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
224217
if (max_cpus > ncores)
225218
max_cpus = ncores;
226219

227-
#ifdef CONFIG_LOCAL_TIMERS
220+
#if defined(CONFIG_LOCAL_TIMERS) || defined(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST)
228221
/*
229-
* Enable the local timer for primary CPU. If the device is
230-
* dummy (!CONFIG_LOCAL_TIMERS), it was already registers in
231-
* realview_timer_init
222+
* Enable the local timer or broadcast device for the boot CPU.
232223
*/
233224
local_timer_setup();
234225
#endif

drivers/acpi/acpica/Makefile

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,40 +5,43 @@
55
ccflags-y := -Os
66
ccflags-$(CONFIG_ACPI_DEBUG) += -DACPI_DEBUG_OUTPUT
77

8-
obj-y := dsfield.o dsmthdat.o dsopcode.o dswexec.o dswscope.o \
8+
# use acpi.o to put all files here into acpi.o modparam namespace
9+
obj-y += acpi.o
10+
11+
acpi-y := dsfield.o dsmthdat.o dsopcode.o dswexec.o dswscope.o \
912
dsmethod.o dsobject.o dsutils.o dswload.o dswstate.o \
1013
dsinit.o
1114

12-
obj-y += evevent.o evregion.o evsci.o evxfevnt.o \
15+
acpi-y += evevent.o evregion.o evsci.o evxfevnt.o \
1316
evmisc.o evrgnini.o evxface.o evxfregn.o \
1417
evgpe.o evgpeblk.o
1518

16-
obj-y += exconfig.o exfield.o exnames.o exoparg6.o exresolv.o exstorob.o\
19+
acpi-y += exconfig.o exfield.o exnames.o exoparg6.o exresolv.o exstorob.o\
1720
exconvrt.o exfldio.o exoparg1.o exprep.o exresop.o exsystem.o\
1821
excreate.o exmisc.o exoparg2.o exregion.o exstore.o exutils.o \
1922
exdump.o exmutex.o exoparg3.o exresnte.o exstoren.o
2023

21-
obj-y += hwacpi.o hwgpe.o hwregs.o hwsleep.o hwxface.o hwvalid.o
24+
acpi-y += hwacpi.o hwgpe.o hwregs.o hwsleep.o hwxface.o hwvalid.o
2225

23-
obj-$(ACPI_FUTURE_USAGE) += hwtimer.o
26+
acpi-$(ACPI_FUTURE_USAGE) += hwtimer.o
2427

25-
obj-y += nsaccess.o nsload.o nssearch.o nsxfeval.o \
28+
acpi-y += nsaccess.o nsload.o nssearch.o nsxfeval.o \
2629
nsalloc.o nseval.o nsnames.o nsutils.o nsxfname.o \
2730
nsdump.o nsinit.o nsobject.o nswalk.o nsxfobj.o \
2831
nsparse.o nspredef.o
2932

30-
obj-$(ACPI_FUTURE_USAGE) += nsdumpdv.o
33+
acpi-$(ACPI_FUTURE_USAGE) += nsdumpdv.o
3134

32-
obj-y += psargs.o psparse.o psloop.o pstree.o pswalk.o \
35+
acpi-y += psargs.o psparse.o psloop.o pstree.o pswalk.o \
3336
psopcode.o psscope.o psutils.o psxface.o
3437

35-
obj-y += rsaddr.o rscreate.o rsinfo.o rsio.o rslist.o rsmisc.o rsxface.o \
38+
acpi-y += rsaddr.o rscreate.o rsinfo.o rsio.o rslist.o rsmisc.o rsxface.o \
3639
rscalc.o rsirq.o rsmemory.o rsutils.o
3740

38-
obj-$(ACPI_FUTURE_USAGE) += rsdump.o
41+
acpi-$(ACPI_FUTURE_USAGE) += rsdump.o
3942

40-
obj-y += tbxface.o tbinstal.o tbutils.o tbfind.o tbfadt.o tbxfroot.o
43+
acpi-y += tbxface.o tbinstal.o tbutils.o tbfind.o tbfadt.o tbxfroot.o
4144

42-
obj-y += utalloc.o utdebug.o uteval.o utinit.o utmisc.o utxface.o \
45+
acpi-y += utalloc.o utdebug.o uteval.o utinit.o utmisc.o utxface.o \
4346
utcopy.o utdelete.o utglobal.o utmath.o utobject.o \
4447
utstate.o utmutex.o utobject.o utresrc.o utlock.o

drivers/acpi/acpica/aclocal.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,12 @@ struct acpi_bit_register_info {
787787

788788
/* For control registers, both ignored and reserved bits must be preserved */
789789

790-
#define ACPI_PM1_CONTROL_IGNORED_BITS 0x0201 /* Bits 9, 0(SCI_EN) */
790+
/*
791+
* The ACPI spec says to ignore PM1_CTL.SCI_EN (bit 0)
792+
* but we need to be able to write ACPI_BITREG_SCI_ENABLE directly
793+
* as a BIOS workaround on some machines.
794+
*/
795+
#define ACPI_PM1_CONTROL_IGNORED_BITS 0x0200 /* Bits 9 */
791796
#define ACPI_PM1_CONTROL_RESERVED_BITS 0xC1F8 /* Bits 14-15, 3-8 */
792797
#define ACPI_PM1_CONTROL_PRESERVED_BITS \
793798
(ACPI_PM1_CONTROL_IGNORED_BITS | ACPI_PM1_CONTROL_RESERVED_BITS)

drivers/acpi/bus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ int acpi_bus_set_power(acpi_handle handle, int state)
312312
end:
313313
if (result)
314314
printk(KERN_WARNING PREFIX
315-
"Transitioning device [%s] to D%d\n",
315+
"Device [%s] failed to transition to D%d\n",
316316
device->pnp.bus_id, state);
317317
else {
318318
device->power.state = state;

0 commit comments

Comments
 (0)