All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regulator: core: Handle probe deferral from DT when resolving supplies
@ 2015-09-30 19:30 Mark Brown
  2015-10-01  5:51 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Brown @ 2015-09-30 19:30 UTC (permalink / raw)
  To: Sascha Hauer, Liam Girdwood; +Cc: linux-kernel, Mark Brown

When resolving regulator-regulator supplies we ignore probe deferral
returns from regulator_dev_lookup() (such as are generated for DT when
we can see a supply is registered) and just fall back to the dummy
regulator if there are full constraints (as is the case for DT).  This
means that probe deferral is broken for DT systems, fix that by paying
attention to -EPROBE_DEFER return codes like we do -ENODEV.

A further patch will simplify this further, this is a minimal fix for
the specific issue.

Reported-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
---

Tested with my famous "I need to leave the house right now so haven't
even tried building this yet" test plan - please let me know how this
works for you.

 drivers/regulator/core.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index af045e5..e9b94d7 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1448,6 +1448,10 @@ static int regulator_resolve_supply(struct regulator_dev *rdev)
 			return 0;
 		}
 
+		/* Did the lookup explicitly defer for us? */
+		if (ret == -EPROBE_DEFER)
+			return ret;
+
 		if (have_full_constraints()) {
 			r = dummy_regulator_rdev;
 			get_device(&r->dev);
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] regulator: core: Handle probe deferral from DT when resolving supplies
  2015-09-30 19:30 [PATCH] regulator: core: Handle probe deferral from DT when resolving supplies Mark Brown
@ 2015-10-01  5:51 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2015-10-01  5:51 UTC (permalink / raw)
  To: Mark Brown; +Cc: Liam Girdwood, linux-kernel

On Wed, Sep 30, 2015 at 08:30:52PM +0100, Mark Brown wrote:
> When resolving regulator-regulator supplies we ignore probe deferral
> returns from regulator_dev_lookup() (such as are generated for DT when
> we can see a supply is registered) and just fall back to the dummy
> regulator if there are full constraints (as is the case for DT).  This
> means that probe deferral is broken for DT systems, fix that by paying
> attention to -EPROBE_DEFER return codes like we do -ENODEV.
> 
> A further patch will simplify this further, this is a minimal fix for
> the specific issue.
> 
> Reported-by: Sascha Hauer <s.hauer@pengutronix.de>
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---
> 
> Tested with my famous "I need to leave the house right now so haven't
> even tried building this yet" test plan - please let me know how this
> works for you.

Yes, this works as expected.

Tested-by: Sascha Hauer <s.hauer@pengutronix.de>

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-01  5:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-30 19:30 [PATCH] regulator: core: Handle probe deferral from DT when resolving supplies Mark Brown
2015-10-01  5:51 ` Sascha Hauer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.