Re: [PATCH] platform/x86: thinkpad acpi: Fix fan speed reporting on X9 Gen 1

From: Vishnu Sankar

Date: Mon Nov 30 2026 - 18:04:23 EST


Hi Huang Wei,

Thanks for the review.

On Fri, Nov 27, 2026 at 4:02 PM Huang Wei <huangwei@xxxxxxxxxx> wrote:
>
> On Thu, Nov 26, 2026 at 08:59:37AM +0000, Vishnu Sankar wrote:
> > On the ThinkPad X9-14 Gen 1 and X9-15 Gen 1, the EC reports fan1 RPM
> > in registers 0x84/0x85 and fan2 RPM in 0x82/0x83, and does not use
> > bit 0 of 0x31 as a fan select. As a result fan2 reports fan1's speed,
> > and every fan read overwrites an EC-owned bit.
>
> For context from the other side of this history: we ran into the X9-14
> Gen 1 EC layout back in August from the thermal side (bug 221228),
> tried to reuse the non-standard quirk-table offsets at the time, and
> reverted after the EC data showed the X9 has its own register layout -
> so it's good to see the fan side done right this time, based on what
> the EC actually implements.
>
> Verified against the current source:
>
> - The new quirk bits (TPACPI_FAN_2REG 0x0100, TPACPI_FAN_UNLATCH 0x0200)
> don't collide with the existing fan quirk flags (0x0002/0x0004).
> - With 2REG, fan_select_fan1()/fan_select_fan2() become no-ops, which
> removes both problems in one go: fan2 no longer aliases fan1's
> registers, and the 0x31 writes that clobbered an EC-owned bit are
> gone.
> - The UNLATCH re-read (MSB, LSB, MSB again until stable) is the right
> guard for a non-latching register pair.
>
> One thing worth a line in the commit message, maybe: the unlatched
> path reads the MSB first, while the latched path keeps the "read 0x84
> before 0x85" ordering that older EC firmware requires. Your testing
> shows the X9 EC doesn't have that old quirk, but a note that the read
> order is intentionally different would save the next person some
> archaeology.
>
Thanks for the review, and for the background from the thermal side.

Yes. The X9 EC does not latch, so the LSB-first rule doesn't
apply there, but that isn't obvious from the code.

Hans, Ilpo, I can either send a v2 adding a short comment in
fan_read_rpm(), or a small
follow-up patch on top if you'd rather take this one as is. Whichever
is easier for you.
> Either way, that's a nit, not an objection:
>
> Reviewed-by: Huang Wei <huangwei@xxxxxxxxxx>



--

Regards,

Vishnu Sankar