From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Klaus Kudielka <klaus.kudielka@gmail.com>,
"David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH] leds: triggers: netdev: add a check, whether device is up
Date: Sat, 4 Nov 2023 17:42:32 +0000 [thread overview]
Message-ID: <ZUaCiGVPwcuTtjYW@shell.armlinux.org.uk> (raw)
In-Reply-To: <53f3e4ff-2afd-4acb-8cd4-55bdd1defd0d@lunn.ch>
On Sat, Nov 04, 2023 at 05:46:44PM +0100, Andrew Lunn wrote:
> On Sat, Nov 04, 2023 at 05:32:19PM +0100, Klaus Kudielka wrote:
> > 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?
>
> Crossing emails.
>
> Its a better approach. But it fixes just one driver. If we can do this
> in phylink_create(), we fix it in a lot of drivers with a single
> change...
... and I think we should.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
next prev parent reply other threads:[~2023-11-04 17:42 UTC|newest]
Thread overview: 9+ 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
2023-11-04 16:46 ` Andrew Lunn
2023-11-04 17:42 ` Russell King (Oracle) [this message]
2023-11-04 19:46 ` Klaus Kudielka
2023-11-04 16:41 ` Andrew Lunn
2023-11-04 17:12 ` Russell King (Oracle)
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=ZUaCiGVPwcuTtjYW@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=klaus.kudielka@gmail.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.