Comment 8 for bug 561151

Revision history for this message
Roland Dreier (roland.dreier) wrote : Re: reproducible oops at startup on thinkpad x61s in acpi_ex_read_data_from_field

Looking at
http://kernel.ubuntu.com/git?p=ubuntu/ubuntu-lucid.git;a=commitdiff;h=3f80f9e8e30f4759ad0e29d23856126edbfc7b41
which I believe is the only commit between -19 and -20 that actually touches ACPI, I see one thing that is a bit bogus. In the chunk below (launchpad may mangle the formatting but I hope not):

+ /* allow full data read from EC address space */
+ if (obj_desc->field.region_obj->region.space_id ==
+ ACPI_ADR_SPACE_EC) {
+ if (obj_desc->common_field.bit_length > 8)
+ obj_desc->common_field.access_bit_width =
+ ACPI_ROUND_UP(obj_desc->common_field.
+ bit_length, 8);
+ obj_desc->common_field.access_byte_width =
+ ACPI_DIV_8(obj_desc->common_field.
+ access_bit_width);
+ }

This is a nested if, and the two assignments of rounded things are indented as if they were supposed to both be consequences of the inner if. But the brace is placed after the first if, so the assignment of ACPI_DIV_8 to the access_byte_width will happen even if bit_length is not > 8.

I haven't tried building a kernel with that fixed, and I don't know how this would cause the problem but it does look suspicious.