Re: oops with asus_acpi on P30/P35

Karol Kozimor
2005-06-29T15:50:15Z

Thus wrote Carl-Daniel Hailfinger:
>> Bob, is the implicit return code supposed to trigger also when using
>> acpi_evaluate_object()? FYI, this is what we currently do:
>>
>> write_acpi_int(hotk->handle, "INIT", 0, &buffer) (drivers/acpi/asus_acpi.c)
>>
>> which is fine if the INIT method returns a string (the usual), but
>> apparently not if there is no return statement in the method (the P30
>> case). The old code assumed the buffer will be null in this case.
>>
>> Is that a bug in the ACPICA or should the asus_acpi code cover for other
>> cases of buffer.type?
>
> Will the fix for this be submitted to stable-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org? I can't upgrade
> to 2.6.12.1 because of this oops.

This should fix ya for now, but I can't sign it off until I get a comment
from Bob.
Best regards,

--
Karol 'sziwan' Kozimor
sziwan-DETuoxkZsSqrDJvtcaxF/A@public.gmane.org

--- linux-2.6.12/drivers/acpi/asus_acpi.c~ 2005-06-29 17:37:29.000000000 +0200
+++ linux-2.6.12/drivers/acpi/asus_acpi.c 2005-06-29 17:45:53.000000000 +0200
@@ -990,9 +990,15 @@
else if (bsts_result)
printk(KERN_NOTICE " BSTS called, 0x%02x returned\n", bsts_result);

+ if (buffer.pointer == NULL)
+ return -EINVAL;
+ model = (union acpi_object *) buffer.pointer;
+
/* Samsung P30 has a device with a valid _HID whose INIT does not
* return anything. Catch this one and any similar here */
- if (buffer.pointer == NULL) {
+ if (model->type == ACPI_TYPE_STRING) {
+ printk(KERN_NOTICE " %s model detected, ", model->string.pointer);
+ } else {
if (asus_info && /* Samsung P30 */
strncmp(asus_info->oem_table_id, "ODEM", 4) == 0) {
hotk->model = P30;
@@ -1007,11 +1013,6 @@
return AE_OK;
}

- model = (union acpi_object *) buffer.pointer;
- if (model->type == ACPI_TYPE_STRING) {
- printk(KERN_NOTICE " %s model detected, ", model->string.pointer);
- }
-
hotk->model = END_MODEL;
if (strncmp(model->string.pointer, "L3D", 3) == 0)
hotk->model = L3D;

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click