[U-Boot] [PATCH][v2] driver: net: fsl-mc: Update fsl_mc_ldpaa_exit() path

York Sun york.sun at nxp.com
Tue Apr 18 16:29:58 UTC 2017


On 04/16/2017 10:12 PM, Yogesh Gaur wrote:
> When MC is loaded, but DPL is not deployed, it results in FDT fix-up
> code execution hang.
> To resolve this, returns success instead of return -ENODEV and print message
> on console.
> This update allows to continue fdt fixup execution.
>
> Signed-off-by: Yogesh Gaur <yogeshnarayan.gaur at nxp.com>
> Signed-off-by: Priyanka Jain <Priyanka.jain at nxp.com>
> ---
> Changes for v2:
>  Incorporated Prabhakar's review comments.
>
>  drivers/net/fsl-mc/mc.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/fsl-mc/mc.c b/drivers/net/fsl-mc/mc.c
> index 079082a..d47fa1f 100644
> --- a/drivers/net/fsl-mc/mc.c
> +++ b/drivers/net/fsl-mc/mc.c
> @@ -1268,10 +1268,12 @@ int fsl_mc_ldpaa_exit(bd_t *bd)
>  	if (bd && get_mc_boot_status() != 0)
>  		return 0;
>
> +	/* For case MC is loaded but DPL is not deployed, return success and
> +	 * print message on console. Else FDT fix-up code execution hanged. */

Wrong format for multi-line comment.

>  	if (bd && !get_mc_boot_status() && get_dpl_apply_status() == -1) {
> -		printf("ERROR: fsl-mc: DPL is not applied\n");
> -		err = -ENODEV;
> -		return err;
> +		printf("fsl-mc: MC is loaded but DPL is not deployed \n\
> +			So, DPAA2 ethernet will not work in Linux\n");

Too verbose. Make is simple in one line please. For example,

printf("fsl-mc: DPL not deployed, DPAA Ethernet not work\n");

> +		return 0;
>  	}
>
>  	if (bd && !get_mc_boot_status() && !get_dpl_apply_status())
>

While you are on this file, can you add some comment to explain the 
logic? I don't remember why we have to check bd and get_mc_boot_status() 
over and over. Do we have more than binary state for mc_dpl_applied and 
mc_boot_status? If not, can we change them to bool and simplify the test 
condition?

York



More information about the U-Boot mailing list