* [U-Boot] [PATCH] NET: designware: fix clock enable
@ 2018-02-06 14:12 Eugeniy Paltsev
2018-02-06 15:21 ` Patrice CHOTARD
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Eugeniy Paltsev @ 2018-02-06 14:12 UTC (permalink / raw)
To: u-boot
After commit ba1f966725223 "net: designware: add clock support"
we got NET broken on axs101 and axs103 platforms.
Some clock don't support gating so their clock drivers don't
implement .enable/.disable callbacks. In such case clk_enable
returns -ENOSYS.
Also some clock drivers implement .enable/.disable callbacks not for all
clock IDs and return -ENOSYS (or -ENOTSUPP) for others.
If we have such clock in 'clocks' list of designware ethernet controller
node we fail to probe designware ethernet.
Fix it.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
---
drivers/net/designware.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/designware.c b/drivers/net/designware.c
index 6d53071..43670a7 100644
--- a/drivers/net/designware.c
+++ b/drivers/net/designware.c
@@ -684,7 +684,7 @@ int designware_eth_probe(struct udevice *dev)
break;
err = clk_enable(&priv->clocks[i]);
- if (err) {
+ if (err && err != -ENOSYS && err != -ENOTSUPP) {
pr_err("failed to enable clock %d\n", i);
clk_free(&priv->clocks[i]);
goto clk_err;
--
2.9.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] NET: designware: fix clock enable
2018-02-06 14:12 [U-Boot] [PATCH] NET: designware: fix clock enable Eugeniy Paltsev
@ 2018-02-06 15:21 ` Patrice CHOTARD
2018-02-06 18:36 ` Joe Hershberger
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Patrice CHOTARD @ 2018-02-06 15:21 UTC (permalink / raw)
To: u-boot
Hi Eugeniy
On 02/06/2018 03:12 PM, Eugeniy Paltsev wrote:
> After commit ba1f966725223 "net: designware: add clock support"
> we got NET broken on axs101 and axs103 platforms.
>
> Some clock don't support gating so their clock drivers don't
> implement .enable/.disable callbacks. In such case clk_enable
> returns -ENOSYS.
> Also some clock drivers implement .enable/.disable callbacks not for all
> clock IDs and return -ENOSYS (or -ENOTSUPP) for others.
>
> If we have such clock in 'clocks' list of designware ethernet controller
> node we fail to probe designware ethernet.
>
> Fix it.
>
> Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
> ---
> drivers/net/designware.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/designware.c b/drivers/net/designware.c
> index 6d53071..43670a7 100644
> --- a/drivers/net/designware.c
> +++ b/drivers/net/designware.c
> @@ -684,7 +684,7 @@ int designware_eth_probe(struct udevice *dev)
> break;
>
> err = clk_enable(&priv->clocks[i]);
> - if (err) {
> + if (err && err != -ENOSYS && err != -ENOTSUPP) {
> pr_err("failed to enable clock %d\n", i);
> clk_free(&priv->clocks[i]);
> goto clk_err;
>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Thanks
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] NET: designware: fix clock enable
2018-02-06 14:12 [U-Boot] [PATCH] NET: designware: fix clock enable Eugeniy Paltsev
2018-02-06 15:21 ` Patrice CHOTARD
@ 2018-02-06 18:36 ` Joe Hershberger
2018-02-26 11:15 ` Dr. Philipp Tomsich
2018-03-05 19:54 ` [U-Boot] " Joe Hershberger
3 siblings, 0 replies; 5+ messages in thread
From: Joe Hershberger @ 2018-02-06 18:36 UTC (permalink / raw)
To: u-boot
On Tue, Feb 6, 2018 at 8:12 AM, Eugeniy Paltsev
<Eugeniy.Paltsev@synopsys.com> wrote:
> After commit ba1f966725223 "net: designware: add clock support"
> we got NET broken on axs101 and axs103 platforms.
>
> Some clock don't support gating so their clock drivers don't
> implement .enable/.disable callbacks. In such case clk_enable
> returns -ENOSYS.
> Also some clock drivers implement .enable/.disable callbacks not for all
> clock IDs and return -ENOSYS (or -ENOTSUPP) for others.
>
> If we have such clock in 'clocks' list of designware ethernet controller
> node we fail to probe designware ethernet.
>
> Fix it.
>
> Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] NET: designware: fix clock enable
2018-02-06 14:12 [U-Boot] [PATCH] NET: designware: fix clock enable Eugeniy Paltsev
2018-02-06 15:21 ` Patrice CHOTARD
2018-02-06 18:36 ` Joe Hershberger
@ 2018-02-26 11:15 ` Dr. Philipp Tomsich
2018-03-05 19:54 ` [U-Boot] " Joe Hershberger
3 siblings, 0 replies; 5+ messages in thread
From: Dr. Philipp Tomsich @ 2018-02-26 11:15 UTC (permalink / raw)
To: u-boot
> On 6 Feb 2018, at 15:12, Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> wrote:
>
> After commit ba1f966725223 "net: designware: add clock support"
> we got NET broken on axs101 and axs103 platforms.
>
> Some clock don't support gating so their clock drivers don't
> implement .enable/.disable callbacks. In such case clk_enable
> returns -ENOSYS.
> Also some clock drivers implement .enable/.disable callbacks not for all
> clock IDs and return -ENOSYS (or -ENOTSUPP) for others.
>
> If we have such clock in 'clocks' list of designware ethernet controller
> node we fail to probe designware ethernet.
>
> Fix it.
>
> Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
See below for recommended changes.
> ---
> drivers/net/designware.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/designware.c b/drivers/net/designware.c
> index 6d53071..43670a7 100644
> --- a/drivers/net/designware.c
> +++ b/drivers/net/designware.c
> @@ -684,7 +684,7 @@ int designware_eth_probe(struct udevice *dev)
> break;
>
> err = clk_enable(&priv->clocks[i]);
> - if (err) {
> + if (err && err != -ENOSYS && err != -ENOTSUPP) {
I agree on the ENOSYS, but not the ENOTSUPP: if an enable function
exists, it should explicitly handle the requested clock (even if it is just a
no-op due to the driver knowing that it is always enabled).
Just as a side-note: most clock drivers return ENOENT, if they don’t
know about a specific clock… whereas ENOTSUPP should be returned
if a clock is known, but the specific operation on the clock is not supported
(e.g. clk_disable on an always-on clock … or one that is critical to the
system such as a fundamental PLL).
Thanks,
Philipp.
> pr_err("failed to enable clock %d\n", i);
> clk_free(&priv->clocks[i]);
> goto clk_err;
> --
> 2.9.3
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] NET: designware: fix clock enable
2018-02-06 14:12 [U-Boot] [PATCH] NET: designware: fix clock enable Eugeniy Paltsev
` (2 preceding siblings ...)
2018-02-26 11:15 ` Dr. Philipp Tomsich
@ 2018-03-05 19:54 ` Joe Hershberger
3 siblings, 0 replies; 5+ messages in thread
From: Joe Hershberger @ 2018-03-05 19:54 UTC (permalink / raw)
To: u-boot
Hi Eugeniy,
https://patchwork.ozlabs.org/patch/869785/ was applied to http://git.denx.de/?p=u-boot/u-boot-net.git
Thanks!
-Joe
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-03-05 19:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-06 14:12 [U-Boot] [PATCH] NET: designware: fix clock enable Eugeniy Paltsev
2018-02-06 15:21 ` Patrice CHOTARD
2018-02-06 18:36 ` Joe Hershberger
2018-02-26 11:15 ` Dr. Philipp Tomsich
2018-03-05 19:54 ` [U-Boot] " Joe Hershberger
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.