Re: [PATCH] mfd: cros_ec: Read EC features during probe to catch transfer error

From: Tzung-Bi Shih

Date: Sun May 24 2026 - 23:49:34 EST


On Fri, May 22, 2026 at 03:44:56PM +0000, Andrei Kuchynski wrote:
> cros_ec_check_features() does not return an error if the underlying
> EC_CMD_GET_FEATURES command fails. Consequently, when the Fingerprint
> device fails to respond, the probe function ignores the failure and falls
> back to installing it as 'cros_ec' device instead of 'cros_fp'.
> This leads to a sysfs duplicate filename collision later when the real
> 'cros_ec' device attempts to register:
>
> cros-ec-spi spi5.0: EC failed to respond in time
> cros-ec-dev.19.auto: cannot get EC features: -110
> sysfs : cannot create duplicate filename '/class/chromeos/cros_ec'
> : sysfs_do_create_link_sd+0x94/0xdc
> : ec_device_probe+0x150/0x4f0
>
> Fix this by extracting the feature reading logic into a new helper function
> cros_ec_read_features() and calling it during ec_device_probe().
> If the transfer fails, abort the broken device initialization.
>
> Signed-off-by: Andrei Kuchynski <akuchynski@xxxxxxxxxxxx>

Acked-by: Tzung-Bi Shih <tzungbi@xxxxxxxxxx>