From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH] net: am65-cpsw-nuss: fix common enable counter
Date: Tue, 29 Apr 2025 16:05:18 +0200 [thread overview]
Message-ID: <20250429140518.3059481-1-s.hauer@pengutronix.de> (raw)
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
reply other threads:[~2025-04-29 14:15 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250429140518.3059481-1-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox