Skip to contentSkip to conversation

driver: net: fsl-mc: fsl_mc_ldpaa_exit exit earlier if dpl applied

PATCH New Santan Kumar 4 participants 7 messages Jun 29, 2017 – Aug 10, 2017 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 driver: net: fsl-mc: fsl_mc_ldpaa_exit exit earlier if dpl applied

In fsl_mc_ldpaa_exit(), in case of mc is booted and dpl is applied, it should return earlier without executing dpbp_exit()

---
This piece of code is mistakenly removed in below patch.
https://patchwork.ozlabs.org/patch/756038/

 drivers/net/fsl-mc/mc.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/net/fsl-mc/mc.c +9 -2
index 8bf25c7..3a30c03 100644
@@ -1336,14 +1336,18 @@ int fsl_mc_ldpaa_exit(bd_t *bd)
 {
 	int err = 0;
 	bool is_dpl_apply_status = false;
+	bool mc_boot_status = false;
 
 	if (bd && mc_lazy_dpl_addr && !fsl_mc_ldpaa_exit(NULL)) {
 		mc_apply_dpl(mc_lazy_dpl_addr);
 		mc_lazy_dpl_addr = 0;
 	}
 
+	if (!get_mc_boot_status())
+		mc_boot_status = true;
+
 	/* MC is not loaded intentionally, So return success. */
-	if (bd && get_mc_boot_status() != 0)
+	if (bd && !mc_boot_status)
 		return 0;
 
 	/* If DPL is deployed, set is_dpl_apply_status as TRUE. */
@@ -1354,11 +1358,14 @@ int fsl_mc_ldpaa_exit(bd_t *bd)
 	 * 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) {
+	if (bd && mc_boot_status && !is_dpl_apply_status) {
 		printf("fsl-mc: DPL not deployed, DPAA2 ethernet not work\n");
 		return 0;
 	}
 
+	if (bd && mc_boot_status && is_dpl_apply_status)
+		return 0;
+
 	err = dpbp_exit();
 	if (err < 0) {
 		printf("dpbp_exit() failed: %d\n", err);
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 driver: net: fsl-mc: fsl_mc_ldpaa_exit exit earlier if dpl applied

Quoted 43 lines · Santan Kumar

In fsl_mc_ldpaa_exit(), in case of mc is booted and dpl is applied, it should return earlier without executing dpbp_exit()

---
This piece of code is mistakenly removed in below patch.
https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchwork.ozlabs.org%2Fpatch%2F756038%2F&data=01%7C01%7Cyork.sun%40nxp.com%7C67ffe48248b14183512708d4beb2434e%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0&sdata=PvzNEpCqJ8MOLT9vRSNuNLTeH9hjxLxQi97ngEkrXf0%3D&reserved=0

  drivers/net/fsl-mc/mc.c | 11 +++++++++--
  1 file changed, 9 insertions(+), 2 deletions(-)
drivers/net/fsl-mc/mc.c +6 -2
index 8bf25c7..3a30c03 100644
@@ -1336,14 +1336,18 @@ int fsl_mc_ldpaa_exit(bd_t *bd)
  {
  	int err = 0;
  	bool is_dpl_apply_status = false;
+	bool mc_boot_status = false;
 
  	if (bd && mc_lazy_dpl_addr && !fsl_mc_ldpaa_exit(NULL)) {
  		mc_apply_dpl(mc_lazy_dpl_addr);
  		mc_lazy_dpl_addr = 0;
  	}
 
+	if (!get_mc_boot_status())
+		mc_boot_status = true;
+
  	/* MC is not loaded intentionally, So return success. */
-	if (bd && get_mc_boot_status() != 0)
+	if (bd && !mc_boot_status)
  		return 0;
 
  	/* If DPL is deployed, set is_dpl_apply_status as TRUE. */
@@ -1354,11 +1358,14 @@ int fsl_mc_ldpaa_exit(bd_t *bd)
  	 * 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) {
+	if (bd && mc_boot_status && !is_dpl_apply_status) {

drivers/net/fsl-mc/mc.c int fsl_mc_ldpaa_exit(bd_t *bd) · line 1371

Quoted 10 lines
drivers/net/fsl-mc/mc.c +3 -0
  		printf("fsl-mc: DPL not deployed, DPAA2 ethernet not work\n");
  		return 0;
  	}
 
+	if (bd && mc_boot_status && is_dpl_apply_status)
+		return 0;
+
  	err = dpbp_exit();
  	if (err < 0) {
  		printf("dpbp_exit() failed: %d\n", err);

Yogesh and Priyanka,

Please review this patch. Thanks.

York

#2 lore raw

PATCH 1/1 driver: net: fsl-mc: fsl_mc_ldpaa_exit exit earlier if dpl applied

Ack-ed

--Priyanka

Quoted 80 lines

-----Original Message-----
From: York Sun
Sent: Tuesday, August 08, 2017 2:43 AM
To: Yogesh Narayan Gaur <[email protected]>; Priyanka Jain <[email protected]>
Cc: Santan Kumar <[email protected]>; u-boot at lists.denx.de; Prabhakar Kushwaha <[email protected]>
Subject: Re: [PATCH 1/1] driver: net: fsl-mc: fsl_mc_ldpaa_exit exit earlier if dpl applied

Quoted 10 lines · Santan Kumar

In fsl_mc_ldpaa_exit(), in case of mc is booted and dpl is applied, it should return earlier without executing
dpbp_exit()

---
This piece of code is mistakenly removed in below patch.

https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpat

chwork.ozlabs.org%2Fpatch%2F756038%2F&data=01%7C01%7Cyork.sun%40nx p.co

Quoted 1 line

m%7C67ffe48248b14183512708d4beb2434e%7C686ea1d3bc2b4c6fa92cd99c5c 30163

Quoted 1 line

5%7C0&sdata=PvzNEpCqJ8MOLT9vRSNuNLTeH9hjxLxQi97ngEkrXf0%3D&reserv ed=0

Quoted 35 lines
  drivers/net/fsl-mc/mc.c | 11 +++++++++--
  1 file changed, 9 insertions(+), 2 deletions(-)
drivers/net/fsl-mc/mc.c index renamed from drivers/net/fsl-mc/mc.c +0 -0

8bf25c7..3a30c03 100644

drivers/net/fsl-mc/mc.c +6 -3
@@ -1336,14 +1336,18 @@ int fsl_mc_ldpaa_exit(bd_t *bd)
  {
  	int err = 0;
  	bool is_dpl_apply_status = false;
+	bool mc_boot_status = false;
 
  	if (bd && mc_lazy_dpl_addr && !fsl_mc_ldpaa_exit(NULL)) {
  		mc_apply_dpl(mc_lazy_dpl_addr);
  		mc_lazy_dpl_addr = 0;
  	}
 
+	if (!get_mc_boot_status())
+		mc_boot_status = true;
+
  	/* MC is not loaded intentionally, So return success. */
-	if (bd && get_mc_boot_status() != 0)
+	if (bd && !mc_boot_status)
  		return 0;
 
  	/* If DPL is deployed, set is_dpl_apply_status as TRUE. */ @@
-1354,11 +1358,14 @@ int fsl_mc_ldpaa_exit(bd_t *bd)
  	 * 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) {
+	if (bd && mc_boot_status && !is_dpl_apply_status) {

drivers/net/fsl-mc/mc.c int fsl_mc_ldpaa_exit(bd_t *bd)

Quoted 10 lines
drivers/net/fsl-mc/mc.c +3 -0
  		printf("fsl-mc: DPL not deployed, DPAA2 ethernet not work\n");
  		return 0;
  	}
 
+	if (bd && mc_boot_status && is_dpl_apply_status)
+		return 0;
+
  	err = dpbp_exit();
  	if (err < 0) {
  		printf("dpbp_exit() failed: %d\n", err);

Yogesh and Priyanka,

Please review this patch. Thanks.

York

#3 lore raw

PATCH 1/1 driver: net: fsl-mc: fsl_mc_ldpaa_exit exit earlier if dpl applied

Quoted 2 lines · Priyanka Jain

Ack-ed

Thanks. For future use, please use this format

This will be captured by patchwork so I can type less. :)

York

#4 lore raw

PATCH 1/1 driver: net: fsl-mc: fsl_mc_ldpaa_exit exit earlier if dpl applied

In reply to York Sun

Ack-ed

--
Yogesh Gaur

Quoted 80 lines

-----Original Message-----
From: York Sun
Sent: Tuesday, August 08, 2017 2:43 AM
To: Yogesh Narayan Gaur <[email protected]>; Priyanka Jain <[email protected]>
Cc: Santan Kumar <[email protected]>; u-boot at lists.denx.de; Prabhakar Kushwaha <[email protected]>
Subject: Re: [PATCH 1/1] driver: net: fsl-mc: fsl_mc_ldpaa_exit exit earlier if dpl applied

Quoted 10 lines · Santan Kumar

In fsl_mc_ldpaa_exit(), in case of mc is booted and dpl is applied, it should return earlier without executing
dpbp_exit()

---
This piece of code is mistakenly removed in below patch.

https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpat

chwork.ozlabs.org%2Fpatch%2F756038%2F&data=01%7C01%7Cyork.sun%40nx p.co

Quoted 1 line

m%7C67ffe48248b14183512708d4beb2434e%7C686ea1d3bc2b4c6fa92cd99c5c 30163

Quoted 1 line

5%7C0&sdata=PvzNEpCqJ8MOLT9vRSNuNLTeH9hjxLxQi97ngEkrXf0%3D&reserv ed=0

Quoted 35 lines
  drivers/net/fsl-mc/mc.c | 11 +++++++++--
  1 file changed, 9 insertions(+), 2 deletions(-)
drivers/net/fsl-mc/mc.c index renamed from drivers/net/fsl-mc/mc.c +0 -0

8bf25c7..3a30c03 100644

drivers/net/fsl-mc/mc.c +6 -3
@@ -1336,14 +1336,18 @@ int fsl_mc_ldpaa_exit(bd_t *bd)
  {
  	int err = 0;
  	bool is_dpl_apply_status = false;
+	bool mc_boot_status = false;
 
  	if (bd && mc_lazy_dpl_addr && !fsl_mc_ldpaa_exit(NULL)) {
  		mc_apply_dpl(mc_lazy_dpl_addr);
  		mc_lazy_dpl_addr = 0;
  	}
 
+	if (!get_mc_boot_status())
+		mc_boot_status = true;
+
  	/* MC is not loaded intentionally, So return success. */
-	if (bd && get_mc_boot_status() != 0)
+	if (bd && !mc_boot_status)
  		return 0;
 
  	/* If DPL is deployed, set is_dpl_apply_status as TRUE. */ @@
-1354,11 +1358,14 @@ int fsl_mc_ldpaa_exit(bd_t *bd)
  	 * 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) {
+	if (bd && mc_boot_status && !is_dpl_apply_status) {

drivers/net/fsl-mc/mc.c int fsl_mc_ldpaa_exit(bd_t *bd)

Quoted 10 lines
drivers/net/fsl-mc/mc.c +3 -0
  		printf("fsl-mc: DPL not deployed, DPAA2 ethernet not work\n");
  		return 0;
  	}
 
+	if (bd && mc_boot_status && is_dpl_apply_status)
+		return 0;
+
  	err = dpbp_exit();
  	if (err < 0) {
  		printf("dpbp_exit() failed: %d\n", err);

Yogesh and Priyanka,

Please review this patch. Thanks.

York

#5 lore raw

PATCH 1/1 driver: net: fsl-mc: fsl_mc_ldpaa_exit exit earlier if dpl applied

Quoted 2 lines · Yogesh Narayan Gaur

Ack-ed

Thanks. For future use, please use this format

This will be captured by patchwork.

York

Applied
#6 lore raw

PATCH 1/1 driver: net: fsl-mc: fsl_mc_ldpaa_exit exit earlier if dpl applied

In reply to Yogesh Narayan Gaur
Quoted 7 lines
Quoted 7 lines · Santan Kumar
Quoted 6 lines

In fsl_mc_ldpaa_exit(), in case of mc is booted and dpl is applied, it should return earlier without executing
dpbp_exit()

---

Applied to fsl-qoriq master, awaiting upstream.
Thanks.

York