[PATCH] net: ti: am65-cpsw: Cleanup resources before jump to kernel

In case fastboot over Ethernet, am65_cpsw_stop() is not called unless DM_FLAG_OS_PREPARE is set. Without call to am65_cpsw_stop(), DMA resources are not released thus leading to failures in kernel. Fix this by adding DM_FLAG_OS_PREPARE flag to am65_cpsw_nuss_port driver.
Reported-by: Christian Gmeiner christian.gmeiner@gmail.com Signed-off-by: Vignesh Raghavendra vigneshr@ti.com --- drivers/net/ti/am65-cpsw-nuss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ti/am65-cpsw-nuss.c b/drivers/net/ti/am65-cpsw-nuss.c index 454986ff15..87f51b3b99 100644 --- a/drivers/net/ti/am65-cpsw-nuss.c +++ b/drivers/net/ti/am65-cpsw-nuss.c @@ -817,5 +817,5 @@ U_BOOT_DRIVER(am65_cpsw_nuss_port) = { .ops = &am65_cpsw_ops, .priv_auto = sizeof(struct am65_cpsw_priv), .plat_auto = sizeof(struct eth_pdata), - .flags = DM_FLAG_ALLOC_PRIV_DMA, + .flags = DM_FLAG_ALLOC_PRIV_DMA | DM_FLAG_OS_PREPARE, };

On Fri, Jan 28, 2022 at 7:51 AM Vignesh Raghavendra vigneshr@ti.com wrote:
In case fastboot over Ethernet, am65_cpsw_stop() is not called unless DM_FLAG_OS_PREPARE is set. Without call to am65_cpsw_stop(), DMA resources are not released thus leading to failures in kernel. Fix this by adding DM_FLAG_OS_PREPARE flag to am65_cpsw_nuss_port driver.
Reported-by: Christian Gmeiner christian.gmeiner@gmail.com Signed-off-by: Vignesh Raghavendra vigneshr@ti.com
drivers/net/ti/am65-cpsw-nuss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ti/am65-cpsw-nuss.c b/drivers/net/ti/am65-cpsw-nuss.c index 454986ff15..87f51b3b99 100644 --- a/drivers/net/ti/am65-cpsw-nuss.c +++ b/drivers/net/ti/am65-cpsw-nuss.c @@ -817,5 +817,5 @@ U_BOOT_DRIVER(am65_cpsw_nuss_port) = { .ops = &am65_cpsw_ops, .priv_auto = sizeof(struct am65_cpsw_priv), .plat_auto = sizeof(struct eth_pdata),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
.flags = DM_FLAG_ALLOC_PRIV_DMA | DM_FLAG_OS_PREPARE,
};
2.35.0
Reviewed-by: Ramon Fried rfried.dev@gmail.com

On Fri, Jan 28, 2022 at 11:21:19AM +0530, Vignesh Raghavendra wrote:
In case fastboot over Ethernet, am65_cpsw_stop() is not called unless DM_FLAG_OS_PREPARE is set. Without call to am65_cpsw_stop(), DMA resources are not released thus leading to failures in kernel. Fix this by adding DM_FLAG_OS_PREPARE flag to am65_cpsw_nuss_port driver.
Reported-by: Christian Gmeiner christian.gmeiner@gmail.com Signed-off-by: Vignesh Raghavendra vigneshr@ti.com Reviewed-by: Ramon Fried rfried.dev@gmail.com
Applied to u-boot/master, thanks!
participants (3)
-
Ramon Fried
-
Tom Rini
-
Vignesh Raghavendra