* [PATCH] ARM: fix amba_get_enable_vcore()'s handling of probe deferral
@ 2012-04-10 8:48 Domenico Andreoli
2012-04-10 9:09 ` Mark Brown
0 siblings, 1 reply; 3+ messages in thread
From: Domenico Andreoli @ 2012-04-10 8:48 UTC (permalink / raw)
To: linux-arm-kernel
From: Domenico Andreoli <domenico.andreoli@linux.com>
With v3.4-rc1 my board's console started to have problems. earlyprintk
revealed that the PL011 serial driver deferred the initialization and
never attempted it again. This resulted in console not being bound to
any physical device.
The error in probing the serial was due to amba_get_enable_vcore()
not ignoring the -EPROBE_DEFER got from regulator_get(), which has
been recently updated to ask for probe deferral in case the regulator
is not available (yet).
This fix makes amba_get_enable_vcore() consistently handle the new
-EPROBE_DEFER error case.
Signed-off-by: Domenico Andreoli <domenico.andreoli@linux.com>
---
drivers/amba/bus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: b/drivers/amba/bus.c
===================================================================
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -363,7 +363,7 @@ static int amba_get_enable_vcore(struct
if (IS_ERR(vcore)) {
/* It is OK not to supply a vcore regulator */
- if (PTR_ERR(vcore) == -ENODEV)
+ if (PTR_ERR(vcore) == -EPROBE_DEFER)
return 0;
return PTR_ERR(vcore);
}
^ permalink raw reply [flat|nested] 3+ messages in thread* [PATCH] ARM: fix amba_get_enable_vcore()'s handling of probe deferral
2012-04-10 8:48 [PATCH] ARM: fix amba_get_enable_vcore()'s handling of probe deferral Domenico Andreoli
@ 2012-04-10 9:09 ` Mark Brown
2012-04-10 9:13 ` Domenico Andreoli
0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2012-04-10 9:09 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Apr 10, 2012 at 10:48:33AM +0200, Domenico Andreoli wrote:
> From: Domenico Andreoli <domenico.andreoli@linux.com>
> With v3.4-rc1 my board's console started to have problems. earlyprintk
> revealed that the PL011 serial driver deferred the initialization and
> never attempted it again. This resulted in console not being bound to
> any physical device.
> The error in probing the serial was due to amba_get_enable_vcore()
> not ignoring the -EPROBE_DEFER got from regulator_get(), which has
> been recently updated to ask for probe deferral in case the regulator
> is not available (yet).
> This fix makes amba_get_enable_vcore() consistently handle the new
> -EPROBE_DEFER error case.
As discussed in the other thread where Shawn proposed the same fix this
is not a good fix (and the original code is not a good idea either), it
makes things very dependant on probe ordering which is fragile and prone
to error. With the code as-is platforms not using this feature really
should be stubbing out the regulator rather than ignoring failures to
acquire the regulator.
Russell just applied a patch removing this feature entirely (in favour
of implementing it in power domains on platforms that want it) which
avoids these issues.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] ARM: fix amba_get_enable_vcore()'s handling of probe deferral
2012-04-10 9:09 ` Mark Brown
@ 2012-04-10 9:13 ` Domenico Andreoli
0 siblings, 0 replies; 3+ messages in thread
From: Domenico Andreoli @ 2012-04-10 9:13 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Apr 10, 2012 at 10:09:28AM +0100, Mark Brown wrote:
> On Tue, Apr 10, 2012 at 10:48:33AM +0200, Domenico Andreoli wrote:
> > From: Domenico Andreoli <domenico.andreoli@linux.com>
>
> > With v3.4-rc1 my board's console started to have problems. earlyprintk
> > revealed that the PL011 serial driver deferred the initialization and
> > never attempted it again. This resulted in console not being bound to
> > any physical device.
>
> > The error in probing the serial was due to amba_get_enable_vcore()
> > not ignoring the -EPROBE_DEFER got from regulator_get(), which has
> > been recently updated to ask for probe deferral in case the regulator
> > is not available (yet).
>
> > This fix makes amba_get_enable_vcore() consistently handle the new
> > -EPROBE_DEFER error case.
>
> As discussed in the other thread where Shawn proposed the same fix this
> is not a good fix (and the original code is not a good idea either), it
> makes things very dependant on probe ordering which is fragile and prone
> to error. With the code as-is platforms not using this feature really
> should be stubbing out the regulator rather than ignoring failures to
> acquire the regulator.
>
> Russell just applied a patch removing this feature entirely (in favour
> of implementing it in power domains on platforms that want it) which
> avoids these issues.
Yes, I should have spent few minutes reading the ml instead of digging
for a night into the code - but my board had also other issues ;)
thanks,
Domenico
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-04-10 9:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-10 8:48 [PATCH] ARM: fix amba_get_enable_vcore()'s handling of probe deferral Domenico Andreoli
2012-04-10 9:09 ` Mark Brown
2012-04-10 9:13 ` Domenico Andreoli
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).