Re: [PATCH v2 2/2] platform/surface: surfacepro3_button: don't load on amd variant

From: Andy Shevchenko

Date: Mon Nov 09 2026 - 02:15:27 EST


On Sun, Nov 8, 2026 at 11:37 PM Antonio Vázquez Blanco
<antoniovazquezblanco@xxxxxxxxx> wrote:
>
> From: Sachi King <nakato@xxxxxxxxx>
>
> surfacepro3_button binds to MSHW0040 on the AMD variants of the Surface
> Laptop 3 and 4, where soc_button_array is the right driver.
>
> surface_button_check_MSHW0040() evaluates function 2 of the MSHW0040
> _DSM, the OEM Platform Revision, and binds when the result is 0,
> assuming that only a failed evaluation yields 0. The AMD variants
> implement that function and legitimately return 0, so this driver binds
> there as well.
>
> Decide instead on whether the device implements the function at all,
> which function 0 of the same _DSM advertises and acpi_check_dsm()
> reports. Of the 32 Surface models carrying MSHW0040 in the ACPI dumps at
> [1], only two do not advertise it, and they are exactly the two this
> driver is for: the Surface Pro 4, whose MSHW0040 device carries no _DSM,
> and the Surface Book 1, whose _DSM advertises functions 0 and 1 only.
>
> The driver currently reaches the right answer on the Surface Book 1 by
> accident rather than by that test. Function 2 is not implemented there,
> so the _DSM falls through to a trailing Return (Buffer), and
> acpi_evaluate_dsm_typed() rejects the type and returns NULL rather than
> an integer. The revision is left at 0 and the driver binds.
>
> Keep evaluating the revision when it is advertised, so that it remains
> available through dev_dbg().

> [1] https://github.com/linux-surface/acpidumps
>
> Fixes: 64dd243d7356 ("platform/x86: surfacepro3_button: Fix device check")
> Link: https://lore.kernel.org/all/20211109081125.41410-1-nakato@xxxxxxxxx/
> Co-developed-by: Maximilian Luz <luzmaximilian@xxxxxxxxx>
> Signed-off-by: Maximilian Luz <luzmaximilian@xxxxxxxxx>
> Signed-off-by: Sachi King <nakato@xxxxxxxxx>

Same comments to the tag block and the commit message as per previous patch.

--
With Best Regards,
Andy Shevchenko