Re: [PATCH 1/2] mfd: twl6040: Fix deferred probe handling for clk32k

2015-09-21 Thread Tony Lindgren
* Peter Ujfalusi  [150921 02:59]:
> On 09/18/2015 07:29 PM, Tony Lindgren wrote:
> > Commit 68bab8662f49 ("mfd: twl6040: Optional clk32k clock handling")
> > added clock handling for the 32k clock from palmas-clk. However, that
> > patch did not consider a typical situation where twl6040 is built-in,
> > and palmas-clk is a loadable module like we have in omap2plus_defconfig.
> > 
> > If palmas-clk is not loaded before twl6040 probes, we will get a
> > "clk32k is not handled" warning during booting. This means that any
> > drivers relying on this clock will mysteriously fail, including
> > omap5-uevm WLAN and audio.
> > 
> > Note that for WLAN, we probably should also eventually get
> > the clk32kgaudio for MMC3 directly as that's shared between
> > audio and WLAN SDIO at least for omap5-uevm. It seems the
> > WLAN chip cannot get it as otherwise MMC3 won't get properly
> > probed.
> 
> While this is going to 'fix' the WLAN because currently the twl6040 is powered
> on all the time (32k clock is enabled). My plan is to finally implement the
> power state handling for the twl6040, which means that w/o audio activity the
> twl6040 will be turned off. This will imply that any clock which is only used
> by twl6040 will be off as well.
> The proper solution would be to add clock handling to the WLAN driver stack.

Yes the place to request this clock is using pwrseq_simple.c for MMC3.
It seems there are some issues with deferred probe handling there too
though.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] mfd: twl6040: Fix deferred probe handling for clk32k

2015-09-21 Thread Peter Ujfalusi
On 09/18/2015 07:29 PM, Tony Lindgren wrote:
> Commit 68bab8662f49 ("mfd: twl6040: Optional clk32k clock handling")
> added clock handling for the 32k clock from palmas-clk. However, that
> patch did not consider a typical situation where twl6040 is built-in,
> and palmas-clk is a loadable module like we have in omap2plus_defconfig.
> 
> If palmas-clk is not loaded before twl6040 probes, we will get a
> "clk32k is not handled" warning during booting. This means that any
> drivers relying on this clock will mysteriously fail, including
> omap5-uevm WLAN and audio.
> 
> Note that for WLAN, we probably should also eventually get
> the clk32kgaudio for MMC3 directly as that's shared between
> audio and WLAN SDIO at least for omap5-uevm. It seems the
> WLAN chip cannot get it as otherwise MMC3 won't get properly
> probed.

While this is going to 'fix' the WLAN because currently the twl6040 is powered
on all the time (32k clock is enabled). My plan is to finally implement the
power state handling for the twl6040, which means that w/o audio activity the
twl6040 will be turned off. This will imply that any clock which is only used
by twl6040 will be off as well.
The proper solution would be to add clock handling to the WLAN driver stack.

Otherwise:
Acked-by: Peter Ujfalusi 

> Fixes: 68bab8662f49 ("mfd: twl6040: Optional clk32k clock handling")
> Cc: Benoit Cousson 
> Cc: Dr. H. Nikolaus Schaller 
> Cc: Grazvydas Ignotas 
> Cc: Lee Jones 
> Cc: Peter Ujfalusi 
> Cc: Samuel Ortiz 
> Cc: Sourav Poddar 
> Signed-off-by: Tony Lindgren 
> ---
>  drivers/mfd/twl6040.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> --- a/drivers/mfd/twl6040.c
> +++ b/drivers/mfd/twl6040.c
> @@ -647,6 +647,8 @@ static int twl6040_probe(struct i2c_client *client,
>  
>   twl6040->clk32k = devm_clk_get(>dev, "clk32k");
>   if (IS_ERR(twl6040->clk32k)) {
> + if (PTR_ERR(twl6040->clk32k) == -EPROBE_DEFER)
> + return -EPROBE_DEFER;
>   dev_info(>dev, "clk32k is not handled\n");
>   twl6040->clk32k = NULL;
>   }
> 


-- 
Péter
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] mfd: twl6040: Fix deferred probe handling for clk32k

2015-09-19 Thread Lee Jones
On Fri, 18 Sep 2015, Tony Lindgren wrote:

> Commit 68bab8662f49 ("mfd: twl6040: Optional clk32k clock handling")
> added clock handling for the 32k clock from palmas-clk. However, that
> patch did not consider a typical situation where twl6040 is built-in,
> and palmas-clk is a loadable module like we have in omap2plus_defconfig.
> 
> If palmas-clk is not loaded before twl6040 probes, we will get a
> "clk32k is not handled" warning during booting. This means that any
> drivers relying on this clock will mysteriously fail, including
> omap5-uevm WLAN and audio.
> 
> Note that for WLAN, we probably should also eventually get
> the clk32kgaudio for MMC3 directly as that's shared between
> audio and WLAN SDIO at least for omap5-uevm. It seems the
> WLAN chip cannot get it as otherwise MMC3 won't get properly
> probed.
> 
> Fixes: 68bab8662f49 ("mfd: twl6040: Optional clk32k clock handling")
> Cc: Benoit Cousson 
> Cc: Dr. H. Nikolaus Schaller 
> Cc: Grazvydas Ignotas 
> Cc: Lee Jones 
> Cc: Peter Ujfalusi 
> Cc: Samuel Ortiz 
> Cc: Sourav Poddar 
> Signed-off-by: Tony Lindgren 
> ---
>  drivers/mfd/twl6040.c | 2 ++
>  1 file changed, 2 insertions(+)

Applied, thanks.

> --- a/drivers/mfd/twl6040.c
> +++ b/drivers/mfd/twl6040.c
> @@ -647,6 +647,8 @@ static int twl6040_probe(struct i2c_client *client,
>  
>   twl6040->clk32k = devm_clk_get(>dev, "clk32k");
>   if (IS_ERR(twl6040->clk32k)) {
> + if (PTR_ERR(twl6040->clk32k) == -EPROBE_DEFER)
> + return -EPROBE_DEFER;
>   dev_info(>dev, "clk32k is not handled\n");
>   twl6040->clk32k = NULL;
>   }

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] mfd: twl6040: Fix deferred probe handling for clk32k

2015-09-18 Thread Felipe Balbi
On Fri, Sep 18, 2015 at 09:29:04AM -0700, Tony Lindgren wrote:
> Commit 68bab8662f49 ("mfd: twl6040: Optional clk32k clock handling")
> added clock handling for the 32k clock from palmas-clk. However, that
> patch did not consider a typical situation where twl6040 is built-in,
> and palmas-clk is a loadable module like we have in omap2plus_defconfig.
> 
> If palmas-clk is not loaded before twl6040 probes, we will get a
> "clk32k is not handled" warning during booting. This means that any
> drivers relying on this clock will mysteriously fail, including
> omap5-uevm WLAN and audio.
> 
> Note that for WLAN, we probably should also eventually get
> the clk32kgaudio for MMC3 directly as that's shared between
> audio and WLAN SDIO at least for omap5-uevm. It seems the
> WLAN chip cannot get it as otherwise MMC3 won't get properly
> probed.
> 
> Fixes: 68bab8662f49 ("mfd: twl6040: Optional clk32k clock handling")
> Cc: Benoit Cousson 
> Cc: Dr. H. Nikolaus Schaller 
> Cc: Grazvydas Ignotas 
> Cc: Lee Jones 
> Cc: Peter Ujfalusi 
> Cc: Samuel Ortiz 
> Cc: Sourav Poddar 
> Signed-off-by: Tony Lindgren 

Reviewed-by: Felipe Balbi 

> ---
>  drivers/mfd/twl6040.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> --- a/drivers/mfd/twl6040.c
> +++ b/drivers/mfd/twl6040.c
> @@ -647,6 +647,8 @@ static int twl6040_probe(struct i2c_client *client,
>  
>   twl6040->clk32k = devm_clk_get(>dev, "clk32k");
>   if (IS_ERR(twl6040->clk32k)) {
> + if (PTR_ERR(twl6040->clk32k) == -EPROBE_DEFER)
> + return -EPROBE_DEFER;
>   dev_info(>dev, "clk32k is not handled\n");
>   twl6040->clk32k = NULL;
>   }
> -- 
> 2.1.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
balbi


signature.asc
Description: Digital signature


[PATCH 1/2] mfd: twl6040: Fix deferred probe handling for clk32k

2015-09-18 Thread Tony Lindgren
Commit 68bab8662f49 ("mfd: twl6040: Optional clk32k clock handling")
added clock handling for the 32k clock from palmas-clk. However, that
patch did not consider a typical situation where twl6040 is built-in,
and palmas-clk is a loadable module like we have in omap2plus_defconfig.

If palmas-clk is not loaded before twl6040 probes, we will get a
"clk32k is not handled" warning during booting. This means that any
drivers relying on this clock will mysteriously fail, including
omap5-uevm WLAN and audio.

Note that for WLAN, we probably should also eventually get
the clk32kgaudio for MMC3 directly as that's shared between
audio and WLAN SDIO at least for omap5-uevm. It seems the
WLAN chip cannot get it as otherwise MMC3 won't get properly
probed.

Fixes: 68bab8662f49 ("mfd: twl6040: Optional clk32k clock handling")
Cc: Benoit Cousson 
Cc: Dr. H. Nikolaus Schaller 
Cc: Grazvydas Ignotas 
Cc: Lee Jones 
Cc: Peter Ujfalusi 
Cc: Samuel Ortiz 
Cc: Sourav Poddar 
Signed-off-by: Tony Lindgren 
---
 drivers/mfd/twl6040.c | 2 ++
 1 file changed, 2 insertions(+)

--- a/drivers/mfd/twl6040.c
+++ b/drivers/mfd/twl6040.c
@@ -647,6 +647,8 @@ static int twl6040_probe(struct i2c_client *client,
 
twl6040->clk32k = devm_clk_get(>dev, "clk32k");
if (IS_ERR(twl6040->clk32k)) {
+   if (PTR_ERR(twl6040->clk32k) == -EPROBE_DEFER)
+   return -EPROBE_DEFER;
dev_info(>dev, "clk32k is not handled\n");
twl6040->clk32k = NULL;
}
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html