Re: [PATCH] regulator: palmas: set supply_name after registering the regulator

From: Mark Brown
Date: Wed Jun 30 2021 - 08:13:42 EST


On Tue, Jun 29, 2021 at 10:21:45PM +0200, H. Nikolaus Schaller wrote:

> There seems to be a deadlock in probing:

> e.g. ldo3_reg depends on vdds_1v8_main supply
> vdds_1v8_main depends on smps7_reg supply
> smps7_reg depends on vsys_cobra supply
> vsys_cobra depends on nothing

> This would normally lead to a simple chain as you described above. But
> ldo3_reg and smps7_reg share the same driver and can probe successfully or
> fail only in common.

I don't see any deadlock there? Just a straightforward set of
dependencies. Anything circular would clearly be a driver bug.

> Now if ldo3_reg defers probe through the new rule, smps7_reg is never
> probed successfully because it is the same driver. Hence vdds_1v8_main can
> not become available. And the Palmas continues to run in boot initialization
> until some driver (MMC) wants to switch voltages or whatever.

The driver should just register all the DCDCs before the LDOs, then
everything will sort itself out. It's *possible* you might see a system
trying to link things together regulators of the same type but that's
very unusual as it makes the system less efficient.

Attachment: signature.asc
Description: PGP signature