diff options
author | David S. Miller <davem@davemloft.net> | 2009-08-12 20:44:53 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-08-12 20:44:53 -0400 |
commit | aa11d958d1a6572eda08214d7c6a735804fe48a5 (patch) | |
tree | d025b05270ad1e010660d17eeadc6ac3c1abbd7d /drivers/acpi | |
parent | 07f6642ee9418e962e54cbc07471cfe2e559c568 (diff) | |
parent | 9799218ae36910af50f002a5db1802d576fffb43 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
arch/microblaze/include/asm/socket.h
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/acpi_memhotplug.c | 34 | ||||
-rw-r--r-- | drivers/acpi/acpica/acobject.h | 1 | ||||
-rw-r--r-- | drivers/acpi/acpica/dsopcode.c | 24 | ||||
-rw-r--r-- | drivers/acpi/acpica/exfldio.c | 6 | ||||
-rw-r--r-- | drivers/acpi/osl.c | 25 | ||||
-rw-r--r-- | drivers/acpi/sleep.c | 8 | ||||
-rw-r--r-- | drivers/acpi/system.c | 2 |
7 files changed, 90 insertions, 10 deletions
diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c index 7a0f4aa4fa1e..9a62224cc278 100644 --- a/drivers/acpi/acpi_memhotplug.c +++ b/drivers/acpi/acpi_memhotplug.c | |||
@@ -38,6 +38,9 @@ | |||
38 | 38 | ||
39 | #define _COMPONENT ACPI_MEMORY_DEVICE_COMPONENT | 39 | #define _COMPONENT ACPI_MEMORY_DEVICE_COMPONENT |
40 | 40 | ||
41 | #undef PREFIX | ||
42 | #define PREFIX "ACPI:memory_hp:" | ||
43 | |||
41 | ACPI_MODULE_NAME("acpi_memhotplug"); | 44 | ACPI_MODULE_NAME("acpi_memhotplug"); |
42 | MODULE_AUTHOR("Naveen B S <naveen.b.s@intel.com>"); | 45 | MODULE_AUTHOR("Naveen B S <naveen.b.s@intel.com>"); |
43 | MODULE_DESCRIPTION("Hotplug Mem Driver"); | 46 | MODULE_DESCRIPTION("Hotplug Mem Driver"); |
@@ -153,6 +156,7 @@ acpi_memory_get_device(acpi_handle handle, | |||
153 | acpi_handle phandle; | 156 | acpi_handle phandle; |
154 | struct acpi_device *device = NULL; | 157 | struct acpi_device *device = NULL; |
155 | struct acpi_device *pdevice = NULL; | 158 | struct acpi_device *pdevice = NULL; |
159 | int result; | ||
156 | 160 | ||
157 | 161 | ||
158 | if (!acpi_bus_get_device(handle, &device) && device) | 162 | if (!acpi_bus_get_device(handle, &device) && device) |
@@ -165,9 +169,9 @@ acpi_memory_get_device(acpi_handle handle, | |||
165 | } | 169 | } |
166 | 170 | ||
167 | /* Get the parent device */ | 171 | /* Get the parent device */ |
168 | status = acpi_bus_get_device(phandle, &pdevice); | 172 | result = acpi_bus_get_device(phandle, &pdevice); |
169 | if (ACPI_FAILURE(status)) { | 173 | if (result) { |
170 | ACPI_EXCEPTION((AE_INFO, status, "Cannot get acpi bus device")); | 174 | printk(KERN_WARNING PREFIX "Cannot get acpi bus device"); |
171 | return -EINVAL; | 175 | return -EINVAL; |
172 | } | 176 | } |
173 | 177 | ||
@@ -175,9 +179,9 @@ acpi_memory_get_device(acpi_handle handle, | |||
175 | * Now add the notified device. This creates the acpi_device | 179 | * Now add the notified device. This creates the acpi_device |
176 | * and invokes .add function | 180 | * and invokes .add function |
177 | */ | 181 | */ |
178 | status = acpi_bus_add(&device, pdevice, handle, ACPI_BUS_TYPE_DEVICE); | 182 | result = acpi_bus_add(&device, pdevice, handle, ACPI_BUS_TYPE_DEVICE); |
179 | if (ACPI_FAILURE(status)) { | 183 | if (result) { |
180 | ACPI_EXCEPTION((AE_INFO, status, "Cannot add acpi bus")); | 184 | printk(KERN_WARNING PREFIX "Cannot add acpi bus"); |
181 | return -EINVAL; | 185 | return -EINVAL; |
182 | } | 186 | } |
183 | 187 | ||
@@ -238,7 +242,12 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device) | |||
238 | num_enabled++; | 242 | num_enabled++; |
239 | continue; | 243 | continue; |
240 | } | 244 | } |
241 | 245 | /* | |
246 | * If the memory block size is zero, please ignore it. | ||
247 | * Don't try to do the following memory hotplug flowchart. | ||
248 | */ | ||
249 | if (!info->length) | ||
250 | continue; | ||
242 | if (node < 0) | 251 | if (node < 0) |
243 | node = memory_add_physaddr_to_nid(info->start_addr); | 252 | node = memory_add_physaddr_to_nid(info->start_addr); |
244 | 253 | ||
@@ -253,8 +262,15 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device) | |||
253 | mem_device->state = MEMORY_INVALID_STATE; | 262 | mem_device->state = MEMORY_INVALID_STATE; |
254 | return -EINVAL; | 263 | return -EINVAL; |
255 | } | 264 | } |
256 | 265 | /* | |
257 | return result; | 266 | * Sometimes the memory device will contain several memory blocks. |
267 | * When one memory block is hot-added to the system memory, it will | ||
268 | * be regarded as a success. | ||
269 | * Otherwise if the last memory block can't be hot-added to the system | ||
270 | * memory, it will be failure and the memory device can't be bound with | ||
271 | * driver. | ||
272 | */ | ||
273 | return 0; | ||
258 | } | 274 | } |
259 | 275 | ||
260 | static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device) | 276 | static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device) |
diff --git a/drivers/acpi/acpica/acobject.h b/drivers/acpi/acpica/acobject.h index 544dcf834922..eb6f038b03d9 100644 --- a/drivers/acpi/acpica/acobject.h +++ b/drivers/acpi/acpica/acobject.h | |||
@@ -97,6 +97,7 @@ | |||
97 | #define AOPOBJ_OBJECT_INITIALIZED 0x08 | 97 | #define AOPOBJ_OBJECT_INITIALIZED 0x08 |
98 | #define AOPOBJ_SETUP_COMPLETE 0x10 | 98 | #define AOPOBJ_SETUP_COMPLETE 0x10 |
99 | #define AOPOBJ_SINGLE_DATUM 0x20 | 99 | #define AOPOBJ_SINGLE_DATUM 0x20 |
100 | #define AOPOBJ_INVALID 0x40 /* Used if host OS won't allow an op_region address */ | ||
100 | 101 | ||
101 | /****************************************************************************** | 102 | /****************************************************************************** |
102 | * | 103 | * |
diff --git a/drivers/acpi/acpica/dsopcode.c b/drivers/acpi/acpica/dsopcode.c index 584d766e6f12..b79978f7bc71 100644 --- a/drivers/acpi/acpica/dsopcode.c +++ b/drivers/acpi/acpica/dsopcode.c | |||
@@ -397,6 +397,30 @@ acpi_status acpi_ds_get_region_arguments(union acpi_operand_object *obj_desc) | |||
397 | status = acpi_ds_execute_arguments(node, acpi_ns_get_parent_node(node), | 397 | status = acpi_ds_execute_arguments(node, acpi_ns_get_parent_node(node), |
398 | extra_desc->extra.aml_length, | 398 | extra_desc->extra.aml_length, |
399 | extra_desc->extra.aml_start); | 399 | extra_desc->extra.aml_start); |
400 | if (ACPI_FAILURE(status)) { | ||
401 | return_ACPI_STATUS(status); | ||
402 | } | ||
403 | |||
404 | /* Validate the region address/length via the host OS */ | ||
405 | |||
406 | status = acpi_os_validate_address(obj_desc->region.space_id, | ||
407 | obj_desc->region.address, | ||
408 | (acpi_size) obj_desc->region.length, | ||
409 | acpi_ut_get_node_name(node)); | ||
410 | |||
411 | if (ACPI_FAILURE(status)) { | ||
412 | /* | ||
413 | * Invalid address/length. We will emit an error message and mark | ||
414 | * the region as invalid, so that it will cause an additional error if | ||
415 | * it is ever used. Then return AE_OK. | ||
416 | */ | ||
417 | ACPI_EXCEPTION((AE_INFO, status, | ||
418 | "During address validation of OpRegion [%4.4s]", | ||
419 | node->name.ascii)); | ||
420 | obj_desc->common.flags |= AOPOBJ_INVALID; | ||
421 | status = AE_OK; | ||
422 | } | ||
423 | |||
400 | return_ACPI_STATUS(status); | 424 | return_ACPI_STATUS(status); |
401 | } | 425 | } |
402 | 426 | ||
diff --git a/drivers/acpi/acpica/exfldio.c b/drivers/acpi/acpica/exfldio.c index d4075b821021..6687be167f5f 100644 --- a/drivers/acpi/acpica/exfldio.c +++ b/drivers/acpi/acpica/exfldio.c | |||
@@ -113,6 +113,12 @@ acpi_ex_setup_region(union acpi_operand_object *obj_desc, | |||
113 | } | 113 | } |
114 | } | 114 | } |
115 | 115 | ||
116 | /* Exit if Address/Length have been disallowed by the host OS */ | ||
117 | |||
118 | if (rgn_desc->common.flags & AOPOBJ_INVALID) { | ||
119 | return_ACPI_STATUS(AE_AML_ILLEGAL_ADDRESS); | ||
120 | } | ||
121 | |||
116 | /* | 122 | /* |
117 | * Exit now for SMBus address space, it has a non-linear address space | 123 | * Exit now for SMBus address space, it has a non-linear address space |
118 | * and the request cannot be directly validated | 124 | * and the request cannot be directly validated |
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 71670719d61a..5691f165a952 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c | |||
@@ -189,11 +189,36 @@ acpi_status __init acpi_os_initialize(void) | |||
189 | return AE_OK; | 189 | return AE_OK; |
190 | } | 190 | } |
191 | 191 | ||
192 | static void bind_to_cpu0(struct work_struct *work) | ||
193 | { | ||
194 | set_cpus_allowed(current, cpumask_of_cpu(0)); | ||
195 | kfree(work); | ||
196 | } | ||
197 | |||
198 | static void bind_workqueue(struct workqueue_struct *wq) | ||
199 | { | ||
200 | struct work_struct *work; | ||
201 | |||
202 | work = kzalloc(sizeof(struct work_struct), GFP_KERNEL); | ||
203 | INIT_WORK(work, bind_to_cpu0); | ||
204 | queue_work(wq, work); | ||
205 | } | ||
206 | |||
192 | acpi_status acpi_os_initialize1(void) | 207 | acpi_status acpi_os_initialize1(void) |
193 | { | 208 | { |
209 | /* | ||
210 | * On some machines, a software-initiated SMI causes corruption unless | ||
211 | * the SMI runs on CPU 0. An SMI can be initiated by any AML, but | ||
212 | * typically it's done in GPE-related methods that are run via | ||
213 | * workqueues, so we can avoid the known corruption cases by binding | ||
214 | * the workqueues to CPU 0. | ||
215 | */ | ||
194 | kacpid_wq = create_singlethread_workqueue("kacpid"); | 216 | kacpid_wq = create_singlethread_workqueue("kacpid"); |
217 | bind_workqueue(kacpid_wq); | ||
195 | kacpi_notify_wq = create_singlethread_workqueue("kacpi_notify"); | 218 | kacpi_notify_wq = create_singlethread_workqueue("kacpi_notify"); |
219 | bind_workqueue(kacpi_notify_wq); | ||
196 | kacpi_hotplug_wq = create_singlethread_workqueue("kacpi_hotplug"); | 220 | kacpi_hotplug_wq = create_singlethread_workqueue("kacpi_hotplug"); |
221 | bind_workqueue(kacpi_hotplug_wq); | ||
197 | BUG_ON(!kacpid_wq); | 222 | BUG_ON(!kacpid_wq); |
198 | BUG_ON(!kacpi_notify_wq); | 223 | BUG_ON(!kacpi_notify_wq); |
199 | BUG_ON(!kacpi_hotplug_wq); | 224 | BUG_ON(!kacpi_hotplug_wq); |
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index 01574a066534..42159a28f433 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c | |||
@@ -397,6 +397,14 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = { | |||
397 | }, | 397 | }, |
398 | }, | 398 | }, |
399 | { | 399 | { |
400 | .callback = init_set_sci_en_on_resume, | ||
401 | .ident = "Hewlett-Packard HP G7000 Notebook PC", | ||
402 | .matches = { | ||
403 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
404 | DMI_MATCH(DMI_PRODUCT_NAME, "HP G7000 Notebook PC"), | ||
405 | }, | ||
406 | }, | ||
407 | { | ||
400 | .callback = init_old_suspend_ordering, | 408 | .callback = init_old_suspend_ordering, |
401 | .ident = "Panasonic CF51-2L", | 409 | .ident = "Panasonic CF51-2L", |
402 | .matches = { | 410 | .matches = { |
diff --git a/drivers/acpi/system.c b/drivers/acpi/system.c index 0944daec064f..9c61ab2177cf 100644 --- a/drivers/acpi/system.c +++ b/drivers/acpi/system.c | |||
@@ -121,7 +121,7 @@ static void acpi_table_attr_init(struct acpi_table_attr *table_attr, | |||
121 | table_attr->attr.size = 0; | 121 | table_attr->attr.size = 0; |
122 | table_attr->attr.read = acpi_table_show; | 122 | table_attr->attr.read = acpi_table_show; |
123 | table_attr->attr.attr.name = table_attr->name; | 123 | table_attr->attr.attr.name = table_attr->name; |
124 | table_attr->attr.attr.mode = 0444; | 124 | table_attr->attr.attr.mode = 0400; |
125 | 125 | ||
126 | return; | 126 | return; |
127 | } | 127 | } |