All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND v3] clk: return probe defer when DT clock not yet ready
@ 2014-02-08 13:25 ` Jean-Francois Moine
  0 siblings, 0 replies; 10+ messages in thread
From: Jean-Francois Moine @ 2013-11-25 18:47 UTC (permalink / raw)
  To: Mike Turquette, linux-arm-kernel
  Cc: Russell King, Grant Likely, Rob Herring, linux-kernel, devicetree

At probe time, a clock device may not be ready when some other device
wants to use it.

This patch lets the functions clk_get/devm_clk_get return a probe defer
when the clock is defined in the DT but not yet available.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
---
resend v3:
	- base kernel 3.14.0-rc1
	- __clk_get() failure is fixed
resend v2: remove ASoc from subject (thank you, Mark)
resend: - patch subject change from
   [PATCH v3 1/2] ASoC: kirkwood: clk: probe defer when clock not yet ready
	- base kernel 3.13.0-rc1
v2: fix __clk_get() failure (from Russell King)
---
 drivers/clk/clk.c    | 2 +-
 drivers/clk/clkdev.c | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 5517944..32d84e9 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -2472,7 +2472,7 @@ EXPORT_SYMBOL_GPL(of_clk_del_provider);
 struct clk *__of_clk_get_from_provider(struct of_phandle_args *clkspec)
 {
 	struct of_clk_provider *provider;
-	struct clk *clk = ERR_PTR(-ENOENT);
+	struct clk *clk = ERR_PTR(-EPROBE_DEFER);
 
 	/* Check if we have such a provider in our array */
 	list_for_each_entry(provider, &of_clk_providers, link) {
diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c
index 48f6721..a360b2e 100644
--- a/drivers/clk/clkdev.c
+++ b/drivers/clk/clkdev.c
@@ -167,6 +167,8 @@ struct clk *clk_get(struct device *dev, const char *con_id)
 		clk = of_clk_get_by_name(dev->of_node, con_id);
 		if (!IS_ERR(clk))
 			return clk;
+		if (PTR_ERR(clk) == -EPROBE_DEFER)
+			return clk;
 	}
 
 	return clk_get_sys(dev_id, con_id);
-- 
1.9.0.rc3


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

* [PATCH RESEND v3] clk: return probe defer when DT clock not yet ready
@ 2014-02-08 13:25 ` Jean-Francois Moine
  0 siblings, 0 replies; 10+ messages in thread
From: Jean-Francois Moine @ 2014-02-08 13:25 UTC (permalink / raw)
  To: linux-arm-kernel

At probe time, a clock device may not be ready when some other device
wants to use it.

This patch lets the functions clk_get/devm_clk_get return a probe defer
when the clock is defined in the DT but not yet available.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
---
resend v3:
	- base kernel 3.14.0-rc1
	- __clk_get() failure is fixed
resend v2: remove ASoc from subject (thank you, Mark)
resend: - patch subject change from
   [PATCH v3 1/2] ASoC: kirkwood: clk: probe defer when clock not yet ready
	- base kernel 3.13.0-rc1
v2: fix __clk_get() failure (from Russell King)
---
 drivers/clk/clk.c    | 2 +-
 drivers/clk/clkdev.c | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 5517944..32d84e9 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -2472,7 +2472,7 @@ EXPORT_SYMBOL_GPL(of_clk_del_provider);
 struct clk *__of_clk_get_from_provider(struct of_phandle_args *clkspec)
 {
 	struct of_clk_provider *provider;
-	struct clk *clk = ERR_PTR(-ENOENT);
+	struct clk *clk = ERR_PTR(-EPROBE_DEFER);
 
 	/* Check if we have such a provider in our array */
 	list_for_each_entry(provider, &of_clk_providers, link) {
diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c
index 48f6721..a360b2e 100644
--- a/drivers/clk/clkdev.c
+++ b/drivers/clk/clkdev.c
@@ -167,6 +167,8 @@ struct clk *clk_get(struct device *dev, const char *con_id)
 		clk = of_clk_get_by_name(dev->of_node, con_id);
 		if (!IS_ERR(clk))
 			return clk;
+		if (PTR_ERR(clk) == -EPROBE_DEFER)
+			return clk;
 	}
 
 	return clk_get_sys(dev_id, con_id);
-- 
1.9.0.rc3

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

* Re: [PATCH RESEND v3] clk: return probe defer when DT clock not yet ready
@ 2014-02-18 13:23   ` Sylwester Nawrocki
  0 siblings, 0 replies; 10+ messages in thread
From: Sylwester Nawrocki @ 2014-02-18 13:23 UTC (permalink / raw)
  To: Jean-Francois Moine, Mike Turquette, Russell King
  Cc: linux-arm-kernel, Grant Likely, Rob Herring, linux-kernel, devicetree

On 25/11/13 19:47, Jean-Francois Moine wrote:
> At probe time, a clock device may not be ready when some other device
> wants to use it.
> 
> This patch lets the functions clk_get/devm_clk_get return a probe defer
> when the clock is defined in the DT but not yet available.
> 
> Signed-off-by: Jean-Francois Moine <moinejf@free.fr>

Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Tested-by: Sylwester Nawrocki <s.nawrocki@samsung.com>

Hope this can be merged for v3.15. Thanks.

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

* Re: [PATCH RESEND v3] clk: return probe defer when DT clock not yet ready
@ 2014-02-18 13:23   ` Sylwester Nawrocki
  0 siblings, 0 replies; 10+ messages in thread
From: Sylwester Nawrocki @ 2014-02-18 13:23 UTC (permalink / raw)
  To: Jean-Francois Moine, Mike Turquette, Russell King
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Grant Likely,
	Rob Herring, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA

On 25/11/13 19:47, Jean-Francois Moine wrote:
> At probe time, a clock device may not be ready when some other device
> wants to use it.
> 
> This patch lets the functions clk_get/devm_clk_get return a probe defer
> when the clock is defined in the DT but not yet available.
> 
> Signed-off-by: Jean-Francois Moine <moinejf-GANU6spQydw@public.gmane.org>

Reviewed-by: Sylwester Nawrocki <s.nawrocki-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Tested-by: Sylwester Nawrocki <s.nawrocki-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>

Hope this can be merged for v3.15. Thanks.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH RESEND v3] clk: return probe defer when DT clock not yet ready
@ 2014-02-18 13:23   ` Sylwester Nawrocki
  0 siblings, 0 replies; 10+ messages in thread
From: Sylwester Nawrocki @ 2014-02-18 13:23 UTC (permalink / raw)
  To: linux-arm-kernel

On 25/11/13 19:47, Jean-Francois Moine wrote:
> At probe time, a clock device may not be ready when some other device
> wants to use it.
> 
> This patch lets the functions clk_get/devm_clk_get return a probe defer
> when the clock is defined in the DT but not yet available.
> 
> Signed-off-by: Jean-Francois Moine <moinejf@free.fr>

Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Tested-by: Sylwester Nawrocki <s.nawrocki@samsung.com>

Hope this can be merged for v3.15. Thanks.

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

* Re: [PATCH RESEND v3] clk: return probe defer when DT clock not yet ready
  2014-02-08 13:25 ` Jean-Francois Moine
@ 2014-02-19 18:03   ` Jean-Francois Moine
  -1 siblings, 0 replies; 10+ messages in thread
From: Jean-Francois Moine @ 2014-02-19 18:03 UTC (permalink / raw)
  To: Mike Turquette; +Cc: linux-arm-kernel, linux-kernel

On Mon, 25 Nov 2013 19:47:04 +0100
Jean-Francois Moine <moinejf@free.fr> wrote:

> At probe time, a clock device may not be ready when some other device
> wants to use it.
> 
> This patch lets the functions clk_get/devm_clk_get return a probe defer
> when the clock is defined in the DT but not yet available.

Hi Mike,

Any news about this patch?

-- 
Ken ar c'hentañ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/

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

* [PATCH RESEND v3] clk: return probe defer when DT clock not yet ready
@ 2014-02-19 18:03   ` Jean-Francois Moine
  0 siblings, 0 replies; 10+ messages in thread
From: Jean-Francois Moine @ 2014-02-19 18:03 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, 25 Nov 2013 19:47:04 +0100
Jean-Francois Moine <moinejf@free.fr> wrote:

> At probe time, a clock device may not be ready when some other device
> wants to use it.
> 
> This patch lets the functions clk_get/devm_clk_get return a probe defer
> when the clock is defined in the DT but not yet available.

Hi Mike,

Any news about this patch?

-- 
Ken ar c'henta?	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/

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

* Re: [PATCH RESEND v3] clk: return probe defer when DT clock not yet ready
  2014-02-19 18:03   ` Jean-Francois Moine
@ 2014-02-19 18:53     ` Russell King - ARM Linux
  -1 siblings, 0 replies; 10+ messages in thread
From: Russell King - ARM Linux @ 2014-02-19 18:53 UTC (permalink / raw)
  To: Mike Turquette; +Cc: Jean-Francois Moine, linux-kernel, linux-arm-kernel

On Wed, Feb 19, 2014 at 07:03:05PM +0100, Jean-Francois Moine wrote:
> On Mon, 25 Nov 2013 19:47:04 +0100
> Jean-Francois Moine <moinejf@free.fr> wrote:
> 
> > At probe time, a clock device may not be ready when some other device
> > wants to use it.
> > 
> > This patch lets the functions clk_get/devm_clk_get return a probe defer
> > when the clock is defined in the DT but not yet available.
> 
> Hi Mike,
> 
> Any news about this patch?

Mike,

Can you please have a look at this patch so that either you or I can take
this.  It /is/ required so that subsystems can correctly identify whether
a clock is missing because it's not specified in DT, or whether the clock
is missing because it's specified in DT but doesn't yet exist.

This patch has been hanging around for ages and deserves some attention.

Thanks.

-- 
FTTC broadband for 0.8mile line: 5.8Mbps down 500kbps up.  Estimation
in database were 13.1 to 19Mbit for a good line, about 7.5+ for a bad.
Estimate before purchase was "up to 13.2Mbit".

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

* [PATCH RESEND v3] clk: return probe defer when DT clock not yet ready
@ 2014-02-19 18:53     ` Russell King - ARM Linux
  0 siblings, 0 replies; 10+ messages in thread
From: Russell King - ARM Linux @ 2014-02-19 18:53 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Feb 19, 2014 at 07:03:05PM +0100, Jean-Francois Moine wrote:
> On Mon, 25 Nov 2013 19:47:04 +0100
> Jean-Francois Moine <moinejf@free.fr> wrote:
> 
> > At probe time, a clock device may not be ready when some other device
> > wants to use it.
> > 
> > This patch lets the functions clk_get/devm_clk_get return a probe defer
> > when the clock is defined in the DT but not yet available.
> 
> Hi Mike,
> 
> Any news about this patch?

Mike,

Can you please have a look at this patch so that either you or I can take
this.  It /is/ required so that subsystems can correctly identify whether
a clock is missing because it's not specified in DT, or whether the clock
is missing because it's specified in DT but doesn't yet exist.

This patch has been hanging around for ages and deserves some attention.

Thanks.

-- 
FTTC broadband for 0.8mile line: 5.8Mbps down 500kbps up.  Estimation
in database were 13.1 to 19Mbit for a good line, about 7.5+ for a bad.
Estimate before purchase was "up to 13.2Mbit".

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

* [PATCH RESEND v3] clk: return probe defer when DT clock not yet ready
  2014-02-19 18:53     ` Russell King - ARM Linux
  (?)
@ 2014-02-25  1:02     ` Mike Turquette
  -1 siblings, 0 replies; 10+ messages in thread
From: Mike Turquette @ 2014-02-25  1:02 UTC (permalink / raw)
  To: linux-arm-kernel

Quoting Russell King - ARM Linux (2014-02-19 10:53:15)
> On Wed, Feb 19, 2014 at 07:03:05PM +0100, Jean-Francois Moine wrote:
> > On Mon, 25 Nov 2013 19:47:04 +0100
> > Jean-Francois Moine <moinejf@free.fr> wrote:
> > 
> > > At probe time, a clock device may not be ready when some other device
> > > wants to use it.
> > > 
> > > This patch lets the functions clk_get/devm_clk_get return a probe defer
> > > when the clock is defined in the DT but not yet available.
> > 
> > Hi Mike,
> > 
> > Any news about this patch?
> 
> Mike,
> 
> Can you please have a look at this patch so that either you or I can take
> this.  It /is/ required so that subsystems can correctly identify whether
> a clock is missing because it's not specified in DT, or whether the clock
> is missing because it's specified in DT but doesn't yet exist.
> 
> This patch has been hanging around for ages and deserves some attention.

I only saw this patch now thanks to another thread. I have some
aggressive mail filtering going on and I guess maybe the original ASoC
subject had something to do with that?

Oh well. I've pull this patch into clk-next for testing. I'll see if
anything goes boom.

Thanks for the patch and longsuffering patience!

Regards,
Mike

> 
> Thanks.
> 

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

end of thread, other threads:[~2014-02-25  1:02 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-25 18:47 [PATCH RESEND v3] clk: return probe defer when DT clock not yet ready Jean-Francois Moine
2014-02-08 13:25 ` Jean-Francois Moine
2014-02-18 13:23 ` Sylwester Nawrocki
2014-02-18 13:23   ` Sylwester Nawrocki
2014-02-18 13:23   ` Sylwester Nawrocki
2014-02-19 18:03 ` Jean-Francois Moine
2014-02-19 18:03   ` Jean-Francois Moine
2014-02-19 18:53   ` Russell King - ARM Linux
2014-02-19 18:53     ` Russell King - ARM Linux
2014-02-25  1:02     ` Mike Turquette

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.