Skip to contentSkip to conversation

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

PATCH In review Vignesh Raghavendra 3 participants 3 messages Jan 28, 2022 – Feb 4, 2022 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/net/ti/am65-cpsw-nuss.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ti/am65-cpsw-nuss.c +1 -1
index 454986ff15..87f51b3b99 100644
@@ -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,
 };
Signature · 1 line
2.35.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 25 lines · Vignesh Raghavendra

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.

---
 drivers/net/ti/am65-cpsw-nuss.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ti/am65-cpsw-nuss.c +1 -2
index 454986ff15..87f51b3b99 100644
@@ -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,
 };
--
Quoted 2 lines

2.35.0

#2 lore raw
In reply to Vignesh Raghavendra
Quoted 9 lines · Vignesh Raghavendra

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.

Applied to u-boot/master, thanks!

Signature · 1 line
Tom