[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZUaCiGVPwcuTtjYW@shell.armlinux.org.uk>
Date: Sat, 4 Nov 2023 17:42:32 +0000
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: Andrew Lunn <andrew@...n.ch>
Cc: Klaus Kudielka <klaus.kudielka@...il.com>,
"David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH] leds: triggers: netdev: add a check, whether device is up
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!
Powered by blists - more mailing lists