Re: [PATCH RFC 1/2] hwmon: (sy7636a) fix races during probe of mfd subdevices

Mark Brown
2025-09-20T19:58:12Z

[-- Attachment #1: Type: text/plain, Size: 737 bytes --]

On Sat, Sep 20, 2025 at 01:43:10PM +0200, Andreas Kemnade wrote:
> If regulator subdevice is not ready early enough, devm_regulator_get will
> get a dummy regulator device, not the real one needed from the regulator
> subdevice, so defer probe in such case.
> devm_regulator_get_optional returns an error in that case.
>
> That fixes things, but looks odd, therefore RFC.

No, this is buggy and broken. You should only use _optional for
supplies that are optional, the clue is in the name. You need to fix
whatever is causing the device to be instantiated to ensure that the
regulators for the device are described before it tries to instnatiate
the device. Normally this is all part of a unified firmware
description.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]