diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-06-01 15:06:21 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-06-01 15:06:21 -0400 |
commit | 3d58f48ba05caed9118bce62b3047f8683438835 (patch) | |
tree | 94c911034f0e14ded73d3e9e6e9f8e22b6cad822 /drivers/acpi | |
parent | abfe0af9813153bae8c85d9bac966bafcb8ddab1 (diff) | |
parent | d9244b5d2fbfe9fa540024b410047af13ceec90f (diff) |
Merge branch 'linus' into irq/numa
Conflicts:
arch/mips/sibyte/bcm1480/irq.c
arch/mips/sibyte/sb1250/irq.c
Merge reason: we gathered a few conflicts plus update to latest upstream fixes.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/acpica/Makefile | 27 | ||||
-rw-r--r-- | drivers/acpi/acpica/aclocal.h | 7 | ||||
-rw-r--r-- | drivers/acpi/bus.c | 2 | ||||
-rw-r--r-- | drivers/acpi/pci_bind.c | 24 | ||||
-rw-r--r-- | drivers/acpi/processor_idle.c | 50 | ||||
-rw-r--r-- | drivers/acpi/processor_perflib.c | 12 | ||||
-rw-r--r-- | drivers/acpi/processor_throttling.c | 25 | ||||
-rw-r--r-- | drivers/acpi/video.c | 56 |
8 files changed, 157 insertions, 46 deletions
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 @@ | |||
5 | ccflags-y := -Os | 5 | ccflags-y := -Os |
6 | ccflags-$(CONFIG_ACPI_DEBUG) += -DACPI_DEBUG_OUTPUT | 6 | ccflags-$(CONFIG_ACPI_DEBUG) += -DACPI_DEBUG_OUTPUT |
7 | 7 | ||
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 \ | ||
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 | ||
12 | obj-y += evevent.o evregion.o evsci.o evxfevnt.o \ | 15 | acpi-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 | ||
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\ |
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 | ||
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 |
22 | 25 | ||
23 | obj-$(ACPI_FUTURE_USAGE) += hwtimer.o | 26 | acpi-$(ACPI_FUTURE_USAGE) += hwtimer.o |
24 | 27 | ||
25 | obj-y += nsaccess.o nsload.o nssearch.o nsxfeval.o \ | 28 | acpi-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 | ||
30 | obj-$(ACPI_FUTURE_USAGE) += nsdumpdv.o | 33 | acpi-$(ACPI_FUTURE_USAGE) += nsdumpdv.o |
31 | 34 | ||
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 \ |
33 | psopcode.o psscope.o psutils.o psxface.o | 36 | psopcode.o psscope.o psutils.o psxface.o |
34 | 37 | ||
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 \ |
36 | rscalc.o rsirq.o rsmemory.o rsutils.o | 39 | rscalc.o rsirq.o rsmemory.o rsutils.o |
37 | 40 | ||
38 | obj-$(ACPI_FUTURE_USAGE) += rsdump.o | 41 | acpi-$(ACPI_FUTURE_USAGE) += rsdump.o |
39 | 42 | ||
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 |
41 | 44 | ||
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 \ |
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/pci_bind.c b/drivers/acpi/pci_bind.c index 95650f83ce2e..bc46de3d967f 100644 --- a/drivers/acpi/pci_bind.c +++ b/drivers/acpi/pci_bind.c | |||
@@ -116,9 +116,6 @@ int acpi_pci_bind(struct acpi_device *device) | |||
116 | struct acpi_pci_data *pdata; | 116 | struct acpi_pci_data *pdata; |
117 | struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; | 117 | struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; |
118 | acpi_handle handle; | 118 | acpi_handle handle; |
119 | struct pci_dev *dev; | ||
120 | struct pci_bus *bus; | ||
121 | |||
122 | 119 | ||
123 | if (!device || !device->parent) | 120 | if (!device || !device->parent) |
124 | return -EINVAL; | 121 | return -EINVAL; |
@@ -176,20 +173,9 @@ int acpi_pci_bind(struct acpi_device *device) | |||
176 | * Locate matching device in PCI namespace. If it doesn't exist | 173 | * Locate matching device in PCI namespace. If it doesn't exist |
177 | * this typically means that the device isn't currently inserted | 174 | * this typically means that the device isn't currently inserted |
178 | * (e.g. docking station, port replicator, etc.). | 175 | * (e.g. docking station, port replicator, etc.). |
179 | * We cannot simply search the global pci device list, since | ||
180 | * PCI devices are added to the global pci list when the root | ||
181 | * bridge start ops are run, which may not have happened yet. | ||
182 | */ | 176 | */ |
183 | bus = pci_find_bus(data->id.segment, data->id.bus); | 177 | data->dev = pci_get_slot(pdata->bus, |
184 | if (bus) { | 178 | PCI_DEVFN(data->id.device, data->id.function)); |
185 | list_for_each_entry(dev, &bus->devices, bus_list) { | ||
186 | if (dev->devfn == PCI_DEVFN(data->id.device, | ||
187 | data->id.function)) { | ||
188 | data->dev = dev; | ||
189 | break; | ||
190 | } | ||
191 | } | ||
192 | } | ||
193 | if (!data->dev) { | 179 | if (!data->dev) { |
194 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 180 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
195 | "Device %04x:%02x:%02x.%d not present in PCI namespace\n", | 181 | "Device %04x:%02x:%02x.%d not present in PCI namespace\n", |
@@ -259,9 +245,10 @@ int acpi_pci_bind(struct acpi_device *device) | |||
259 | 245 | ||
260 | end: | 246 | end: |
261 | kfree(buffer.pointer); | 247 | kfree(buffer.pointer); |
262 | if (result) | 248 | if (result) { |
249 | pci_dev_put(data->dev); | ||
263 | kfree(data); | 250 | kfree(data); |
264 | 251 | } | |
265 | return result; | 252 | return result; |
266 | } | 253 | } |
267 | 254 | ||
@@ -303,6 +290,7 @@ static int acpi_pci_unbind(struct acpi_device *device) | |||
303 | if (data->dev->subordinate) { | 290 | if (data->dev->subordinate) { |
304 | acpi_pci_irq_del_prt(data->id.segment, data->bus->number); | 291 | acpi_pci_irq_del_prt(data->id.segment, data->bus->number); |
305 | } | 292 | } |
293 | pci_dev_put(data->dev); | ||
306 | kfree(data); | 294 | kfree(data); |
307 | 295 | ||
308 | end: | 296 | end: |
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index f7ca8c55956b..10a2d913635a 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
@@ -148,6 +148,9 @@ static void acpi_timer_check_state(int state, struct acpi_processor *pr, | |||
148 | if (cpu_has(&cpu_data(pr->id), X86_FEATURE_ARAT)) | 148 | if (cpu_has(&cpu_data(pr->id), X86_FEATURE_ARAT)) |
149 | return; | 149 | return; |
150 | 150 | ||
151 | if (boot_cpu_has(X86_FEATURE_AMDC1E)) | ||
152 | type = ACPI_STATE_C1; | ||
153 | |||
151 | /* | 154 | /* |
152 | * Check, if one of the previous states already marked the lapic | 155 | * Check, if one of the previous states already marked the lapic |
153 | * unstable | 156 | * unstable |
@@ -202,21 +205,44 @@ static void acpi_state_timer_broadcast(struct acpi_processor *pr, | |||
202 | * Suspend / resume control | 205 | * Suspend / resume control |
203 | */ | 206 | */ |
204 | static int acpi_idle_suspend; | 207 | static int acpi_idle_suspend; |
208 | static u32 saved_bm_rld; | ||
209 | |||
210 | static void acpi_idle_bm_rld_save(void) | ||
211 | { | ||
212 | acpi_read_bit_register(ACPI_BITREG_BUS_MASTER_RLD, &saved_bm_rld); | ||
213 | } | ||
214 | static void acpi_idle_bm_rld_restore(void) | ||
215 | { | ||
216 | u32 resumed_bm_rld; | ||
217 | |||
218 | acpi_read_bit_register(ACPI_BITREG_BUS_MASTER_RLD, &resumed_bm_rld); | ||
219 | |||
220 | if (resumed_bm_rld != saved_bm_rld) | ||
221 | acpi_write_bit_register(ACPI_BITREG_BUS_MASTER_RLD, saved_bm_rld); | ||
222 | } | ||
205 | 223 | ||
206 | int acpi_processor_suspend(struct acpi_device * device, pm_message_t state) | 224 | int acpi_processor_suspend(struct acpi_device * device, pm_message_t state) |
207 | { | 225 | { |
226 | if (acpi_idle_suspend == 1) | ||
227 | return 0; | ||
228 | |||
229 | acpi_idle_bm_rld_save(); | ||
208 | acpi_idle_suspend = 1; | 230 | acpi_idle_suspend = 1; |
209 | return 0; | 231 | return 0; |
210 | } | 232 | } |
211 | 233 | ||
212 | int acpi_processor_resume(struct acpi_device * device) | 234 | int acpi_processor_resume(struct acpi_device * device) |
213 | { | 235 | { |
236 | if (acpi_idle_suspend == 0) | ||
237 | return 0; | ||
238 | |||
239 | acpi_idle_bm_rld_restore(); | ||
214 | acpi_idle_suspend = 0; | 240 | acpi_idle_suspend = 0; |
215 | return 0; | 241 | return 0; |
216 | } | 242 | } |
217 | 243 | ||
218 | #if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86) | 244 | #if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86) |
219 | static int tsc_halts_in_c(int state) | 245 | static void tsc_check_state(int state) |
220 | { | 246 | { |
221 | switch (boot_cpu_data.x86_vendor) { | 247 | switch (boot_cpu_data.x86_vendor) { |
222 | case X86_VENDOR_AMD: | 248 | case X86_VENDOR_AMD: |
@@ -226,13 +252,17 @@ static int tsc_halts_in_c(int state) | |||
226 | * C/P/S0/S1 states when this bit is set. | 252 | * C/P/S0/S1 states when this bit is set. |
227 | */ | 253 | */ |
228 | if (boot_cpu_has(X86_FEATURE_NONSTOP_TSC)) | 254 | if (boot_cpu_has(X86_FEATURE_NONSTOP_TSC)) |
229 | return 0; | 255 | return; |
230 | 256 | ||
231 | /*FALL THROUGH*/ | 257 | /*FALL THROUGH*/ |
232 | default: | 258 | default: |
233 | return state > ACPI_STATE_C1; | 259 | /* TSC could halt in idle, so notify users */ |
260 | if (state > ACPI_STATE_C1) | ||
261 | mark_tsc_unstable("TSC halts in idle"); | ||
234 | } | 262 | } |
235 | } | 263 | } |
264 | #else | ||
265 | static void tsc_check_state(int state) { return; } | ||
236 | #endif | 266 | #endif |
237 | 267 | ||
238 | static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr) | 268 | static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr) |
@@ -578,17 +608,13 @@ static int acpi_processor_power_verify(struct acpi_processor *pr) | |||
578 | 608 | ||
579 | pr->power.timer_broadcast_on_state = INT_MAX; | 609 | pr->power.timer_broadcast_on_state = INT_MAX; |
580 | 610 | ||
581 | for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) { | 611 | for (i = 1; i < ACPI_PROCESSOR_MAX_POWER && i <= max_cstate; i++) { |
582 | struct acpi_processor_cx *cx = &pr->power.states[i]; | 612 | struct acpi_processor_cx *cx = &pr->power.states[i]; |
583 | 613 | ||
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) { | 614 | switch (cx->type) { |
590 | case ACPI_STATE_C1: | 615 | case ACPI_STATE_C1: |
591 | cx->valid = 1; | 616 | cx->valid = 1; |
617 | acpi_timer_check_state(i, pr, cx); | ||
592 | break; | 618 | break; |
593 | 619 | ||
594 | case ACPI_STATE_C2: | 620 | case ACPI_STATE_C2: |
@@ -603,6 +629,8 @@ static int acpi_processor_power_verify(struct acpi_processor *pr) | |||
603 | acpi_timer_check_state(i, pr, cx); | 629 | acpi_timer_check_state(i, pr, cx); |
604 | break; | 630 | break; |
605 | } | 631 | } |
632 | if (cx->valid) | ||
633 | tsc_check_state(cx->type); | ||
606 | 634 | ||
607 | if (cx->valid) | 635 | if (cx->valid) |
608 | working++; | 636 | working++; |
@@ -806,11 +834,12 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev, | |||
806 | 834 | ||
807 | /* Do not access any ACPI IO ports in suspend path */ | 835 | /* Do not access any ACPI IO ports in suspend path */ |
808 | if (acpi_idle_suspend) { | 836 | if (acpi_idle_suspend) { |
809 | acpi_safe_halt(); | ||
810 | local_irq_enable(); | 837 | local_irq_enable(); |
838 | cpu_relax(); | ||
811 | return 0; | 839 | return 0; |
812 | } | 840 | } |
813 | 841 | ||
842 | acpi_state_timer_broadcast(pr, cx, 1); | ||
814 | kt1 = ktime_get_real(); | 843 | kt1 = ktime_get_real(); |
815 | acpi_idle_do_entry(cx); | 844 | acpi_idle_do_entry(cx); |
816 | kt2 = ktime_get_real(); | 845 | kt2 = ktime_get_real(); |
@@ -818,6 +847,7 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev, | |||
818 | 847 | ||
819 | local_irq_enable(); | 848 | local_irq_enable(); |
820 | cx->usage++; | 849 | cx->usage++; |
850 | acpi_state_timer_broadcast(pr, cx, 0); | ||
821 | 851 | ||
822 | return idle_time; | 852 | return idle_time; |
823 | } | 853 | } |
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c index cafb41000f6b..60e543d3234e 100644 --- a/drivers/acpi/processor_perflib.c +++ b/drivers/acpi/processor_perflib.c | |||
@@ -309,9 +309,15 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr) | |||
309 | (u32) px->bus_master_latency, | 309 | (u32) px->bus_master_latency, |
310 | (u32) px->control, (u32) px->status)); | 310 | (u32) px->control, (u32) px->status)); |
311 | 311 | ||
312 | if (!px->core_frequency) { | 312 | /* |
313 | printk(KERN_ERR PREFIX | 313 | * Check that ACPI's u64 MHz will be valid as u32 KHz in cpufreq |
314 | "Invalid _PSS data: freq is zero\n"); | 314 | */ |
315 | if (!px->core_frequency || | ||
316 | ((u32)(px->core_frequency * 1000) != | ||
317 | (px->core_frequency * 1000))) { | ||
318 | printk(KERN_ERR FW_BUG PREFIX | ||
319 | "Invalid BIOS _PSS frequency: 0x%llx MHz\n", | ||
320 | px->core_frequency); | ||
315 | result = -EFAULT; | 321 | result = -EFAULT; |
316 | kfree(pr->performance->states); | 322 | kfree(pr->performance->states); |
317 | goto end; | 323 | goto end; |
diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c index d0d1f4d50434..227543789ba9 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 |
46 | ACPI_MODULE_NAME("processor_throttling"); | 46 | ACPI_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 | */ | ||
52 | static int ignore_tpc; | ||
53 | module_param(ignore_tpc, int, 0644); | ||
54 | MODULE_PARM_DESC(ignore_tpc, "Disable broken BIOS _TPC throttling support"); | ||
55 | |||
48 | struct throttling_tstate { | 56 | struct 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 | |||
306 | end: | ||
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")); | ||
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..1bdfb37377e3 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c | |||
@@ -538,6 +538,57 @@ 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 | |||
546 | static int bqc_offset_aml_bug_workaround; | ||
547 | static 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 | |||
553 | static 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 | .callback = video_set_bqc_offset, | ||
575 | .ident = "eMachines E510", | ||
576 | .matches = { | ||
577 | DMI_MATCH(DMI_BOARD_VENDOR, "EMACHINES"), | ||
578 | DMI_MATCH(DMI_PRODUCT_NAME, "eMachines E510"), | ||
579 | }, | ||
580 | }, | ||
581 | { | ||
582 | .callback = video_set_bqc_offset, | ||
583 | .ident = "Acer Aspire 5315", | ||
584 | .matches = { | ||
585 | DMI_MATCH(DMI_BOARD_VENDOR, "Acer"), | ||
586 | DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5315"), | ||
587 | }, | ||
588 | }, | ||
589 | {} | ||
590 | }; | ||
591 | |||
541 | static int | 592 | static int |
542 | acpi_video_device_lcd_get_level_current(struct acpi_video_device *device, | 593 | acpi_video_device_lcd_get_level_current(struct acpi_video_device *device, |
543 | unsigned long long *level) | 594 | unsigned long long *level) |
@@ -557,6 +608,7 @@ acpi_video_device_lcd_get_level_current(struct acpi_video_device *device, | |||
557 | *level = device->brightness->levels[*level + 2]; | 608 | *level = device->brightness->levels[*level + 2]; |
558 | 609 | ||
559 | } | 610 | } |
611 | *level += bqc_offset_aml_bug_workaround; | ||
560 | device->brightness->curr = *level; | 612 | device->brightness->curr = *level; |
561 | return 0; | 613 | return 0; |
562 | } else { | 614 | } else { |
@@ -2290,13 +2342,15 @@ EXPORT_SYMBOL(acpi_video_register); | |||
2290 | 2342 | ||
2291 | static int __init acpi_video_init(void) | 2343 | static int __init acpi_video_init(void) |
2292 | { | 2344 | { |
2345 | dmi_check_system(video_dmi_table); | ||
2346 | |||
2293 | if (intel_opregion_present()) | 2347 | if (intel_opregion_present()) |
2294 | return 0; | 2348 | return 0; |
2295 | 2349 | ||
2296 | return acpi_video_register(); | 2350 | return acpi_video_register(); |
2297 | } | 2351 | } |
2298 | 2352 | ||
2299 | void __exit acpi_video_exit(void) | 2353 | void acpi_video_exit(void) |
2300 | { | 2354 | { |
2301 | 2355 | ||
2302 | acpi_bus_unregister_driver(&acpi_video_bus); | 2356 | acpi_bus_unregister_driver(&acpi_video_bus); |