[U-Boot] [PATCH] NET: designware: fix clock enable

Patrice CHOTARD patrice.chotard at st.com
Tue Feb 6 15:21:32 UTC 2018


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 at 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 at st.com>

Thanks


More information about the U-Boot mailing list