regulator: core: Use postcore_initcall(regulator_init_complete)
PATCH 1/1 regulator: core: Use postcore_initcall(regulator_init_complete)
From: Fabio Estevam <[email protected]>
Commit 22ceeee1 (pwm-backlight: Add power supply support) introduced the usage of regulator API into the pwm backlight driver and caused a regression on some boards like mx28evk and mx6qsabresd, resulting in blank display output:
pwm-backlight backlight.18: dummy supplies not allowed
Calling regulator_init_complete via late_initcall can be too 'late' for the regulator to be available for the pwm backlight driver.
Call regulator_init_complete with postcore_initcall level instead.
--- drivers/regulator/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/core.c +1 -1
@@ -3850,4 +3850,4 @@ unlock:return 0 ; } -late_initcall (regulator_init_complete); +postcore_initcall (regulator_init_complete);
Signature · 1 line
1.8.1.2
Mark Brown
maintainerQuoted 4 lines · Fabio Estevam
Calling
regulator_init_completevialate_initcallcan be too 'late' for the regulator to be available for the pwm backlight driver.Call
regulator_init_completewithpostcore_initcalllevel instead.
That's too early for some of the other functionality in this function though - I'd be particularly worried about the code that goes aroud turning off unused supplies running before drivers have a chance to load either breaking things or causing user visible glitches (and of course the goal here is to get have this run before that happens...).
I seem to remember that there's also some one initcall per object limitation so if we are going to try to dance this dance purely in the regulator code it'd probably need to be split out into another object as well as another function. The other options that were suggested were to either have the DT code push out the announcement or change the callers to check of_have_populated_dt() as well as looking at the flag, of this lot changing the callers is probably the cleanest. I'll probably do that tomorrow if a patch doesn't turn up before then.
Mark Brown
maintainerQuoted 2 lines · Mark Brown
lot changing the callers is probably the cleanest. I'll probably do that tomorrow if a patch doesn't turn up before then.
Sorry, that'll now be Wednesday - an unusually busy day started by someone deciding to fell trees outside my window early this morning put a bit of a spanner in the works.
Quoted 8 lines · Mark Brown
Quoted 2 lines · Mark Brown
lot changing the callers is probably the cleanest. I'll probably do that tomorrow if a patch doesn't turn up before then.
Sorry, that'll now be Wednesday - an unusually busy day started by someone deciding to fell trees outside my window early this morning put a bit of a spanner in the works.
What is going on about that patch?
Shawn
Fabio Estevam
Tested-byQuoted 1 line · Shawn Guo
What is going on about that patch?
Mark fixed the problem with the following commits:
commit 75bc9641cadd2a3f91f9c2e7f2fdfdeb8bd4b1d6
Author: Mark Brown <[email protected]> Date: Wed Nov 27 16:22:53 2013 +0000
regulator: core: Check for DT every time we check full constraints
Eliminate the gap between DT becoming available and this being used to say we have full constraints by checking directly for DT every time we check for full constraints. This improves interoperaton with optional regulator support.
commit 87b2841753e1694fc96fefb467f6aff9940b07af
Author: Mark Brown <[email protected]> Date: Wed Nov 27 16:13:10 2013 +0000
regulator: core: Replace checks of have_full_constraints with a function
Simple code reorganisation so we can change the logic for deciding what full constraints are more easily.
Regards,
Fabio Estevam
Quoted 5 lines · Fabio Estevam
Quoted 1 line · Shawn Guo
What is going on about that patch?
Mark fixed the problem with the following commits:
Thanks for the info, Fabio.
Shawn
Quoted 29 lines
commit
75bc9641cadd2a3f91f9c2e7f2fdfdeb8bd4b1d6Author: Mark Brown <[email protected]> Date: Wed Nov 27 16:22:53 2013 +0000regulator: core: Check for DT every time we check full constraints
Eliminate the gap between DT becoming available and this being used to say we have full constraints by checking directly for DT every time we check for full constraints. This improves interoperaton with optional regulator support.
Signed-off-by Mark Brown <[email protected]>Tested-by Fabio Estevam <[email protected]>commit
87b2841753e1694fc96fefb467f6aff9940b07afAuthor: Mark Brown <[email protected]> Date: Wed Nov 27 16:13:10 2013 +0000regulator: core: Replace checks of
have_full_constraintswith a functionSimple code reorganisation so we can change the logic for deciding what full constraints are more easily.
Signed-off-by Mark Brown <[email protected]>Regards,
Fabio Estevam