diff options
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/bay.c | 3 | ||||
-rw-r--r-- | drivers/acpi/dock.c | 3 | ||||
-rw-r--r-- | drivers/acpi/fan.c | 10 | ||||
-rw-r--r-- | drivers/acpi/glue.c | 9 | ||||
-rw-r--r-- | drivers/acpi/namespace/nsnames.c | 8 | ||||
-rw-r--r-- | drivers/acpi/pci_link.c | 31 | ||||
-rw-r--r-- | drivers/acpi/pci_slot.c | 5 | ||||
-rw-r--r-- | drivers/acpi/processor_core.c | 5 | ||||
-rw-r--r-- | drivers/acpi/processor_idle.c | 6 | ||||
-rw-r--r-- | drivers/acpi/processor_throttling.c | 17 | ||||
-rw-r--r-- | drivers/acpi/scan.c | 2 | ||||
-rw-r--r-- | drivers/acpi/sleep/main.c | 42 | ||||
-rw-r--r-- | drivers/acpi/system.c | 1 | ||||
-rw-r--r-- | drivers/acpi/tables/tbfadt.c | 17 | ||||
-rw-r--r-- | drivers/acpi/thermal.c | 47 | ||||
-rw-r--r-- | drivers/acpi/utilities/utalloc.c | 4 | ||||
-rw-r--r-- | drivers/acpi/video.c | 19 |
17 files changed, 170 insertions, 59 deletions
diff --git a/drivers/acpi/bay.c b/drivers/acpi/bay.c index e6caf5d42e0e..61b6c5beb2d3 100644 --- a/drivers/acpi/bay.c +++ b/drivers/acpi/bay.c | |||
@@ -380,9 +380,6 @@ static int __init bay_init(void) | |||
380 | if (acpi_disabled) | 380 | if (acpi_disabled) |
381 | return -ENODEV; | 381 | return -ENODEV; |
382 | 382 | ||
383 | if (acpi_disabled) | ||
384 | return -ENODEV; | ||
385 | |||
386 | /* look for dockable drive bays */ | 383 | /* look for dockable drive bays */ |
387 | acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, | 384 | acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, |
388 | ACPI_UINT32_MAX, find_bay, &bays, NULL); | 385 | ACPI_UINT32_MAX, find_bay, &bays, NULL); |
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c index 1e872e79db33..bb7c51f712bd 100644 --- a/drivers/acpi/dock.c +++ b/drivers/acpi/dock.c | |||
@@ -920,9 +920,6 @@ static int __init dock_init(void) | |||
920 | if (acpi_disabled) | 920 | if (acpi_disabled) |
921 | return 0; | 921 | return 0; |
922 | 922 | ||
923 | if (acpi_disabled) | ||
924 | return 0; | ||
925 | |||
926 | /* look for a dock station */ | 923 | /* look for a dock station */ |
927 | acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, | 924 | acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, |
928 | ACPI_UINT32_MAX, find_dock, &num, NULL); | 925 | ACPI_UINT32_MAX, find_dock, &num, NULL); |
diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c index 55c17afbe669..2655bc1b4eeb 100644 --- a/drivers/acpi/fan.c +++ b/drivers/acpi/fan.c | |||
@@ -263,22 +263,22 @@ static int acpi_fan_add(struct acpi_device *device) | |||
263 | goto end; | 263 | goto end; |
264 | } | 264 | } |
265 | 265 | ||
266 | printk(KERN_INFO PREFIX | 266 | dev_info(&device->dev, "registered as cooling_device%d\n", cdev->id); |
267 | "%s is registered as cooling_device%d\n", | ||
268 | device->dev.bus_id, cdev->id); | ||
269 | 267 | ||
270 | acpi_driver_data(device) = cdev; | 268 | acpi_driver_data(device) = cdev; |
271 | result = sysfs_create_link(&device->dev.kobj, | 269 | result = sysfs_create_link(&device->dev.kobj, |
272 | &cdev->device.kobj, | 270 | &cdev->device.kobj, |
273 | "thermal_cooling"); | 271 | "thermal_cooling"); |
274 | if (result) | 272 | if (result) |
275 | printk(KERN_ERR PREFIX "Create sysfs link\n"); | 273 | dev_err(&device->dev, "Failed to create sysfs link " |
274 | "'thermal_cooling'\n"); | ||
276 | 275 | ||
277 | result = sysfs_create_link(&cdev->device.kobj, | 276 | result = sysfs_create_link(&cdev->device.kobj, |
278 | &device->dev.kobj, | 277 | &device->dev.kobj, |
279 | "device"); | 278 | "device"); |
280 | if (result) | 279 | if (result) |
281 | printk(KERN_ERR PREFIX "Create sysfs link\n"); | 280 | dev_err(&device->dev, "Failed to create sysfs link " |
281 | "'device'\n"); | ||
282 | 282 | ||
283 | result = acpi_fan_add_fs(device); | 283 | result = acpi_fan_add_fs(device); |
284 | if (result) | 284 | if (result) |
diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c index 0f2dd81736bd..084109507c9f 100644 --- a/drivers/acpi/glue.c +++ b/drivers/acpi/glue.c | |||
@@ -146,8 +146,7 @@ static int acpi_bind_one(struct device *dev, acpi_handle handle) | |||
146 | acpi_status status; | 146 | acpi_status status; |
147 | 147 | ||
148 | if (dev->archdata.acpi_handle) { | 148 | if (dev->archdata.acpi_handle) { |
149 | printk(KERN_WARNING PREFIX | 149 | dev_warn(dev, "Drivers changed 'acpi_handle'\n"); |
150 | "Drivers changed 'acpi_handle' for %s\n", dev->bus_id); | ||
151 | return -EINVAL; | 150 | return -EINVAL; |
152 | } | 151 | } |
153 | get_device(dev); | 152 | get_device(dev); |
@@ -195,8 +194,7 @@ static int acpi_unbind_one(struct device *dev) | |||
195 | /* acpi_bind_one increase refcnt by one */ | 194 | /* acpi_bind_one increase refcnt by one */ |
196 | put_device(dev); | 195 | put_device(dev); |
197 | } else { | 196 | } else { |
198 | printk(KERN_ERR PREFIX | 197 | dev_err(dev, "Oops, 'acpi_handle' corrupt\n"); |
199 | "Oops, 'acpi_handle' corrupt for %s\n", dev->bus_id); | ||
200 | } | 198 | } |
201 | return 0; | 199 | return 0; |
202 | } | 200 | } |
@@ -338,9 +336,6 @@ static int __init acpi_rtc_init(void) | |||
338 | if (acpi_disabled) | 336 | if (acpi_disabled) |
339 | return 0; | 337 | return 0; |
340 | 338 | ||
341 | if (acpi_disabled) | ||
342 | return 0; | ||
343 | |||
344 | if (dev) { | 339 | if (dev) { |
345 | rtc_wake_setup(); | 340 | rtc_wake_setup(); |
346 | rtc_info.wake_on = rtc_wake_on; | 341 | rtc_info.wake_on = rtc_wake_on; |
diff --git a/drivers/acpi/namespace/nsnames.c b/drivers/acpi/namespace/nsnames.c index cffef1bcbdbc..549db42f16cf 100644 --- a/drivers/acpi/namespace/nsnames.c +++ b/drivers/acpi/namespace/nsnames.c | |||
@@ -137,6 +137,10 @@ char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node) | |||
137 | /* Calculate required buffer size based on depth below root */ | 137 | /* Calculate required buffer size based on depth below root */ |
138 | 138 | ||
139 | size = acpi_ns_get_pathname_length(node); | 139 | size = acpi_ns_get_pathname_length(node); |
140 | if (!size) { | ||
141 | ACPI_ERROR((AE_INFO, "Invalid node failure")); | ||
142 | return_PTR(NULL); | ||
143 | } | ||
140 | 144 | ||
141 | /* Allocate a buffer to be returned to caller */ | 145 | /* Allocate a buffer to be returned to caller */ |
142 | 146 | ||
@@ -229,6 +233,10 @@ acpi_ns_handle_to_pathname(acpi_handle target_handle, | |||
229 | /* Determine size required for the caller buffer */ | 233 | /* Determine size required for the caller buffer */ |
230 | 234 | ||
231 | required_size = acpi_ns_get_pathname_length(node); | 235 | required_size = acpi_ns_get_pathname_length(node); |
236 | if (!required_size) { | ||
237 | ACPI_ERROR((AE_INFO, "Invalid node failure")); | ||
238 | return_ACPI_STATUS(AE_ERROR); | ||
239 | } | ||
232 | 240 | ||
233 | /* Validate/Allocate/Clear caller buffer */ | 241 | /* Validate/Allocate/Clear caller buffer */ |
234 | 242 | ||
diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c index 233c40c51684..89f3b2abfdc7 100644 --- a/drivers/acpi/pci_link.c +++ b/drivers/acpi/pci_link.c | |||
@@ -113,20 +113,23 @@ acpi_pci_link_check_possible(struct acpi_resource *resource, void *context) | |||
113 | 113 | ||
114 | switch (resource->type) { | 114 | switch (resource->type) { |
115 | case ACPI_RESOURCE_TYPE_START_DEPENDENT: | 115 | case ACPI_RESOURCE_TYPE_START_DEPENDENT: |
116 | case ACPI_RESOURCE_TYPE_END_TAG: | ||
116 | return AE_OK; | 117 | return AE_OK; |
117 | case ACPI_RESOURCE_TYPE_IRQ: | 118 | case ACPI_RESOURCE_TYPE_IRQ: |
118 | { | 119 | { |
119 | struct acpi_resource_irq *p = &resource->data.irq; | 120 | struct acpi_resource_irq *p = &resource->data.irq; |
120 | if (!p || !p->interrupt_count) { | 121 | if (!p || !p->interrupt_count) { |
121 | printk(KERN_WARNING PREFIX "Blank IRQ resource\n"); | 122 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
123 | "Blank _PRS IRQ resource\n")); | ||
122 | return AE_OK; | 124 | return AE_OK; |
123 | } | 125 | } |
124 | for (i = 0; | 126 | for (i = 0; |
125 | (i < p->interrupt_count | 127 | (i < p->interrupt_count |
126 | && i < ACPI_PCI_LINK_MAX_POSSIBLE); i++) { | 128 | && i < ACPI_PCI_LINK_MAX_POSSIBLE); i++) { |
127 | if (!p->interrupts[i]) { | 129 | if (!p->interrupts[i]) { |
128 | printk(KERN_WARNING PREFIX "Invalid IRQ %d\n", | 130 | printk(KERN_WARNING PREFIX |
129 | p->interrupts[i]); | 131 | "Invalid _PRS IRQ %d\n", |
132 | p->interrupts[i]); | ||
130 | continue; | 133 | continue; |
131 | } | 134 | } |
132 | link->irq.possible[i] = p->interrupts[i]; | 135 | link->irq.possible[i] = p->interrupts[i]; |
@@ -143,15 +146,16 @@ acpi_pci_link_check_possible(struct acpi_resource *resource, void *context) | |||
143 | &resource->data.extended_irq; | 146 | &resource->data.extended_irq; |
144 | if (!p || !p->interrupt_count) { | 147 | if (!p || !p->interrupt_count) { |
145 | printk(KERN_WARNING PREFIX | 148 | printk(KERN_WARNING PREFIX |
146 | "Blank EXT IRQ resource\n"); | 149 | "Blank _PRS EXT IRQ resource\n"); |
147 | return AE_OK; | 150 | return AE_OK; |
148 | } | 151 | } |
149 | for (i = 0; | 152 | for (i = 0; |
150 | (i < p->interrupt_count | 153 | (i < p->interrupt_count |
151 | && i < ACPI_PCI_LINK_MAX_POSSIBLE); i++) { | 154 | && i < ACPI_PCI_LINK_MAX_POSSIBLE); i++) { |
152 | if (!p->interrupts[i]) { | 155 | if (!p->interrupts[i]) { |
153 | printk(KERN_WARNING PREFIX "Invalid IRQ %d\n", | 156 | printk(KERN_WARNING PREFIX |
154 | p->interrupts[i]); | 157 | "Invalid _PRS IRQ %d\n", |
158 | p->interrupts[i]); | ||
155 | continue; | 159 | continue; |
156 | } | 160 | } |
157 | link->irq.possible[i] = p->interrupts[i]; | 161 | link->irq.possible[i] = p->interrupts[i]; |
@@ -163,7 +167,8 @@ acpi_pci_link_check_possible(struct acpi_resource *resource, void *context) | |||
163 | break; | 167 | break; |
164 | } | 168 | } |
165 | default: | 169 | default: |
166 | printk(KERN_ERR PREFIX "Resource is not an IRQ entry\n"); | 170 | printk(KERN_ERR PREFIX "_PRS resource type 0x%x isn't an IRQ\n", |
171 | resource->type); | ||
167 | return AE_OK; | 172 | return AE_OK; |
168 | } | 173 | } |
169 | 174 | ||
@@ -199,6 +204,9 @@ acpi_pci_link_check_current(struct acpi_resource *resource, void *context) | |||
199 | 204 | ||
200 | 205 | ||
201 | switch (resource->type) { | 206 | switch (resource->type) { |
207 | case ACPI_RESOURCE_TYPE_START_DEPENDENT: | ||
208 | case ACPI_RESOURCE_TYPE_END_TAG: | ||
209 | return AE_OK; | ||
202 | case ACPI_RESOURCE_TYPE_IRQ: | 210 | case ACPI_RESOURCE_TYPE_IRQ: |
203 | { | 211 | { |
204 | struct acpi_resource_irq *p = &resource->data.irq; | 212 | struct acpi_resource_irq *p = &resource->data.irq; |
@@ -208,7 +216,7 @@ acpi_pci_link_check_current(struct acpi_resource *resource, void *context) | |||
208 | * particularly those those w/ _STA disabled | 216 | * particularly those those w/ _STA disabled |
209 | */ | 217 | */ |
210 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 218 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
211 | "Blank IRQ resource\n")); | 219 | "Blank _CRS IRQ resource\n")); |
212 | return AE_OK; | 220 | return AE_OK; |
213 | } | 221 | } |
214 | *irq = p->interrupts[0]; | 222 | *irq = p->interrupts[0]; |
@@ -224,7 +232,7 @@ acpi_pci_link_check_current(struct acpi_resource *resource, void *context) | |||
224 | * return at least 1 IRQ | 232 | * return at least 1 IRQ |
225 | */ | 233 | */ |
226 | printk(KERN_WARNING PREFIX | 234 | printk(KERN_WARNING PREFIX |
227 | "Blank EXT IRQ resource\n"); | 235 | "Blank _CRS EXT IRQ resource\n"); |
228 | return AE_OK; | 236 | return AE_OK; |
229 | } | 237 | } |
230 | *irq = p->interrupts[0]; | 238 | *irq = p->interrupts[0]; |
@@ -232,10 +240,11 @@ acpi_pci_link_check_current(struct acpi_resource *resource, void *context) | |||
232 | } | 240 | } |
233 | break; | 241 | break; |
234 | default: | 242 | default: |
235 | printk(KERN_ERR PREFIX "Resource %d isn't an IRQ\n", resource->type); | 243 | printk(KERN_ERR PREFIX "_CRS resource type 0x%x isn't an IRQ\n", |
236 | case ACPI_RESOURCE_TYPE_END_TAG: | 244 | resource->type); |
237 | return AE_OK; | 245 | return AE_OK; |
238 | } | 246 | } |
247 | |||
239 | return AE_CTRL_TERMINATE; | 248 | return AE_CTRL_TERMINATE; |
240 | } | 249 | } |
241 | 250 | ||
diff --git a/drivers/acpi/pci_slot.c b/drivers/acpi/pci_slot.c index b9ab030a52d5..dd376f7ad090 100644 --- a/drivers/acpi/pci_slot.c +++ b/drivers/acpi/pci_slot.c | |||
@@ -6,8 +6,8 @@ | |||
6 | * Thanks to Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> for code | 6 | * Thanks to Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> for code |
7 | * review and fixes. | 7 | * review and fixes. |
8 | * | 8 | * |
9 | * Copyright (C) 2007 Alex Chiang <achiang@hp.com> | 9 | * Copyright (C) 2007-2008 Hewlett-Packard Development Company, L.P. |
10 | * Copyright (C) 2007 Hewlett-Packard Development Company, L.P. | 10 | * Alex Chiang <achiang@hp.com> |
11 | * | 11 | * |
12 | * This program is free software; you can redistribute it and/or modify it | 12 | * This program is free software; you can redistribute it and/or modify it |
13 | * under the terms and conditions of the GNU General Public License, | 13 | * under the terms and conditions of the GNU General Public License, |
@@ -158,6 +158,7 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv) | |||
158 | if (IS_ERR(pci_slot)) { | 158 | if (IS_ERR(pci_slot)) { |
159 | err("pci_create_slot returned %ld\n", PTR_ERR(pci_slot)); | 159 | err("pci_create_slot returned %ld\n", PTR_ERR(pci_slot)); |
160 | kfree(slot); | 160 | kfree(slot); |
161 | return AE_OK; | ||
161 | } | 162 | } |
162 | 163 | ||
163 | slot->root_handle = parent_context->root_handle; | 164 | slot->root_handle = parent_context->root_handle; |
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c index ec0f2d581ece..e36422a7122c 100644 --- a/drivers/acpi/processor_core.c +++ b/drivers/acpi/processor_core.c | |||
@@ -714,9 +714,8 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device) | |||
714 | goto end; | 714 | goto end; |
715 | } | 715 | } |
716 | 716 | ||
717 | printk(KERN_INFO PREFIX | 717 | dev_info(&device->dev, "registered as cooling_device%d\n", |
718 | "%s is registered as cooling_device%d\n", | 718 | pr->cdev->id); |
719 | device->dev.bus_id, pr->cdev->id); | ||
720 | 719 | ||
721 | result = sysfs_create_link(&device->dev.kobj, | 720 | result = sysfs_create_link(&device->dev.kobj, |
722 | &pr->cdev->device.kobj, | 721 | &pr->cdev->device.kobj, |
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index d592dbb1d12a..b7f2963693a7 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
@@ -272,6 +272,8 @@ static atomic_t c3_cpu_count; | |||
272 | /* Common C-state entry for C2, C3, .. */ | 272 | /* Common C-state entry for C2, C3, .. */ |
273 | static void acpi_cstate_enter(struct acpi_processor_cx *cstate) | 273 | static void acpi_cstate_enter(struct acpi_processor_cx *cstate) |
274 | { | 274 | { |
275 | /* Don't trace irqs off for idle */ | ||
276 | stop_critical_timings(); | ||
275 | if (cstate->entry_method == ACPI_CSTATE_FFH) { | 277 | if (cstate->entry_method == ACPI_CSTATE_FFH) { |
276 | /* Call into architectural FFH based C-state */ | 278 | /* Call into architectural FFH based C-state */ |
277 | acpi_processor_ffh_cstate_enter(cstate); | 279 | acpi_processor_ffh_cstate_enter(cstate); |
@@ -284,6 +286,7 @@ static void acpi_cstate_enter(struct acpi_processor_cx *cstate) | |||
284 | gets asserted in time to freeze execution properly. */ | 286 | gets asserted in time to freeze execution properly. */ |
285 | unused = inl(acpi_gbl_FADT.xpm_timer_block.address); | 287 | unused = inl(acpi_gbl_FADT.xpm_timer_block.address); |
286 | } | 288 | } |
289 | start_critical_timings(); | ||
287 | } | 290 | } |
288 | #endif /* !CONFIG_CPU_IDLE */ | 291 | #endif /* !CONFIG_CPU_IDLE */ |
289 | 292 | ||
@@ -1418,6 +1421,8 @@ static inline void acpi_idle_update_bm_rld(struct acpi_processor *pr, | |||
1418 | */ | 1421 | */ |
1419 | static inline void acpi_idle_do_entry(struct acpi_processor_cx *cx) | 1422 | static inline void acpi_idle_do_entry(struct acpi_processor_cx *cx) |
1420 | { | 1423 | { |
1424 | /* Don't trace irqs off for idle */ | ||
1425 | stop_critical_timings(); | ||
1421 | if (cx->entry_method == ACPI_CSTATE_FFH) { | 1426 | if (cx->entry_method == ACPI_CSTATE_FFH) { |
1422 | /* Call into architectural FFH based C-state */ | 1427 | /* Call into architectural FFH based C-state */ |
1423 | acpi_processor_ffh_cstate_enter(cx); | 1428 | acpi_processor_ffh_cstate_enter(cx); |
@@ -1432,6 +1437,7 @@ static inline void acpi_idle_do_entry(struct acpi_processor_cx *cx) | |||
1432 | gets asserted in time to freeze execution properly. */ | 1437 | gets asserted in time to freeze execution properly. */ |
1433 | unused = inl(acpi_gbl_FADT.xpm_timer_block.address); | 1438 | unused = inl(acpi_gbl_FADT.xpm_timer_block.address); |
1434 | } | 1439 | } |
1440 | start_critical_timings(); | ||
1435 | } | 1441 | } |
1436 | 1442 | ||
1437 | /** | 1443 | /** |
diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c index 0622ace05220..a2c3f9cfa549 100644 --- a/drivers/acpi/processor_throttling.c +++ b/drivers/acpi/processor_throttling.c | |||
@@ -827,6 +827,7 @@ static int acpi_processor_get_throttling_ptc(struct acpi_processor *pr) | |||
827 | static int acpi_processor_get_throttling(struct acpi_processor *pr) | 827 | static int acpi_processor_get_throttling(struct acpi_processor *pr) |
828 | { | 828 | { |
829 | cpumask_t saved_mask; | 829 | cpumask_t saved_mask; |
830 | cpumask_of_cpu_ptr_declare(new_mask); | ||
830 | int ret; | 831 | int ret; |
831 | 832 | ||
832 | if (!pr) | 833 | if (!pr) |
@@ -838,7 +839,8 @@ static int acpi_processor_get_throttling(struct acpi_processor *pr) | |||
838 | * Migrate task to the cpu pointed by pr. | 839 | * Migrate task to the cpu pointed by pr. |
839 | */ | 840 | */ |
840 | saved_mask = current->cpus_allowed; | 841 | saved_mask = current->cpus_allowed; |
841 | set_cpus_allowed_ptr(current, &cpumask_of_cpu(pr->id)); | 842 | cpumask_of_cpu_ptr_next(new_mask, pr->id); |
843 | set_cpus_allowed_ptr(current, new_mask); | ||
842 | ret = pr->throttling.acpi_processor_get_throttling(pr); | 844 | ret = pr->throttling.acpi_processor_get_throttling(pr); |
843 | /* restore the previous state */ | 845 | /* restore the previous state */ |
844 | set_cpus_allowed_ptr(current, &saved_mask); | 846 | set_cpus_allowed_ptr(current, &saved_mask); |
@@ -987,6 +989,7 @@ static int acpi_processor_set_throttling_ptc(struct acpi_processor *pr, | |||
987 | int acpi_processor_set_throttling(struct acpi_processor *pr, int state) | 989 | int acpi_processor_set_throttling(struct acpi_processor *pr, int state) |
988 | { | 990 | { |
989 | cpumask_t saved_mask; | 991 | cpumask_t saved_mask; |
992 | cpumask_of_cpu_ptr_declare(new_mask); | ||
990 | int ret = 0; | 993 | int ret = 0; |
991 | unsigned int i; | 994 | unsigned int i; |
992 | struct acpi_processor *match_pr; | 995 | struct acpi_processor *match_pr; |
@@ -1013,7 +1016,7 @@ int acpi_processor_set_throttling(struct acpi_processor *pr, int state) | |||
1013 | * affected cpu in order to get one proper T-state. | 1016 | * affected cpu in order to get one proper T-state. |
1014 | * The notifier event is THROTTLING_PRECHANGE. | 1017 | * The notifier event is THROTTLING_PRECHANGE. |
1015 | */ | 1018 | */ |
1016 | for_each_cpu_mask(i, online_throttling_cpus) { | 1019 | for_each_cpu_mask_nr(i, online_throttling_cpus) { |
1017 | t_state.cpu = i; | 1020 | t_state.cpu = i; |
1018 | acpi_processor_throttling_notifier(THROTTLING_PRECHANGE, | 1021 | acpi_processor_throttling_notifier(THROTTLING_PRECHANGE, |
1019 | &t_state); | 1022 | &t_state); |
@@ -1025,7 +1028,8 @@ int acpi_processor_set_throttling(struct acpi_processor *pr, int state) | |||
1025 | * it can be called only for the cpu pointed by pr. | 1028 | * it can be called only for the cpu pointed by pr. |
1026 | */ | 1029 | */ |
1027 | if (p_throttling->shared_type == DOMAIN_COORD_TYPE_SW_ANY) { | 1030 | if (p_throttling->shared_type == DOMAIN_COORD_TYPE_SW_ANY) { |
1028 | set_cpus_allowed_ptr(current, &cpumask_of_cpu(pr->id)); | 1031 | cpumask_of_cpu_ptr_next(new_mask, pr->id); |
1032 | set_cpus_allowed_ptr(current, new_mask); | ||
1029 | ret = p_throttling->acpi_processor_set_throttling(pr, | 1033 | ret = p_throttling->acpi_processor_set_throttling(pr, |
1030 | t_state.target_state); | 1034 | t_state.target_state); |
1031 | } else { | 1035 | } else { |
@@ -1034,7 +1038,7 @@ int acpi_processor_set_throttling(struct acpi_processor *pr, int state) | |||
1034 | * it is necessary to set T-state for every affected | 1038 | * it is necessary to set T-state for every affected |
1035 | * cpus. | 1039 | * cpus. |
1036 | */ | 1040 | */ |
1037 | for_each_cpu_mask(i, online_throttling_cpus) { | 1041 | for_each_cpu_mask_nr(i, online_throttling_cpus) { |
1038 | match_pr = per_cpu(processors, i); | 1042 | match_pr = per_cpu(processors, i); |
1039 | /* | 1043 | /* |
1040 | * If the pointer is invalid, we will report the | 1044 | * If the pointer is invalid, we will report the |
@@ -1056,7 +1060,8 @@ int acpi_processor_set_throttling(struct acpi_processor *pr, int state) | |||
1056 | continue; | 1060 | continue; |
1057 | } | 1061 | } |
1058 | t_state.cpu = i; | 1062 | t_state.cpu = i; |
1059 | set_cpus_allowed_ptr(current, &cpumask_of_cpu(i)); | 1063 | cpumask_of_cpu_ptr_next(new_mask, i); |
1064 | set_cpus_allowed_ptr(current, new_mask); | ||
1060 | ret = match_pr->throttling. | 1065 | ret = match_pr->throttling. |
1061 | acpi_processor_set_throttling( | 1066 | acpi_processor_set_throttling( |
1062 | match_pr, t_state.target_state); | 1067 | match_pr, t_state.target_state); |
@@ -1068,7 +1073,7 @@ int acpi_processor_set_throttling(struct acpi_processor *pr, int state) | |||
1068 | * affected cpu to update the T-states. | 1073 | * affected cpu to update the T-states. |
1069 | * The notifier event is THROTTLING_POSTCHANGE | 1074 | * The notifier event is THROTTLING_POSTCHANGE |
1070 | */ | 1075 | */ |
1071 | for_each_cpu_mask(i, online_throttling_cpus) { | 1076 | for_each_cpu_mask_nr(i, online_throttling_cpus) { |
1072 | t_state.cpu = i; | 1077 | t_state.cpu = i; |
1073 | acpi_processor_throttling_notifier(THROTTLING_POSTCHANGE, | 1078 | acpi_processor_throttling_notifier(THROTTLING_POSTCHANGE, |
1074 | &t_state); | 1079 | &t_state); |
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index f3132aa47a69..f6f52c1a2aba 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
@@ -471,7 +471,7 @@ static int acpi_device_register(struct acpi_device *device, | |||
471 | device->dev.release = &acpi_device_release; | 471 | device->dev.release = &acpi_device_release; |
472 | result = device_add(&device->dev); | 472 | result = device_add(&device->dev); |
473 | if(result) { | 473 | if(result) { |
474 | printk(KERN_ERR PREFIX "Error adding device %s", device->dev.bus_id); | 474 | dev_err(&device->dev, "Error adding device\n"); |
475 | goto end; | 475 | goto end; |
476 | } | 476 | } |
477 | 477 | ||
diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c index 0489a7d1d42c..d13194a031bf 100644 --- a/drivers/acpi/sleep/main.c +++ b/drivers/acpi/sleep/main.c | |||
@@ -280,9 +280,36 @@ static struct platform_suspend_ops acpi_suspend_ops_old = { | |||
280 | .end = acpi_pm_end, | 280 | .end = acpi_pm_end, |
281 | .recover = acpi_pm_finish, | 281 | .recover = acpi_pm_finish, |
282 | }; | 282 | }; |
283 | |||
284 | static int __init init_old_suspend_ordering(const struct dmi_system_id *d) | ||
285 | { | ||
286 | old_suspend_ordering = true; | ||
287 | return 0; | ||
288 | } | ||
289 | |||
290 | static struct dmi_system_id __initdata acpisleep_dmi_table[] = { | ||
291 | { | ||
292 | .callback = init_old_suspend_ordering, | ||
293 | .ident = "Abit KN9 (nForce4 variant)", | ||
294 | .matches = { | ||
295 | DMI_MATCH(DMI_BOARD_VENDOR, "http://www.abit.com.tw/"), | ||
296 | DMI_MATCH(DMI_BOARD_NAME, "KN9 Series(NF-CK804)"), | ||
297 | }, | ||
298 | }, | ||
299 | {}, | ||
300 | }; | ||
283 | #endif /* CONFIG_SUSPEND */ | 301 | #endif /* CONFIG_SUSPEND */ |
284 | 302 | ||
285 | #ifdef CONFIG_HIBERNATION | 303 | #ifdef CONFIG_HIBERNATION |
304 | static unsigned long s4_hardware_signature; | ||
305 | static struct acpi_table_facs *facs; | ||
306 | static bool nosigcheck; | ||
307 | |||
308 | void __init acpi_no_s4_hw_signature(void) | ||
309 | { | ||
310 | nosigcheck = true; | ||
311 | } | ||
312 | |||
286 | static int acpi_hibernation_begin(void) | 313 | static int acpi_hibernation_begin(void) |
287 | { | 314 | { |
288 | acpi_target_sleep_state = ACPI_STATE_S4; | 315 | acpi_target_sleep_state = ACPI_STATE_S4; |
@@ -316,6 +343,12 @@ static void acpi_hibernation_leave(void) | |||
316 | acpi_enable(); | 343 | acpi_enable(); |
317 | /* Reprogram control registers and execute _BFS */ | 344 | /* Reprogram control registers and execute _BFS */ |
318 | acpi_leave_sleep_state_prep(ACPI_STATE_S4); | 345 | acpi_leave_sleep_state_prep(ACPI_STATE_S4); |
346 | /* Check the hardware signature */ | ||
347 | if (facs && s4_hardware_signature != facs->hardware_signature) { | ||
348 | printk(KERN_EMERG "ACPI: Hardware changed while hibernated, " | ||
349 | "cannot resume!\n"); | ||
350 | panic("ACPI S4 hardware signature mismatch"); | ||
351 | } | ||
319 | } | 352 | } |
320 | 353 | ||
321 | static void acpi_pm_enable_gpes(void) | 354 | static void acpi_pm_enable_gpes(void) |
@@ -516,6 +549,8 @@ int __init acpi_sleep_init(void) | |||
516 | u8 type_a, type_b; | 549 | u8 type_a, type_b; |
517 | #ifdef CONFIG_SUSPEND | 550 | #ifdef CONFIG_SUSPEND |
518 | int i = 0; | 551 | int i = 0; |
552 | |||
553 | dmi_check_system(acpisleep_dmi_table); | ||
519 | #endif | 554 | #endif |
520 | 555 | ||
521 | if (acpi_disabled) | 556 | if (acpi_disabled) |
@@ -544,6 +579,13 @@ int __init acpi_sleep_init(void) | |||
544 | &acpi_hibernation_ops_old : &acpi_hibernation_ops); | 579 | &acpi_hibernation_ops_old : &acpi_hibernation_ops); |
545 | sleep_states[ACPI_STATE_S4] = 1; | 580 | sleep_states[ACPI_STATE_S4] = 1; |
546 | printk(" S4"); | 581 | printk(" S4"); |
582 | if (!nosigcheck) { | ||
583 | acpi_get_table_by_index(ACPI_TABLE_INDEX_FACS, | ||
584 | (struct acpi_table_header **)&facs); | ||
585 | if (facs) | ||
586 | s4_hardware_signature = | ||
587 | facs->hardware_signature; | ||
588 | } | ||
547 | } | 589 | } |
548 | #endif | 590 | #endif |
549 | status = acpi_get_sleep_type_data(ACPI_STATE_S5, &type_a, &type_b); | 591 | status = acpi_get_sleep_type_data(ACPI_STATE_S5, &type_a, &type_b); |
diff --git a/drivers/acpi/system.c b/drivers/acpi/system.c index d8e3f153b295..91dec448b3ed 100644 --- a/drivers/acpi/system.c +++ b/drivers/acpi/system.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/proc_fs.h> | 26 | #include <linux/proc_fs.h> |
27 | #include <linux/seq_file.h> | 27 | #include <linux/seq_file.h> |
28 | #include <linux/init.h> | 28 | #include <linux/init.h> |
29 | #include <linux/string.h> | ||
29 | #include <asm/uaccess.h> | 30 | #include <asm/uaccess.h> |
30 | 31 | ||
31 | #include <acpi/acpi_drivers.h> | 32 | #include <acpi/acpi_drivers.h> |
diff --git a/drivers/acpi/tables/tbfadt.c b/drivers/acpi/tables/tbfadt.c index ccb5b64bbef3..a4a41ba2484b 100644 --- a/drivers/acpi/tables/tbfadt.c +++ b/drivers/acpi/tables/tbfadt.c | |||
@@ -124,7 +124,7 @@ static struct acpi_fadt_info fadt_info_table[] = { | |||
124 | 124 | ||
125 | static void inline | 125 | static void inline |
126 | acpi_tb_init_generic_address(struct acpi_generic_address *generic_address, | 126 | acpi_tb_init_generic_address(struct acpi_generic_address *generic_address, |
127 | u8 byte_width, u64 address) | 127 | u8 bit_width, u64 address) |
128 | { | 128 | { |
129 | 129 | ||
130 | /* | 130 | /* |
@@ -136,7 +136,7 @@ acpi_tb_init_generic_address(struct acpi_generic_address *generic_address, | |||
136 | /* All other fields are byte-wide */ | 136 | /* All other fields are byte-wide */ |
137 | 137 | ||
138 | generic_address->space_id = ACPI_ADR_SPACE_SYSTEM_IO; | 138 | generic_address->space_id = ACPI_ADR_SPACE_SYSTEM_IO; |
139 | generic_address->bit_width = byte_width << 3; | 139 | generic_address->bit_width = bit_width; |
140 | generic_address->bit_offset = 0; | 140 | generic_address->bit_offset = 0; |
141 | generic_address->access_width = 0; | 141 | generic_address->access_width = 0; |
142 | } | 142 | } |
@@ -343,11 +343,9 @@ static void acpi_tb_convert_fadt(void) | |||
343 | * | 343 | * |
344 | * The PM event blocks are split into two register blocks, first is the | 344 | * The PM event blocks are split into two register blocks, first is the |
345 | * PM Status Register block, followed immediately by the PM Enable Register | 345 | * PM Status Register block, followed immediately by the PM Enable Register |
346 | * block. Each is of length (xpm1x_event_block.bit_width/2) | 346 | * block. Each is of length (pm1_event_length/2) |
347 | */ | 347 | */ |
348 | WARN_ON(ACPI_MOD_16(acpi_gbl_FADT.xpm1a_event_block.bit_width)); | 348 | pm1_register_length = (u8) ACPI_DIV_2(acpi_gbl_FADT.pm1_event_length); |
349 | pm1_register_length = (u8) ACPI_DIV_16(acpi_gbl_FADT | ||
350 | .xpm1a_event_block.bit_width); | ||
351 | 349 | ||
352 | /* The PM1A register block is required */ | 350 | /* The PM1A register block is required */ |
353 | 351 | ||
@@ -362,17 +360,14 @@ static void acpi_tb_convert_fadt(void) | |||
362 | /* The PM1B register block is optional, ignore if not present */ | 360 | /* The PM1B register block is optional, ignore if not present */ |
363 | 361 | ||
364 | if (acpi_gbl_FADT.xpm1b_event_block.address) { | 362 | if (acpi_gbl_FADT.xpm1b_event_block.address) { |
365 | WARN_ON(ACPI_MOD_16(acpi_gbl_FADT.xpm1b_event_block.bit_width)); | ||
366 | pm1_register_length = (u8) ACPI_DIV_16(acpi_gbl_FADT | ||
367 | .xpm1b_event_block | ||
368 | .bit_width); | ||
369 | acpi_tb_init_generic_address(&acpi_gbl_xpm1b_enable, | 363 | acpi_tb_init_generic_address(&acpi_gbl_xpm1b_enable, |
370 | pm1_register_length, | 364 | pm1_register_length, |
371 | (acpi_gbl_FADT.xpm1b_event_block. | 365 | (acpi_gbl_FADT.xpm1b_event_block. |
372 | address + pm1_register_length)); | 366 | address + pm1_register_length)); |
373 | /* Don't forget to copy space_id of the GAS */ | 367 | /* Don't forget to copy space_id of the GAS */ |
374 | acpi_gbl_xpm1b_enable.space_id = | 368 | acpi_gbl_xpm1b_enable.space_id = |
375 | acpi_gbl_FADT.xpm1b_event_block.space_id; | 369 | acpi_gbl_FADT.xpm1a_event_block.space_id; |
370 | |||
376 | } | 371 | } |
377 | } | 372 | } |
378 | 373 | ||
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 84c795fb9b1e..912703691d36 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c | |||
@@ -769,6 +769,47 @@ static void acpi_thermal_run(unsigned long data) | |||
769 | acpi_os_execute(OSL_GPE_HANDLER, acpi_thermal_check, (void *)data); | 769 | acpi_os_execute(OSL_GPE_HANDLER, acpi_thermal_check, (void *)data); |
770 | } | 770 | } |
771 | 771 | ||
772 | static void acpi_thermal_active_off(void *data) | ||
773 | { | ||
774 | int result = 0; | ||
775 | struct acpi_thermal *tz = data; | ||
776 | int i = 0; | ||
777 | int j = 0; | ||
778 | struct acpi_thermal_active *active = NULL; | ||
779 | |||
780 | if (!tz) { | ||
781 | printk(KERN_ERR PREFIX "Invalid (NULL) context\n"); | ||
782 | return; | ||
783 | } | ||
784 | |||
785 | result = acpi_thermal_get_temperature(tz); | ||
786 | if (result) | ||
787 | return; | ||
788 | |||
789 | for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++) { | ||
790 | active = &(tz->trips.active[i]); | ||
791 | if (!active || !active->flags.valid) | ||
792 | break; | ||
793 | if (tz->temperature >= active->temperature) { | ||
794 | /* | ||
795 | * If the thermal temperature is greater than the | ||
796 | * active threshod, unnecessary to turn off the | ||
797 | * the active cooling device. | ||
798 | */ | ||
799 | continue; | ||
800 | } | ||
801 | /* | ||
802 | * Below Threshold? | ||
803 | * ---------------- | ||
804 | * Turn OFF all cooling devices associated with this | ||
805 | * threshold. | ||
806 | */ | ||
807 | for (j = 0; j < active->devices.count; j++) | ||
808 | result = acpi_bus_set_power(active->devices.handles[j], | ||
809 | ACPI_STATE_D3); | ||
810 | } | ||
811 | } | ||
812 | |||
772 | static void acpi_thermal_check(void *data) | 813 | static void acpi_thermal_check(void *data) |
773 | { | 814 | { |
774 | int result = 0; | 815 | int result = 0; |
@@ -1179,8 +1220,8 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz) | |||
1179 | 1220 | ||
1180 | tz->tz_enabled = 1; | 1221 | tz->tz_enabled = 1; |
1181 | 1222 | ||
1182 | printk(KERN_INFO PREFIX "%s is registered as thermal_zone%d\n", | 1223 | dev_info(&tz->device->dev, "registered as thermal_zone%d\n", |
1183 | tz->device->dev.bus_id, tz->thermal_zone->id); | 1224 | tz->thermal_zone->id); |
1184 | return 0; | 1225 | return 0; |
1185 | } | 1226 | } |
1186 | 1227 | ||
@@ -1624,6 +1665,8 @@ static int acpi_thermal_add(struct acpi_device *device) | |||
1624 | 1665 | ||
1625 | init_timer(&tz->timer); | 1666 | init_timer(&tz->timer); |
1626 | 1667 | ||
1668 | acpi_thermal_active_off(tz); | ||
1669 | |||
1627 | acpi_thermal_check(tz); | 1670 | acpi_thermal_check(tz); |
1628 | 1671 | ||
1629 | status = acpi_install_notify_handler(device->handle, | 1672 | status = acpi_install_notify_handler(device->handle, |
diff --git a/drivers/acpi/utilities/utalloc.c b/drivers/acpi/utilities/utalloc.c index 3dfb8a442b26..e7bf34a7b1d2 100644 --- a/drivers/acpi/utilities/utalloc.c +++ b/drivers/acpi/utilities/utalloc.c | |||
@@ -242,6 +242,10 @@ acpi_ut_initialize_buffer(struct acpi_buffer * buffer, | |||
242 | { | 242 | { |
243 | acpi_status status = AE_OK; | 243 | acpi_status status = AE_OK; |
244 | 244 | ||
245 | if (!required_length) { | ||
246 | WARN_ON(1); | ||
247 | return AE_ERROR; | ||
248 | } | ||
245 | switch (buffer->length) { | 249 | switch (buffer->length) { |
246 | case ACPI_NO_BUFFER: | 250 | case ACPI_NO_BUFFER: |
247 | 251 | ||
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index 64c889331f3b..e8a51a1700f7 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c | |||
@@ -741,7 +741,7 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device) | |||
741 | 741 | ||
742 | max_level = acpi_video_init_brightness(device); | 742 | max_level = acpi_video_init_brightness(device); |
743 | 743 | ||
744 | if (device->cap._BCL && device->cap._BCM && device->cap._BQC && max_level > 0){ | 744 | if (device->cap._BCL && device->cap._BCM && max_level > 0) { |
745 | int result; | 745 | int result; |
746 | static int count = 0; | 746 | static int count = 0; |
747 | char *name; | 747 | char *name; |
@@ -753,7 +753,17 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device) | |||
753 | device->backlight = backlight_device_register(name, | 753 | device->backlight = backlight_device_register(name, |
754 | NULL, device, &acpi_backlight_ops); | 754 | NULL, device, &acpi_backlight_ops); |
755 | device->backlight->props.max_brightness = device->brightness->count-3; | 755 | device->backlight->props.max_brightness = device->brightness->count-3; |
756 | device->backlight->props.brightness = acpi_video_get_brightness(device->backlight); | 756 | /* |
757 | * If there exists the _BQC object, the _BQC object will be | ||
758 | * called to get the current backlight brightness. Otherwise | ||
759 | * the brightness will be set to the maximum. | ||
760 | */ | ||
761 | if (device->cap._BQC) | ||
762 | device->backlight->props.brightness = | ||
763 | acpi_video_get_brightness(device->backlight); | ||
764 | else | ||
765 | device->backlight->props.brightness = | ||
766 | device->backlight->props.max_brightness; | ||
757 | backlight_update_status(device->backlight); | 767 | backlight_update_status(device->backlight); |
758 | kfree(name); | 768 | kfree(name); |
759 | 769 | ||
@@ -762,9 +772,8 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device) | |||
762 | if (IS_ERR(device->cdev)) | 772 | if (IS_ERR(device->cdev)) |
763 | return; | 773 | return; |
764 | 774 | ||
765 | printk(KERN_INFO PREFIX | 775 | dev_info(&device->dev->dev, "registered as cooling_device%d\n", |
766 | "%s is registered as cooling_device%d\n", | 776 | device->cdev->id); |
767 | device->dev->dev.bus_id, device->cdev->id); | ||
768 | result = sysfs_create_link(&device->dev->dev.kobj, | 777 | result = sysfs_create_link(&device->dev->dev.kobj, |
769 | &device->cdev->device.kobj, | 778 | &device->cdev->device.kobj, |
770 | "thermal_cooling"); | 779 | "thermal_cooling"); |