[ltp] [patch 11/12][2.6.18] ibm-acpi: workaround for EC 0x2f initialization bug
Shem Multinymous
linux-thinkpad@linux-thinkpad.org
Mon, 23 Oct 2006 21:55:10 +0200
On 10/23/06, Henrique de Moraes Holschuh <hmh@hmh.eng.br> wrote:
> A few ThinkPads fail to initialize EC register 0x2f both in the EC
> firmware and ACPI DSDT. If the BIOS and the ACPI DSDT also do not
> initialize it, then the initial status of that register does not
> correspond to reality.
Nice work wit this patch. But are you sure faking auto is better than
saying "unknown"?
> if (unlikely(!acpi_ec_read(fan_rpm_offset, &lo) ||
> !acpi_ec_read(fan_rpm_offset + 1, &hi)))
> return -EIO;
Does this make sense?
> if (!acpi_ec_write(fan_status_offset, level))
> return -EIO;
> + else
> + fan_control_status_known = 1;
> break;
>
> default:
> @@ -1905,6 +1946,8 @@ static int fan_write_enable( void )
> case IBMACPI_FAN_WR_TPEC:
> if (!acpi_ec_write(fan_status_offset, IBMACPI_FAN_EC_AUTO))
> return -EIO;
> + else
> + fan_control_status_known = 1;
> break;
Maybe these "fan_control_status_known = 1;" should be factored out,
since the watchdog needs hooks at the same points.
Shem