On Tue, May 22, 2018 at 05:08:45PM -0700, Doug Anderson wrote: > So one client's vote for a voltage continues to be in effect even if > that client votes to have the regulator disabled? That seems > fundamentally broken in RPMh. I guess my take would be to work around It's arguable either way - you could say that the client gets to specify a safe range at all times or you could say that the machine constraints should cover all cases where the hardware is idling. Of course RPMh is missing anything like the machine constraints (as we can see from all the fixing up of undesirable hard coding we have to do) so it's kind of pushed towards the first case. > >> A) Turn off VMMC and VQMMC > >> B) Program VMMC and VQMMC to defaults > >> C) Turn on VMMC and VQMMC > >> ...right now we bootup and pretend to Linux that VMMC and VQMMC start > >> off, so step A) will be no-op. Sigh. > > Step A) would not work because the regulator's use_count would be 0 and > > regulator_disable() can only be called successfully if use_count > 0. The > > call would have no impact and it would return an error. > Are you sure regulator_force_disable() won't do the trick on most > boards (which will report the regulator being enabled at bootup)? I > haven't tried it, but it seems like it might. It does mean that things will go wrong if the regulator is shared.