diff mbox

[U-Boot,v3] driver: net: fsl-mc: Update fsl_mc_ldpaa_exit() path

Message ID 1493268256-8036-1-git-send-email-yogeshnarayan.gaur@nxp.com
State Accepted
Commit 42e8179007bbfc5f4c0c80cd2131db8138f8546f
Delegated to: York Sun
Headers show

Commit Message

Yogesh Narayan Gaur April 27, 2017, 4:44 a.m. UTC
Earlier when MC is loaded but DPL is not deployed results in FDT fix-up
code execution hang.
For this case now print message on console and returns success instead of
return -ENODEV.
This update allows to continue fdt fixup execution.

Signed-off-by: Yogesh Gaur <yogeshnarayan.gaur@nxp.com>
Signed-off-by: Priyanka Jain <Priyanka.jain@nxp.com>
---
Changes for v3:
 Incorporated York's review comments.

 drivers/net/fsl-mc/mc.c | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

Comments

York Sun May 25, 2017, 3:01 p.m. UTC | #1
On 04/26/2017 09:44 PM, Yogesh Gaur wrote:
> Earlier when MC is loaded but DPL is not deployed results in FDT fix-up
> code execution hang.
> For this case now print message on console and returns success instead of
> return -ENODEV.
> This update allows to continue fdt fixup execution.
>
> Signed-off-by: Yogesh Gaur <yogeshnarayan.gaur@nxp.com>
> Signed-off-by: Priyanka Jain <Priyanka.jain@nxp.com>
> ---
> Changes for v3:
>  Incorporated York's review comments.
>
>  drivers/net/fsl-mc/mc.c | 20 +++++++++++++-------
>  1 file changed, 13 insertions(+), 7 deletions(-)

Reformatted commit message. Applied to fsl-qoriq master, awaiting 
upstream. Thanks.

York
diff mbox

Patch

diff --git a/drivers/net/fsl-mc/mc.c b/drivers/net/fsl-mc/mc.c
index 079082a..a0fbdcb 100644
--- a/drivers/net/fsl-mc/mc.c
+++ b/drivers/net/fsl-mc/mc.c
@@ -1,4 +1,5 @@ 
 /*
+ * Copyright (C) 2017 NXP Semiconductors
  * Copyright (C) 2014 Freescale Semiconductor
  *
  * SPDX-License-Identifier:	GPL-2.0+
@@ -1258,6 +1259,7 @@  err:
 int fsl_mc_ldpaa_exit(bd_t *bd)
 {
 	int err = 0;
+	bool is_dpl_apply_status = false;
 
 	if (bd && mc_lazy_dpl_addr && !fsl_mc_ldpaa_exit(NULL)) {
 		mc_apply_dpl(mc_lazy_dpl_addr);
@@ -1268,14 +1270,18 @@  int fsl_mc_ldpaa_exit(bd_t *bd)
 	if (bd && get_mc_boot_status() != 0)
 		return 0;
 
-	if (bd && !get_mc_boot_status() && get_dpl_apply_status() == -1) {
-		printf("ERROR: fsl-mc: DPL is not applied\n");
-		err = -ENODEV;
-		return err;
-	}
+	/* If DPL is deployed, set is_dpl_apply_status as TRUE. */
+	if (!get_dpl_apply_status())
+		is_dpl_apply_status = true;
 
-	if (bd && !get_mc_boot_status() && !get_dpl_apply_status())
-		return err;
+	/*
+	 * For case MC is loaded but DPL is not deployed, return success and
+	 * print message on console. Else FDT fix-up code execution hanged.
+	 */
+	if (bd && !get_mc_boot_status() && !is_dpl_apply_status) {
+		printf("fsl-mc: DPL not deployed, DPAA2 ethernet not work\n");
+		return 0;
+	}
 
 	err = dpbp_exit();
 	if (err < 0) {