mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] net: am65-cpsw-nuss: fix common enable counter
@ 2025-04-29 14:05 Sascha Hauer
  2025-04-30  9:02 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Sascha Hauer @ 2025-04-29 14:05 UTC (permalink / raw)
  To: Barebox List

The cpsw common is ought to be reference counted, but the reference
counter is only ever increased to one. Increase the reference for
additional am65_cpsw_common_start() calls.

This fixes a warning when barebox is shut down:

ERROR: 8000000.ethernet@8000000.of: dma failed with -22

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/net/am65-cpsw-nuss.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/am65-cpsw-nuss.c b/drivers/net/am65-cpsw-nuss.c
index 651b0b29cf..6b5a5d9533 100644
--- a/drivers/net/am65-cpsw-nuss.c
+++ b/drivers/net/am65-cpsw-nuss.c
@@ -274,8 +274,10 @@ static int am65_cpsw_common_start(struct am65_cpsw_common *common)
 	struct am65_cpsw_port *port0 = &common->ports[0];
 	int ret, i;
 
-	if (common->started)
+	if (common->started) {
+		common->started++;
 		return 0;
+	}
 
 	ret = clk_enable(common->fclk);
 	if (ret) {
-- 
2.39.5




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: am65-cpsw-nuss: fix common enable counter
  2025-04-29 14:05 [PATCH] net: am65-cpsw-nuss: fix common enable counter Sascha Hauer
@ 2025-04-30  9:02 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2025-04-30  9:02 UTC (permalink / raw)
  To: Barebox List, Sascha Hauer


On Tue, 29 Apr 2025 16:05:18 +0200, Sascha Hauer wrote:
> The cpsw common is ought to be reference counted, but the reference
> counter is only ever increased to one. Increase the reference for
> additional am65_cpsw_common_start() calls.
> 
> This fixes a warning when barebox is shut down:
> 
> ERROR: 8000000.ethernet@8000000.of: dma failed with -22
> 
> [...]

Applied, thanks!

[1/1] net: am65-cpsw-nuss: fix common enable counter
      https://git.pengutronix.de/cgit/barebox/commit/?id=426bfa6e8de5 (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-04-30  9:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-29 14:05 [PATCH] net: am65-cpsw-nuss: fix common enable counter Sascha Hauer
2025-04-30  9:02 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox