From: Klaus Kudielka <klaus.kudielka@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Pavel Machek <pavel@ucw.cz>, Lee Jones <lee@kernel.org>,
Christian Marangi <ansuelsmth@gmail.com>,
"David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Samuel Holland <samuel@sholland.org>,
Jisheng Zhang <jszhang@kernel.org>,
Li Zetao <lizetao1@huawei.com>,
linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] leds: triggers: netdev: add a check, whether device is up
Date: Sat, 04 Nov 2023 17:32:19 +0100 [thread overview]
Message-ID: <970325157b7598b6367c293380cace3624e6cb88.camel@gmail.com> (raw)
In-Reply-To: <95ff53a1d1b9102c81a05076f40d47242579fc37.camel@gmail.com>
On Sat, 2023-11-04 at 16:27 +0100, Klaus Kudielka wrote:
>
> phylink_start() is the first one that does netif_carrier_off() and thus
> sets the NOCARRIER bit, but that only happens when bringing the device up.
>
> Before that, I would not know who cares about setting the NOCARRIER bit.
A different, driver-specific solution could be like this (tested and working):
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -5690,6 +5690,7 @@ static int mvneta_probe(struct platform_device *pdev)
/* 9676 == 9700 - 20 and rounding to 8 */
dev->max_mtu = 9676;
+ netif_carrier_off(dev);
err = register_netdev(dev);
if (err < 0) {
dev_err(&pdev->dev, "failed to register\n");
Would that be the "correct" approach?
Regards, Klaus
prev parent reply other threads:[~2023-11-04 16:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-04 12:58 [PATCH] leds: triggers: netdev: add a check, whether device is up Klaus Kudielka
2023-11-04 14:29 ` Andrew Lunn
2023-11-04 15:27 ` Klaus Kudielka
2023-11-04 16:32 ` Klaus Kudielka [this message]
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=970325157b7598b6367c293380cace3624e6cb88.camel@gmail.com \
--to=klaus.kudielka@gmail.com \
--cc=andrew@lunn.ch \
--cc=ansuelsmth@gmail.com \
--cc=davem@davemloft.net \
--cc=jszhang@kernel.org \
--cc=kuba@kernel.org \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=lizetao1@huawei.com \
--cc=pavel@ucw.cz \
--cc=samuel@sholland.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