aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2009-05-17 12:13:18 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-05-17 12:13:18 -0400
commite1342f1da06d39b3bbd530e9306347c4438bc6e5 (patch)
tree3d8d70c1e633d9bd5b929ad27b8123faa7789b84
parent776abac81764847338a6a02c34609d4b8dfb4918 (diff)
parentee348d5a1d810bc9958cabb7c27302aab235d36e (diff)
Merge branch 'smp-fix'
-rw-r--r--arch/arm/common/gic.c4
-rw-r--r--arch/arm/include/asm/hardware/gic.h2
-rw-r--r--arch/arm/include/asm/smp.h12
-rw-r--r--arch/arm/kernel/smp.c46
-rw-r--r--arch/arm/mach-realview/core.c8
-rw-r--r--arch/arm/mach-realview/include/mach/smp.h11
-rw-r--r--arch/arm/mach-realview/localtimer.c6
-rw-r--r--arch/arm/mach-realview/platsmp.c15
-rw-r--r--drivers/acpi/acpica/Makefile27
-rw-r--r--drivers/acpi/acpica/aclocal.h7
-rw-r--r--drivers/acpi/bus.c2
-rw-r--r--drivers/acpi/processor_idle.c42
-rw-r--r--drivers/acpi/processor_throttling.c25
-rw-r--r--drivers/acpi/video.c38
-rw-r--r--drivers/gpu/drm/Kconfig6
-rw-r--r--drivers/ide/icside.c2
-rw-r--r--drivers/ide/ide-tape.c6
-rw-r--r--drivers/ide/piix.c1
-rw-r--r--drivers/platform/x86/asus-laptop.c6
-rw-r--r--drivers/platform/x86/eeepc-laptop.c47
-rw-r--r--drivers/pnp/pnpacpi/core.c8
-rw-r--r--drivers/thermal/thermal_sys.c8
-rw-r--r--kernel/panic.c35
23 files changed, 228 insertions, 136 deletions
diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
index c6884ba1d5ed..3e1714c6523f 100644
--- a/arch/arm/common/gic.c
+++ b/arch/arm/common/gic.c
@@ -253,9 +253,9 @@ void __cpuinit gic_cpu_init(unsigned int gic_nr, void __iomem *base)
253} 253}
254 254
255#ifdef CONFIG_SMP 255#ifdef CONFIG_SMP
256void gic_raise_softirq(cpumask_t cpumask, unsigned int irq) 256void gic_raise_softirq(const struct cpumask *mask, unsigned int irq)
257{ 257{
258 unsigned long map = *cpus_addr(cpumask); 258 unsigned long map = *cpus_addr(*mask);
259 259
260 /* this always happens on GIC0 */ 260 /* this always happens on GIC0 */
261 writel(map << 16 | irq, gic_data[0].dist_base + GIC_DIST_SOFTINT); 261 writel(map << 16 | irq, gic_data[0].dist_base + GIC_DIST_SOFTINT);
diff --git a/arch/arm/include/asm/hardware/gic.h b/arch/arm/include/asm/hardware/gic.h
index 4924914af188..7f34333bb545 100644
--- a/arch/arm/include/asm/hardware/gic.h
+++ b/arch/arm/include/asm/hardware/gic.h
@@ -36,7 +36,7 @@
36void gic_dist_init(unsigned int gic_nr, void __iomem *base, unsigned int irq_start); 36void gic_dist_init(unsigned int gic_nr, void __iomem *base, unsigned int irq_start);
37void gic_cpu_init(unsigned int gic_nr, void __iomem *base); 37void gic_cpu_init(unsigned int gic_nr, void __iomem *base);
38void gic_cascade_irq(unsigned int gic_nr, unsigned int irq); 38void gic_cascade_irq(unsigned int gic_nr, unsigned int irq);
39void gic_raise_softirq(cpumask_t cpumask, unsigned int irq); 39void gic_raise_softirq(const struct cpumask *mask, unsigned int irq);
40#endif 40#endif
41 41
42#endif 42#endif
diff --git a/arch/arm/include/asm/smp.h b/arch/arm/include/asm/smp.h
index fad70da5911d..5995935338e1 100644
--- a/arch/arm/include/asm/smp.h
+++ b/arch/arm/include/asm/smp.h
@@ -53,17 +53,12 @@ extern void smp_store_cpu_info(unsigned int cpuid);
53/* 53/*
54 * Raise an IPI cross call on CPUs in callmap. 54 * Raise an IPI cross call on CPUs in callmap.
55 */ 55 */
56extern void smp_cross_call(cpumask_t callmap); 56extern void smp_cross_call(const struct cpumask *mask);
57
58/*
59 * Broadcast a timer interrupt to the other CPUs.
60 */
61extern void smp_send_timer(void);
62 57
63/* 58/*
64 * Broadcast a clock event to other CPUs. 59 * Broadcast a clock event to other CPUs.
65 */ 60 */
66extern void smp_timer_broadcast(cpumask_t mask); 61extern void smp_timer_broadcast(const struct cpumask *mask);
67 62
68/* 63/*
69 * Boot a secondary CPU, and assign it the specified idle task. 64 * Boot a secondary CPU, and assign it the specified idle task.
@@ -102,7 +97,8 @@ extern int platform_cpu_kill(unsigned int cpu);
102extern void platform_cpu_enable(unsigned int cpu); 97extern void platform_cpu_enable(unsigned int cpu);
103 98
104extern void arch_send_call_function_single_ipi(int cpu); 99extern void arch_send_call_function_single_ipi(int cpu);
105extern void arch_send_call_function_ipi(cpumask_t mask); 100extern 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
106 102
107/* 103/*
108 * Local timer interrupt handling function (can be IPI'ed). 104 * Local timer interrupt handling function (can be IPI'ed).
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index 7801aac3c043..6014dfd22af4 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -326,14 +326,14 @@ void __init smp_prepare_boot_cpu(void)
326 per_cpu(cpu_data, cpu).idle = current; 326 per_cpu(cpu_data, cpu).idle = current;
327} 327}
328 328
329static void send_ipi_message(cpumask_t callmap, enum ipi_msg_type msg) 329static void send_ipi_message(const struct cpumask *mask, enum ipi_msg_type msg)
330{ 330{
331 unsigned long flags; 331 unsigned long flags;
332 unsigned int cpu; 332 unsigned int cpu;
333 333
334 local_irq_save(flags); 334 local_irq_save(flags);
335 335
336 for_each_cpu_mask(cpu, callmap) { 336 for_each_cpu(cpu, mask) {
337 struct ipi_data *ipi = &per_cpu(ipi_data, cpu); 337 struct ipi_data *ipi = &per_cpu(ipi_data, cpu);
338 338
339 spin_lock(&ipi->lock); 339 spin_lock(&ipi->lock);
@@ -344,19 +344,19 @@ static void send_ipi_message(cpumask_t callmap, enum ipi_msg_type msg)
344 /* 344 /*
345 * Call the platform specific cross-CPU call function. 345 * Call the platform specific cross-CPU call function.
346 */ 346 */
347 smp_cross_call(callmap); 347 smp_cross_call(mask);
348 348
349 local_irq_restore(flags); 349 local_irq_restore(flags);
350} 350}
351 351
352void arch_send_call_function_ipi(cpumask_t mask) 352void arch_send_call_function_ipi_mask(const struct cpumask *mask)
353{ 353{
354 send_ipi_message(mask, IPI_CALL_FUNC); 354 send_ipi_message(mask, IPI_CALL_FUNC);
355} 355}
356 356
357void arch_send_call_function_single_ipi(int cpu) 357void arch_send_call_function_single_ipi(int cpu)
358{ 358{
359 send_ipi_message(cpumask_of_cpu(cpu), IPI_CALL_FUNC_SINGLE); 359 send_ipi_message(cpumask_of(cpu), IPI_CALL_FUNC_SINGLE);
360} 360}
361 361
362void show_ipi_list(struct seq_file *p) 362void show_ipi_list(struct seq_file *p)
@@ -498,17 +498,10 @@ asmlinkage void __exception do_IPI(struct pt_regs *regs)
498 498
499void smp_send_reschedule(int cpu) 499void smp_send_reschedule(int cpu)
500{ 500{
501 send_ipi_message(cpumask_of_cpu(cpu), IPI_RESCHEDULE); 501 send_ipi_message(cpumask_of(cpu), IPI_RESCHEDULE);
502} 502}
503 503
504void smp_send_timer(void) 504void smp_timer_broadcast(const struct cpumask *mask)
505{
506 cpumask_t mask = cpu_online_map;
507 cpu_clear(smp_processor_id(), mask);
508 send_ipi_message(mask, IPI_TIMER);
509}
510
511void smp_timer_broadcast(cpumask_t mask)
512{ 505{
513 send_ipi_message(mask, IPI_TIMER); 506 send_ipi_message(mask, IPI_TIMER);
514} 507}
@@ -517,7 +510,7 @@ void smp_send_stop(void)
517{ 510{
518 cpumask_t mask = cpu_online_map; 511 cpumask_t mask = cpu_online_map;
519 cpu_clear(smp_processor_id(), mask); 512 cpu_clear(smp_processor_id(), mask);
520 send_ipi_message(mask, IPI_CPU_STOP); 513 send_ipi_message(&mask, IPI_CPU_STOP);
521} 514}
522 515
523/* 516/*
@@ -528,20 +521,17 @@ int setup_profiling_timer(unsigned int multiplier)
528 return -EINVAL; 521 return -EINVAL;
529} 522}
530 523
531static int 524static void
532on_each_cpu_mask(void (*func)(void *), void *info, int wait, cpumask_t mask) 525on_each_cpu_mask(void (*func)(void *), void *info, int wait,
526 const struct cpumask *mask)
533{ 527{
534 int ret = 0;
535
536 preempt_disable(); 528 preempt_disable();
537 529
538 ret = smp_call_function_mask(mask, func, info, wait); 530 smp_call_function_many(mask, func, info, wait);
539 if (cpu_isset(smp_processor_id(), mask)) 531 if (cpumask_test_cpu(smp_processor_id(), mask))
540 func(info); 532 func(info);
541 533
542 preempt_enable(); 534 preempt_enable();
543
544 return ret;
545} 535}
546 536
547/**********************************************************************/ 537/**********************************************************************/
@@ -602,20 +592,17 @@ void flush_tlb_all(void)
602 592
603void flush_tlb_mm(struct mm_struct *mm) 593void flush_tlb_mm(struct mm_struct *mm)
604{ 594{
605 cpumask_t mask = mm->cpu_vm_mask; 595 on_each_cpu_mask(ipi_flush_tlb_mm, mm, 1, &mm->cpu_vm_mask);
606
607 on_each_cpu_mask(ipi_flush_tlb_mm, mm, 1, mask);
608} 596}
609 597
610void flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr) 598void flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr)
611{ 599{
612 cpumask_t mask = vma->vm_mm->cpu_vm_mask;
613 struct tlb_args ta; 600 struct tlb_args ta;
614 601
615 ta.ta_vma = vma; 602 ta.ta_vma = vma;
616 ta.ta_start = uaddr; 603 ta.ta_start = uaddr;
617 604
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);
619} 606}
620 607
621void flush_tlb_kernel_page(unsigned long kaddr) 608void flush_tlb_kernel_page(unsigned long kaddr)
@@ -630,14 +617,13 @@ void flush_tlb_kernel_page(unsigned long kaddr)
630void flush_tlb_range(struct vm_area_struct *vma, 617void flush_tlb_range(struct vm_area_struct *vma,
631 unsigned long start, unsigned long end) 618 unsigned long start, unsigned long end)
632{ 619{
633 cpumask_t mask = vma->vm_mm->cpu_vm_mask;
634 struct tlb_args ta; 620 struct tlb_args ta;
635 621
636 ta.ta_vma = vma; 622 ta.ta_vma = vma;
637 ta.ta_start = start; 623 ta.ta_start = start;
638 ta.ta_end = end; 624 ta.ta_end = end;
639 625
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);
641} 627}
642 628
643void flush_tlb_kernel_range(unsigned long start, unsigned long end) 629void flush_tlb_kernel_range(unsigned long start, unsigned long end)
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index 942e1a7eb9b2..076acbc50706 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -750,14 +750,6 @@ void __init realview_timer_init(unsigned int timer_irq)
750{ 750{
751 u32 val; 751 u32 val;
752 752
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
761 /* 753 /*
762 * set clock frequency: 754 * set clock frequency:
763 * REALVIEW_REFCLK is 32KHz 755 * REALVIEW_REFCLK is 32KHz
diff --git a/arch/arm/mach-realview/include/mach/smp.h b/arch/arm/mach-realview/include/mach/smp.h
index 515819efd046..dd53892d44a7 100644
--- a/arch/arm/mach-realview/include/mach/smp.h
+++ b/arch/arm/mach-realview/include/mach/smp.h
@@ -15,16 +15,9 @@
15/* 15/*
16 * We use IRQ1 as the IPI 16 * We use IRQ1 as the IPI
17 */ 17 */
18static inline void smp_cross_call(cpumask_t callmap) 18static inline void smp_cross_call(const struct cpumask *mask)
19{
20 gic_raise_softirq(callmap, 1);
21}
22
23/*
24 * Do nothing on MPcore.
25 */
26static inline void smp_cross_call_done(cpumask_t callmap)
27{ 19{
20 gic_raise_softirq(mask, 1);
28} 21}
29 22
30#endif 23#endif
diff --git a/arch/arm/mach-realview/localtimer.c b/arch/arm/mach-realview/localtimer.c
index d0d39adf6407..1c01d13460f0 100644
--- a/arch/arm/mach-realview/localtimer.c
+++ b/arch/arm/mach-realview/localtimer.c
@@ -189,8 +189,10 @@ void __cpuinit local_timer_setup(void)
189 struct clock_event_device *clk = &per_cpu(local_clockevent, cpu); 189 struct clock_event_device *clk = &per_cpu(local_clockevent, cpu);
190 190
191 clk->name = "dummy_timer"; 191 clk->name = "dummy_timer";
192 clk->features = CLOCK_EVT_FEAT_DUMMY; 192 clk->features = CLOCK_EVT_FEAT_ONESHOT |
193 clk->rating = 200; 193 CLOCK_EVT_FEAT_PERIODIC |
194 CLOCK_EVT_FEAT_DUMMY;
195 clk->rating = 400;
194 clk->mult = 1; 196 clk->mult = 1;
195 clk->set_mode = dummy_timer_set_mode; 197 clk->set_mode = dummy_timer_set_mode;
196 clk->broadcast = smp_timer_broadcast; 198 clk->broadcast = smp_timer_broadcast;
diff --git a/arch/arm/mach-realview/platsmp.c b/arch/arm/mach-realview/platsmp.c
index ea3c75595fa9..30a9c68591f6 100644
--- a/arch/arm/mach-realview/platsmp.c
+++ b/arch/arm/mach-realview/platsmp.c
@@ -78,13 +78,6 @@ void __cpuinit platform_secondary_init(unsigned int cpu)
78 trace_hardirqs_off(); 78 trace_hardirqs_off();
79 79
80 /* 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
87 /*
88 * if any interrupts are already enabled for the primary 81 * if any interrupts are already enabled for the primary
89 * core (e.g. timer irq), then they will not have been enabled 82 * core (e.g. timer irq), then they will not have been enabled
90 * for us: do so 83 * for us: do so
@@ -136,7 +129,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
136 * Use smp_cross_call() for this, since there's little 129 * Use smp_cross_call() for this, since there's little
137 * point duplicating the code here 130 * point duplicating the code here
138 */ 131 */
139 smp_cross_call(cpumask_of_cpu(cpu)); 132 smp_cross_call(cpumask_of(cpu));
140 133
141 timeout = jiffies + (1 * HZ); 134 timeout = jiffies + (1 * HZ);
142 while (time_before(jiffies, timeout)) { 135 while (time_before(jiffies, timeout)) {
@@ -224,11 +217,9 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
224 if (max_cpus > ncores) 217 if (max_cpus > ncores)
225 max_cpus = ncores; 218 max_cpus = ncores;
226 219
227#ifdef CONFIG_LOCAL_TIMERS 220#if defined(CONFIG_LOCAL_TIMERS) || defined(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST)
228 /* 221 /*
229 * Enable the local timer for primary CPU. If the device is 222 * Enable the local timer or broadcast device for the boot CPU.
230 * dummy (!CONFIG_LOCAL_TIMERS), it was already registers in
231 * realview_timer_init
232 */ 223 */
233 local_timer_setup(); 224 local_timer_setup();
234#endif 225#endif
diff --git a/drivers/acpi/acpica/Makefile b/drivers/acpi/acpica/Makefile
index 17e50824a6f1..72ac28da14e3 100644
--- a/drivers/acpi/acpica/Makefile
+++ b/drivers/acpi/acpica/Makefile
@@ -5,40 +5,43 @@
5ccflags-y := -Os 5ccflags-y := -Os
6ccflags-$(CONFIG_ACPI_DEBUG) += -DACPI_DEBUG_OUTPUT 6ccflags-$(CONFIG_ACPI_DEBUG) += -DACPI_DEBUG_OUTPUT
7 7
8obj-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
9obj-y += acpi.o
10
11acpi-y := dsfield.o dsmthdat.o dsopcode.o dswexec.o dswscope.o \
9 dsmethod.o dsobject.o dsutils.o dswload.o dswstate.o \ 12 dsmethod.o dsobject.o dsutils.o dswload.o dswstate.o \
10 dsinit.o 13 dsinit.o
11 14
12obj-y += evevent.o evregion.o evsci.o evxfevnt.o \ 15acpi-y += evevent.o evregion.o evsci.o evxfevnt.o \
13 evmisc.o evrgnini.o evxface.o evxfregn.o \ 16 evmisc.o evrgnini.o evxface.o evxfregn.o \
14 evgpe.o evgpeblk.o 17 evgpe.o evgpeblk.o
15 18
16obj-y += exconfig.o exfield.o exnames.o exoparg6.o exresolv.o exstorob.o\ 19acpi-y += exconfig.o exfield.o exnames.o exoparg6.o exresolv.o exstorob.o\
17 exconvrt.o exfldio.o exoparg1.o exprep.o exresop.o exsystem.o\ 20 exconvrt.o exfldio.o exoparg1.o exprep.o exresop.o exsystem.o\
18 excreate.o exmisc.o exoparg2.o exregion.o exstore.o exutils.o \ 21 excreate.o exmisc.o exoparg2.o exregion.o exstore.o exutils.o \
19 exdump.o exmutex.o exoparg3.o exresnte.o exstoren.o 22 exdump.o exmutex.o exoparg3.o exresnte.o exstoren.o
20 23
21obj-y += hwacpi.o hwgpe.o hwregs.o hwsleep.o hwxface.o hwvalid.o 24acpi-y += hwacpi.o hwgpe.o hwregs.o hwsleep.o hwxface.o hwvalid.o
22 25
23obj-$(ACPI_FUTURE_USAGE) += hwtimer.o 26acpi-$(ACPI_FUTURE_USAGE) += hwtimer.o
24 27
25obj-y += nsaccess.o nsload.o nssearch.o nsxfeval.o \ 28acpi-y += nsaccess.o nsload.o nssearch.o nsxfeval.o \
26 nsalloc.o nseval.o nsnames.o nsutils.o nsxfname.o \ 29 nsalloc.o nseval.o nsnames.o nsutils.o nsxfname.o \
27 nsdump.o nsinit.o nsobject.o nswalk.o nsxfobj.o \ 30 nsdump.o nsinit.o nsobject.o nswalk.o nsxfobj.o \
28 nsparse.o nspredef.o 31 nsparse.o nspredef.o
29 32
30obj-$(ACPI_FUTURE_USAGE) += nsdumpdv.o 33acpi-$(ACPI_FUTURE_USAGE) += nsdumpdv.o
31 34
32obj-y += psargs.o psparse.o psloop.o pstree.o pswalk.o \ 35acpi-y += psargs.o psparse.o psloop.o pstree.o pswalk.o \
33 psopcode.o psscope.o psutils.o psxface.o 36 psopcode.o psscope.o psutils.o psxface.o
34 37
35obj-y += rsaddr.o rscreate.o rsinfo.o rsio.o rslist.o rsmisc.o rsxface.o \ 38acpi-y += rsaddr.o rscreate.o rsinfo.o rsio.o rslist.o rsmisc.o rsxface.o \
36 rscalc.o rsirq.o rsmemory.o rsutils.o 39 rscalc.o rsirq.o rsmemory.o rsutils.o
37 40
38obj-$(ACPI_FUTURE_USAGE) += rsdump.o 41acpi-$(ACPI_FUTURE_USAGE) += rsdump.o
39 42
40obj-y += tbxface.o tbinstal.o tbutils.o tbfind.o tbfadt.o tbxfroot.o 43acpi-y += tbxface.o tbinstal.o tbutils.o tbfind.o tbfadt.o tbxfroot.o
41 44
42obj-y += utalloc.o utdebug.o uteval.o utinit.o utmisc.o utxface.o \ 45acpi-y += utalloc.o utdebug.o uteval.o utinit.o utmisc.o utxface.o \
43 utcopy.o utdelete.o utglobal.o utmath.o utobject.o \ 46 utcopy.o utdelete.o utglobal.o utmath.o utobject.o \
44 utstate.o utmutex.o utobject.o utresrc.o utlock.o 47 utstate.o utmutex.o utobject.o utresrc.o utlock.o
diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h
index 772ee5c4ccca..2ec394a328e9 100644
--- a/drivers/acpi/acpica/aclocal.h
+++ b/drivers/acpi/acpica/aclocal.h
@@ -787,7 +787,12 @@ struct acpi_bit_register_info {
787 787
788/* For control registers, both ignored and reserved bits must be preserved */ 788/* For control registers, both ignored and reserved bits must be preserved */
789 789
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 */
791#define ACPI_PM1_CONTROL_RESERVED_BITS 0xC1F8 /* Bits 14-15, 3-8 */ 796#define ACPI_PM1_CONTROL_RESERVED_BITS 0xC1F8 /* Bits 14-15, 3-8 */
792#define ACPI_PM1_CONTROL_PRESERVED_BITS \ 797#define ACPI_PM1_CONTROL_PRESERVED_BITS \
793 (ACPI_PM1_CONTROL_IGNORED_BITS | ACPI_PM1_CONTROL_RESERVED_BITS) 798 (ACPI_PM1_CONTROL_IGNORED_BITS | ACPI_PM1_CONTROL_RESERVED_BITS)
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index e8f7b64e92da..ae862f1798dc 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -312,7 +312,7 @@ int acpi_bus_set_power(acpi_handle handle, int state)
312 end: 312 end:
313 if (result) 313 if (result)
314 printk(KERN_WARNING PREFIX 314 printk(KERN_WARNING PREFIX
315 "Transitioning device [%s] to D%d\n", 315 "Device [%s] failed to transition to D%d\n",
316 device->pnp.bus_id, state); 316 device->pnp.bus_id, state);
317 else { 317 else {
318 device->power.state = state; 318 device->power.state = state;
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index f7ca8c55956b..72069ba5f1ed 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -202,21 +202,44 @@ static void acpi_state_timer_broadcast(struct acpi_processor *pr,
202 * Suspend / resume control 202 * Suspend / resume control
203 */ 203 */
204static int acpi_idle_suspend; 204static int acpi_idle_suspend;
205static u32 saved_bm_rld;
206
207static void acpi_idle_bm_rld_save(void)
208{
209 acpi_read_bit_register(ACPI_BITREG_BUS_MASTER_RLD, &saved_bm_rld);
210}
211static void acpi_idle_bm_rld_restore(void)
212{
213 u32 resumed_bm_rld;
214
215 acpi_read_bit_register(ACPI_BITREG_BUS_MASTER_RLD, &resumed_bm_rld);
216
217 if (resumed_bm_rld != saved_bm_rld)
218 acpi_write_bit_register(ACPI_BITREG_BUS_MASTER_RLD, saved_bm_rld);
219}
205 220
206int acpi_processor_suspend(struct acpi_device * device, pm_message_t state) 221int acpi_processor_suspend(struct acpi_device * device, pm_message_t state)
207{ 222{
223 if (acpi_idle_suspend == 1)
224 return 0;
225
226 acpi_idle_bm_rld_save();
208 acpi_idle_suspend = 1; 227 acpi_idle_suspend = 1;
209 return 0; 228 return 0;
210} 229}
211 230
212int acpi_processor_resume(struct acpi_device * device) 231int acpi_processor_resume(struct acpi_device * device)
213{ 232{
233 if (acpi_idle_suspend == 0)
234 return 0;
235
236 acpi_idle_bm_rld_restore();
214 acpi_idle_suspend = 0; 237 acpi_idle_suspend = 0;
215 return 0; 238 return 0;
216} 239}
217 240
218#if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86) 241#if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86)
219static int tsc_halts_in_c(int state) 242static void tsc_check_state(int state)
220{ 243{
221 switch (boot_cpu_data.x86_vendor) { 244 switch (boot_cpu_data.x86_vendor) {
222 case X86_VENDOR_AMD: 245 case X86_VENDOR_AMD:
@@ -226,13 +249,17 @@ static int tsc_halts_in_c(int state)
226 * C/P/S0/S1 states when this bit is set. 249 * C/P/S0/S1 states when this bit is set.
227 */ 250 */
228 if (boot_cpu_has(X86_FEATURE_NONSTOP_TSC)) 251 if (boot_cpu_has(X86_FEATURE_NONSTOP_TSC))
229 return 0; 252 return;
230 253
231 /*FALL THROUGH*/ 254 /*FALL THROUGH*/
232 default: 255 default:
233 return state > ACPI_STATE_C1; 256 /* TSC could halt in idle, so notify users */
257 if (state > ACPI_STATE_C1)
258 mark_tsc_unstable("TSC halts in idle");
234 } 259 }
235} 260}
261#else
262static void tsc_check_state(int state) { return; }
236#endif 263#endif
237 264
238static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr) 265static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr)
@@ -578,14 +605,9 @@ static int acpi_processor_power_verify(struct acpi_processor *pr)
578 605
579 pr->power.timer_broadcast_on_state = INT_MAX; 606 pr->power.timer_broadcast_on_state = INT_MAX;
580 607
581 for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) { 608 for (i = 1; i < ACPI_PROCESSOR_MAX_POWER && i <= max_cstate; i++) {
582 struct acpi_processor_cx *cx = &pr->power.states[i]; 609 struct acpi_processor_cx *cx = &pr->power.states[i];
583 610
584#if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86)
585 /* TSC could halt in idle, so notify users */
586 if (tsc_halts_in_c(cx->type))
587 mark_tsc_unstable("TSC halts in idle");;
588#endif
589 switch (cx->type) { 611 switch (cx->type) {
590 case ACPI_STATE_C1: 612 case ACPI_STATE_C1:
591 cx->valid = 1; 613 cx->valid = 1;
@@ -603,6 +625,8 @@ static int acpi_processor_power_verify(struct acpi_processor *pr)
603 acpi_timer_check_state(i, pr, cx); 625 acpi_timer_check_state(i, pr, cx);
604 break; 626 break;
605 } 627 }
628 if (cx->valid)
629 tsc_check_state(cx->type);
606 630
607 if (cx->valid) 631 if (cx->valid)
608 working++; 632 working++;
diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c
index d0d1f4d50434..7f16f5f8e7d3 100644
--- a/drivers/acpi/processor_throttling.c
+++ b/drivers/acpi/processor_throttling.c
@@ -45,6 +45,14 @@
45#define _COMPONENT ACPI_PROCESSOR_COMPONENT 45#define _COMPONENT ACPI_PROCESSOR_COMPONENT
46ACPI_MODULE_NAME("processor_throttling"); 46ACPI_MODULE_NAME("processor_throttling");
47 47
48/* ignore_tpc:
49 * 0 -> acpi processor driver doesn't ignore _TPC values
50 * 1 -> acpi processor driver ignores _TPC values
51 */
52static int ignore_tpc;
53module_param(ignore_tpc, int, 0644);
54MODULE_PARM_DESC(ignore_tpc, "Disable broken BIOS _TPC throttling support");
55
48struct throttling_tstate { 56struct throttling_tstate {
49 unsigned int cpu; /* cpu nr */ 57 unsigned int cpu; /* cpu nr */
50 int target_state; /* target T-state */ 58 int target_state; /* target T-state */
@@ -283,6 +291,10 @@ static int acpi_processor_get_platform_limit(struct acpi_processor *pr)
283 291
284 if (!pr) 292 if (!pr)
285 return -EINVAL; 293 return -EINVAL;
294
295 if (ignore_tpc)
296 goto end;
297
286 status = acpi_evaluate_integer(pr->handle, "_TPC", NULL, &tpc); 298 status = acpi_evaluate_integer(pr->handle, "_TPC", NULL, &tpc);
287 if (ACPI_FAILURE(status)) { 299 if (ACPI_FAILURE(status)) {
288 if (status != AE_NOT_FOUND) { 300 if (status != AE_NOT_FOUND) {
@@ -290,6 +302,8 @@ static int acpi_processor_get_platform_limit(struct acpi_processor *pr)
290 } 302 }
291 return -ENODEV; 303 return -ENODEV;
292 } 304 }
305
306end:
293 pr->throttling_platform_limit = (int)tpc; 307 pr->throttling_platform_limit = (int)tpc;
294 return 0; 308 return 0;
295} 309}
@@ -302,6 +316,9 @@ int acpi_processor_tstate_has_changed(struct acpi_processor *pr)
302 struct acpi_processor_limit *limit; 316 struct acpi_processor_limit *limit;
303 int target_state; 317 int target_state;
304 318
319 if (ignore_tpc)
320 return 0;
321
305 result = acpi_processor_get_platform_limit(pr); 322 result = acpi_processor_get_platform_limit(pr);
306 if (result) { 323 if (result) {
307 /* Throttling Limit is unsupported */ 324 /* Throttling Limit is unsupported */
@@ -821,6 +838,14 @@ static int acpi_processor_get_throttling_ptc(struct acpi_processor *pr)
821 ret = acpi_read_throttling_status(pr, &value); 838 ret = acpi_read_throttling_status(pr, &value);
822 if (ret >= 0) { 839 if (ret >= 0) {
823 state = acpi_get_throttling_state(pr, value); 840 state = acpi_get_throttling_state(pr, value);
841 if (state == -1) {
842 ACPI_WARNING((AE_INFO,
843 "Invalid throttling state, reset\n"));
844 state = 0;
845 ret = acpi_processor_set_throttling(pr, state);
846 if (ret)
847 return ret;
848 }
824 pr->throttling.state = state; 849 pr->throttling.state = state;
825 } 850 }
826 851
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index d7ff61c0d571..810cca90ca7f 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -538,6 +538,41 @@ acpi_video_device_lcd_set_level(struct acpi_video_device *device, int level)
538 return -EINVAL; 538 return -EINVAL;
539} 539}
540 540
541/*
542 * For some buggy _BQC methods, we need to add a constant value to
543 * the _BQC return value to get the actual current brightness level
544 */
545
546static int bqc_offset_aml_bug_workaround;
547static int __init video_set_bqc_offset(const struct dmi_system_id *d)
548{
549 bqc_offset_aml_bug_workaround = 9;
550 return 0;
551}
552
553static struct dmi_system_id video_dmi_table[] __initdata = {
554 /*
555 * Broken _BQC workaround http://bugzilla.kernel.org/show_bug.cgi?id=13121
556 */
557 {
558 .callback = video_set_bqc_offset,
559 .ident = "Acer Aspire 5720",
560 .matches = {
561 DMI_MATCH(DMI_BOARD_VENDOR, "Acer"),
562 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5720"),
563 },
564 },
565 {
566 .callback = video_set_bqc_offset,
567 .ident = "Acer Aspire 5710Z",
568 .matches = {
569 DMI_MATCH(DMI_BOARD_VENDOR, "Acer"),
570 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5710Z"),
571 },
572 },
573 {}
574};
575
541static int 576static int
542acpi_video_device_lcd_get_level_current(struct acpi_video_device *device, 577acpi_video_device_lcd_get_level_current(struct acpi_video_device *device,
543 unsigned long long *level) 578 unsigned long long *level)
@@ -557,6 +592,7 @@ acpi_video_device_lcd_get_level_current(struct acpi_video_device *device,
557 *level = device->brightness->levels[*level + 2]; 592 *level = device->brightness->levels[*level + 2];
558 593
559 } 594 }
595 *level += bqc_offset_aml_bug_workaround;
560 device->brightness->curr = *level; 596 device->brightness->curr = *level;
561 return 0; 597 return 0;
562 } else { 598 } else {
@@ -2290,6 +2326,8 @@ EXPORT_SYMBOL(acpi_video_register);
2290 2326
2291static int __init acpi_video_init(void) 2327static int __init acpi_video_init(void)
2292{ 2328{
2329 dmi_check_system(video_dmi_table);
2330
2293 if (intel_opregion_present()) 2331 if (intel_opregion_present())
2294 return 0; 2332 return 0;
2295 2333
diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index 17b24c580c09..4cd35d8fd799 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -84,6 +84,12 @@ config DRM_I915
84config DRM_I915_KMS 84config DRM_I915_KMS
85 bool "Enable modesetting on intel by default" 85 bool "Enable modesetting on intel by default"
86 depends on DRM_I915 86 depends on DRM_I915
87 # i915 KMS depends on ACPI_VIDEO when ACPI is enabled
88 # but for select to work, need to select ACPI_VIDEO's dependencies, ick
89 select VIDEO_OUTPUT_CONTROL if ACPI
90 select BACKLIGHT_CLASS_DEVICE if ACPI
91 select INPUT if ACPI
92 select ACPI_VIDEO if ACPI
87 help 93 help
88 Choose this option if you want kernel modesetting enabled by default, 94 Choose this option if you want kernel modesetting enabled by default,
89 and you have a new enough userspace to support this. Running old 95 and you have a new enough userspace to support this. Running old
diff --git a/drivers/ide/icside.c b/drivers/ide/icside.c
index 4e16ce68b063..36da913cc553 100644
--- a/drivers/ide/icside.c
+++ b/drivers/ide/icside.c
@@ -466,7 +466,7 @@ icside_register_v6(struct icside_state *state, struct expansion_card *ec)
466 struct ide_host *host; 466 struct ide_host *host;
467 unsigned int sel = 0; 467 unsigned int sel = 0;
468 int ret; 468 int ret;
469 hw_regs_t hw[2], *hws[] = { &hw[0], NULL, NULL, NULL }; 469 hw_regs_t hw[2], *hws[] = { &hw[0], &hw[1], NULL, NULL };
470 struct ide_port_info d = icside_v6_port_info; 470 struct ide_port_info d = icside_v6_port_info;
471 471
472 ioc_base = ecardm_iomap(ec, ECARD_RES_IOCFAST, 0, 0); 472 ioc_base = ecardm_iomap(ec, ECARD_RES_IOCFAST, 0, 0);
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index cb942a9b580f..3a53e0834cf7 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -614,12 +614,6 @@ static ide_startstop_t ide_tape_issue_pc(ide_drive_t *drive,
614{ 614{
615 idetape_tape_t *tape = drive->driver_data; 615 idetape_tape_t *tape = drive->driver_data;
616 616
617 if (drive->pc->c[0] == REQUEST_SENSE &&
618 pc->c[0] == REQUEST_SENSE) {
619 printk(KERN_ERR "ide-tape: possible ide-tape.c bug - "
620 "Two request sense in serial were issued\n");
621 }
622
623 if (drive->failed_pc == NULL && pc->c[0] != REQUEST_SENSE) 617 if (drive->failed_pc == NULL && pc->c[0] != REQUEST_SENSE)
624 drive->failed_pc = pc; 618 drive->failed_pc = pc;
625 619
diff --git a/drivers/ide/piix.c b/drivers/ide/piix.c
index 2aa699933064..69860dea3820 100644
--- a/drivers/ide/piix.c
+++ b/drivers/ide/piix.c
@@ -263,6 +263,7 @@ static const struct ich_laptop ich_laptop[] = {
263 { 0x24CA, 0x1025, 0x003d }, /* ICH4 on ACER TM290 */ 263 { 0x24CA, 0x1025, 0x003d }, /* ICH4 on ACER TM290 */
264 { 0x266F, 0x1025, 0x0066 }, /* ICH6 on ACER Aspire 1694WLMi */ 264 { 0x266F, 0x1025, 0x0066 }, /* ICH6 on ACER Aspire 1694WLMi */
265 { 0x2653, 0x1043, 0x82D8 }, /* ICH6M on Asus Eee 701 */ 265 { 0x2653, 0x1043, 0x82D8 }, /* ICH6M on Asus Eee 701 */
266 { 0x27df, 0x104d, 0x900e }, /* ICH7 on Sony TZ-90 */
266 /* end marker */ 267 /* end marker */
267 { 0, } 268 { 0, }
268}; 269};
diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c
index eeafc6c0160d..bfc1a8892a32 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -269,16 +269,16 @@ static struct key_entry asus_keymap[] = {
269 {KE_KEY, 0x34, KEY_SWITCHVIDEOMODE}, 269 {KE_KEY, 0x34, KEY_SWITCHVIDEOMODE},
270 {KE_KEY, 0x40, KEY_PREVIOUSSONG}, 270 {KE_KEY, 0x40, KEY_PREVIOUSSONG},
271 {KE_KEY, 0x41, KEY_NEXTSONG}, 271 {KE_KEY, 0x41, KEY_NEXTSONG},
272 {KE_KEY, 0x43, KEY_STOP}, 272 {KE_KEY, 0x43, KEY_STOPCD},
273 {KE_KEY, 0x45, KEY_PLAYPAUSE}, 273 {KE_KEY, 0x45, KEY_PLAYPAUSE},
274 {KE_KEY, 0x50, KEY_EMAIL}, 274 {KE_KEY, 0x50, KEY_EMAIL},
275 {KE_KEY, 0x51, KEY_WWW}, 275 {KE_KEY, 0x51, KEY_WWW},
276 {KE_KEY, 0x5C, BTN_EXTRA}, /* Performance */ 276 {KE_KEY, 0x5C, KEY_SCREENLOCK}, /* Screenlock */
277 {KE_KEY, 0x5D, KEY_WLAN}, 277 {KE_KEY, 0x5D, KEY_WLAN},
278 {KE_KEY, 0x61, KEY_SWITCHVIDEOMODE}, 278 {KE_KEY, 0x61, KEY_SWITCHVIDEOMODE},
279 {KE_KEY, 0x6B, BTN_TOUCH}, /* Lock Mouse */ 279 {KE_KEY, 0x6B, BTN_TOUCH}, /* Lock Mouse */
280 {KE_KEY, 0x82, KEY_CAMERA}, 280 {KE_KEY, 0x82, KEY_CAMERA},
281 {KE_KEY, 0x8A, KEY_TV}, 281 {KE_KEY, 0x8A, KEY_PROG1},
282 {KE_KEY, 0x95, KEY_MEDIA}, 282 {KE_KEY, 0x95, KEY_MEDIA},
283 {KE_KEY, 0x99, KEY_PHONE}, 283 {KE_KEY, 0x99, KEY_PHONE},
284 {KE_END, 0}, 284 {KE_END, 0},
diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c
index 6f54fd1757cd..353a898c3693 100644
--- a/drivers/platform/x86/eeepc-laptop.c
+++ b/drivers/platform/x86/eeepc-laptop.c
@@ -158,6 +158,7 @@ enum { KE_KEY, KE_END };
158static struct key_entry eeepc_keymap[] = { 158static struct key_entry eeepc_keymap[] = {
159 /* Sleep already handled via generic ACPI code */ 159 /* Sleep already handled via generic ACPI code */
160 {KE_KEY, 0x10, KEY_WLAN }, 160 {KE_KEY, 0x10, KEY_WLAN },
161 {KE_KEY, 0x11, KEY_WLAN },
161 {KE_KEY, 0x12, KEY_PROG1 }, 162 {KE_KEY, 0x12, KEY_PROG1 },
162 {KE_KEY, 0x13, KEY_MUTE }, 163 {KE_KEY, 0x13, KEY_MUTE },
163 {KE_KEY, 0x14, KEY_VOLUMEDOWN }, 164 {KE_KEY, 0x14, KEY_VOLUMEDOWN },
@@ -166,6 +167,8 @@ static struct key_entry eeepc_keymap[] = {
166 {KE_KEY, 0x1b, KEY_ZOOM }, 167 {KE_KEY, 0x1b, KEY_ZOOM },
167 {KE_KEY, 0x1c, KEY_PROG2 }, 168 {KE_KEY, 0x1c, KEY_PROG2 },
168 {KE_KEY, 0x1d, KEY_PROG3 }, 169 {KE_KEY, 0x1d, KEY_PROG3 },
170 {KE_KEY, NOTIFY_BRN_MIN, KEY_BRIGHTNESSDOWN },
171 {KE_KEY, NOTIFY_BRN_MIN + 2, KEY_BRIGHTNESSUP },
169 {KE_KEY, 0x30, KEY_SWITCHVIDEOMODE }, 172 {KE_KEY, 0x30, KEY_SWITCHVIDEOMODE },
170 {KE_KEY, 0x31, KEY_SWITCHVIDEOMODE }, 173 {KE_KEY, 0x31, KEY_SWITCHVIDEOMODE },
171 {KE_KEY, 0x32, KEY_SWITCHVIDEOMODE }, 174 {KE_KEY, 0x32, KEY_SWITCHVIDEOMODE },
@@ -381,11 +384,13 @@ static ssize_t show_sys_acpi(int cm, char *buf)
381EEEPC_CREATE_DEVICE_ATTR(camera, CM_ASL_CAMERA); 384EEEPC_CREATE_DEVICE_ATTR(camera, CM_ASL_CAMERA);
382EEEPC_CREATE_DEVICE_ATTR(cardr, CM_ASL_CARDREADER); 385EEEPC_CREATE_DEVICE_ATTR(cardr, CM_ASL_CARDREADER);
383EEEPC_CREATE_DEVICE_ATTR(disp, CM_ASL_DISPLAYSWITCH); 386EEEPC_CREATE_DEVICE_ATTR(disp, CM_ASL_DISPLAYSWITCH);
387EEEPC_CREATE_DEVICE_ATTR(cpufv, CM_ASL_CPUFV);
384 388
385static struct attribute *platform_attributes[] = { 389static struct attribute *platform_attributes[] = {
386 &dev_attr_camera.attr, 390 &dev_attr_camera.attr,
387 &dev_attr_cardr.attr, 391 &dev_attr_cardr.attr,
388 &dev_attr_disp.attr, 392 &dev_attr_disp.attr,
393 &dev_attr_cpufv.attr,
389 NULL 394 NULL
390}; 395};
391 396
@@ -512,15 +517,21 @@ static int eeepc_hotk_check(void)
512 return 0; 517 return 0;
513} 518}
514 519
515static void notify_brn(void) 520static int notify_brn(void)
516{ 521{
522 /* returns the *previous* brightness, or -1 */
517 struct backlight_device *bd = eeepc_backlight_device; 523 struct backlight_device *bd = eeepc_backlight_device;
518 if (bd) 524 if (bd) {
525 int old = bd->props.brightness;
519 bd->props.brightness = read_brightness(bd); 526 bd->props.brightness = read_brightness(bd);
527 return old;
528 }
529 return -1;
520} 530}
521 531
522static void eeepc_rfkill_notify(acpi_handle handle, u32 event, void *data) 532static void eeepc_rfkill_notify(acpi_handle handle, u32 event, void *data)
523{ 533{
534 enum rfkill_state state;
524 struct pci_dev *dev; 535 struct pci_dev *dev;
525 struct pci_bus *bus = pci_find_bus(0, 1); 536 struct pci_bus *bus = pci_find_bus(0, 1);
526 537
@@ -532,7 +543,9 @@ static void eeepc_rfkill_notify(acpi_handle handle, u32 event, void *data)
532 return; 543 return;
533 } 544 }
534 545
535 if (get_acpi(CM_ASL_WLAN) == 1) { 546 eeepc_wlan_rfkill_state(ehotk->eeepc_wlan_rfkill, &state);
547
548 if (state == RFKILL_STATE_UNBLOCKED) {
536 dev = pci_get_slot(bus, 0); 549 dev = pci_get_slot(bus, 0);
537 if (dev) { 550 if (dev) {
538 /* Device already present */ 551 /* Device already present */
@@ -552,23 +565,41 @@ static void eeepc_rfkill_notify(acpi_handle handle, u32 event, void *data)
552 pci_dev_put(dev); 565 pci_dev_put(dev);
553 } 566 }
554 } 567 }
568
569 rfkill_force_state(ehotk->eeepc_wlan_rfkill, state);
555} 570}
556 571
557static void eeepc_hotk_notify(acpi_handle handle, u32 event, void *data) 572static void eeepc_hotk_notify(acpi_handle handle, u32 event, void *data)
558{ 573{
559 static struct key_entry *key; 574 static struct key_entry *key;
560 u16 count; 575 u16 count;
576 int brn = -ENODEV;
561 577
562 if (!ehotk) 578 if (!ehotk)
563 return; 579 return;
564 if (event >= NOTIFY_BRN_MIN && event <= NOTIFY_BRN_MAX) 580 if (event >= NOTIFY_BRN_MIN && event <= NOTIFY_BRN_MAX)
565 notify_brn(); 581 brn = notify_brn();
566 count = ehotk->event_count[event % 128]++; 582 count = ehotk->event_count[event % 128]++;
567 acpi_bus_generate_proc_event(ehotk->device, event, count); 583 acpi_bus_generate_proc_event(ehotk->device, event, count);
568 acpi_bus_generate_netlink_event(ehotk->device->pnp.device_class, 584 acpi_bus_generate_netlink_event(ehotk->device->pnp.device_class,
569 dev_name(&ehotk->device->dev), event, 585 dev_name(&ehotk->device->dev), event,
570 count); 586 count);
571 if (ehotk->inputdev) { 587 if (ehotk->inputdev) {
588 if (brn != -ENODEV) {
589 /* brightness-change events need special
590 * handling for conversion to key events
591 */
592 if (brn < 0)
593 brn = event;
594 else
595 brn += NOTIFY_BRN_MIN;
596 if (event < brn)
597 event = NOTIFY_BRN_MIN; /* brightness down */
598 else if (event > brn)
599 event = NOTIFY_BRN_MIN + 2; /* ... up */
600 else
601 event = NOTIFY_BRN_MIN + 1; /* ... unchanged */
602 }
572 key = eepc_get_entry_by_scancode(event); 603 key = eepc_get_entry_by_scancode(event);
573 if (key) { 604 if (key) {
574 switch (key->type) { 605 switch (key->type) {
@@ -649,6 +680,9 @@ static int eeepc_hotk_add(struct acpi_device *device)
649 if (ACPI_FAILURE(status)) 680 if (ACPI_FAILURE(status))
650 printk(EEEPC_ERR "Error installing notify handler\n"); 681 printk(EEEPC_ERR "Error installing notify handler\n");
651 682
683 eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P6");
684 eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P7");
685
652 if (get_acpi(CM_ASL_WLAN) != -1) { 686 if (get_acpi(CM_ASL_WLAN) != -1) {
653 ehotk->eeepc_wlan_rfkill = rfkill_allocate(&device->dev, 687 ehotk->eeepc_wlan_rfkill = rfkill_allocate(&device->dev,
654 RFKILL_TYPE_WLAN); 688 RFKILL_TYPE_WLAN);
@@ -704,9 +738,6 @@ static int eeepc_hotk_add(struct acpi_device *device)
704 goto bluetooth_fail; 738 goto bluetooth_fail;
705 } 739 }
706 740
707 eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P6");
708 eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P7");
709
710 return 0; 741 return 0;
711 742
712 bluetooth_fail: 743 bluetooth_fail:
@@ -717,6 +748,8 @@ static int eeepc_hotk_add(struct acpi_device *device)
717 wlan_fail: 748 wlan_fail:
718 if (ehotk->eeepc_wlan_rfkill) 749 if (ehotk->eeepc_wlan_rfkill)
719 rfkill_free(ehotk->eeepc_wlan_rfkill); 750 rfkill_free(ehotk->eeepc_wlan_rfkill);
751 eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P6");
752 eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P7");
720 ehotk_fail: 753 ehotk_fail:
721 kfree(ehotk); 754 kfree(ehotk);
722 ehotk = NULL; 755 ehotk = NULL;
diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c
index 9a3a682c6981..9496494f340e 100644
--- a/drivers/pnp/pnpacpi/core.c
+++ b/drivers/pnp/pnpacpi/core.c
@@ -110,11 +110,9 @@ static int pnpacpi_disable_resources(struct pnp_dev *dev)
110 110
111 /* acpi_unregister_gsi(pnp_irq(dev, 0)); */ 111 /* acpi_unregister_gsi(pnp_irq(dev, 0)); */
112 ret = 0; 112 ret = 0;
113 if (acpi_bus_power_manageable(handle)) { 113 if (acpi_bus_power_manageable(handle))
114 ret = acpi_bus_set_power(handle, ACPI_STATE_D3); 114 acpi_bus_set_power(handle, ACPI_STATE_D3);
115 if (ret) 115 /* continue even if acpi_bus_set_power() fails */
116 return ret;
117 }
118 if (ACPI_FAILURE(acpi_evaluate_object(handle, "_DIS", NULL, NULL))) 116 if (ACPI_FAILURE(acpi_evaluate_object(handle, "_DIS", NULL, NULL)))
119 ret = -ENODEV; 117 ret = -ENODEV;
120 return ret; 118 return ret;
diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c
index d0b093b66adc..5e38ba10a3a9 100644
--- a/drivers/thermal/thermal_sys.c
+++ b/drivers/thermal/thermal_sys.c
@@ -961,7 +961,7 @@ void thermal_zone_device_update(struct thermal_zone_device *tz)
961 961
962 switch (trip_type) { 962 switch (trip_type) {
963 case THERMAL_TRIP_CRITICAL: 963 case THERMAL_TRIP_CRITICAL:
964 if (temp > trip_temp) { 964 if (temp >= trip_temp) {
965 if (tz->ops->notify) 965 if (tz->ops->notify)
966 ret = tz->ops->notify(tz, count, 966 ret = tz->ops->notify(tz, count,
967 trip_type); 967 trip_type);
@@ -974,7 +974,7 @@ void thermal_zone_device_update(struct thermal_zone_device *tz)
974 } 974 }
975 break; 975 break;
976 case THERMAL_TRIP_HOT: 976 case THERMAL_TRIP_HOT:
977 if (temp > trip_temp) 977 if (temp >= trip_temp)
978 if (tz->ops->notify) 978 if (tz->ops->notify)
979 tz->ops->notify(tz, count, trip_type); 979 tz->ops->notify(tz, count, trip_type);
980 break; 980 break;
@@ -986,14 +986,14 @@ void thermal_zone_device_update(struct thermal_zone_device *tz)
986 986
987 cdev = instance->cdev; 987 cdev = instance->cdev;
988 988
989 if (temp > trip_temp) 989 if (temp >= trip_temp)
990 cdev->ops->set_cur_state(cdev, 1); 990 cdev->ops->set_cur_state(cdev, 1);
991 else 991 else
992 cdev->ops->set_cur_state(cdev, 0); 992 cdev->ops->set_cur_state(cdev, 0);
993 } 993 }
994 break; 994 break;
995 case THERMAL_TRIP_PASSIVE: 995 case THERMAL_TRIP_PASSIVE:
996 if (temp > trip_temp || tz->passive) 996 if (temp >= trip_temp || tz->passive)
997 thermal_zone_device_passive(tz, temp, 997 thermal_zone_device_passive(tz, temp,
998 trip_temp, count); 998 trip_temp, count);
999 break; 999 break;
diff --git a/kernel/panic.c b/kernel/panic.c
index 874ecf1307ae..984b3ecbd72c 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -340,39 +340,44 @@ void oops_exit(void)
340} 340}
341 341
342#ifdef WANT_WARN_ON_SLOWPATH 342#ifdef WANT_WARN_ON_SLOWPATH
343void warn_slowpath_fmt(const char *file, int line, const char *fmt, ...) 343struct slowpath_args {
344{ 344 const char *fmt;
345 va_list args; 345 va_list args;
346 char function[KSYM_SYMBOL_LEN]; 346};
347 unsigned long caller = (unsigned long)__builtin_return_address(0);
348 const char *board;
349 347
350 sprint_symbol(function, caller); 348static void warn_slowpath_common(const char *file, int line, void *caller, struct slowpath_args *args)
349{
350 const char *board;
351 351
352 printk(KERN_WARNING "------------[ cut here ]------------\n"); 352 printk(KERN_WARNING "------------[ cut here ]------------\n");
353 printk(KERN_WARNING "WARNING: at %s:%d %s()\n", file, 353 printk(KERN_WARNING "WARNING: at %s:%d %pS()\n", file, line, caller);
354 line, function);
355 board = dmi_get_system_info(DMI_PRODUCT_NAME); 354 board = dmi_get_system_info(DMI_PRODUCT_NAME);
356 if (board) 355 if (board)
357 printk(KERN_WARNING "Hardware name: %s\n", board); 356 printk(KERN_WARNING "Hardware name: %s\n", board);
358 357
359 if (*fmt) { 358 if (args)
360 va_start(args, fmt); 359 vprintk(args->fmt, args->args);
361 vprintk(fmt, args);
362 va_end(args);
363 }
364 360
365 print_modules(); 361 print_modules();
366 dump_stack(); 362 dump_stack();
367 print_oops_end_marker(); 363 print_oops_end_marker();
368 add_taint(TAINT_WARN); 364 add_taint(TAINT_WARN);
369} 365}
366
367void warn_slowpath_fmt(const char *file, int line, const char *fmt, ...)
368{
369 struct slowpath_args args;
370
371 args.fmt = fmt;
372 va_start(args.args, fmt);
373 warn_slowpath_common(file, line, __builtin_return_address(0), &args);
374 va_end(args.args);
375}
370EXPORT_SYMBOL(warn_slowpath_fmt); 376EXPORT_SYMBOL(warn_slowpath_fmt);
371 377
372void warn_slowpath_null(const char *file, int line) 378void warn_slowpath_null(const char *file, int line)
373{ 379{
374 static const char *empty = ""; 380 warn_slowpath_common(file, line, __builtin_return_address(0), NULL);
375 warn_slowpath_fmt(file, line, empty);
376} 381}
377EXPORT_SYMBOL(warn_slowpath_null); 382EXPORT_SYMBOL(warn_slowpath_null);
378#endif 383#endif