[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <53f3e4ff-2afd-4acb-8cd4-55bdd1defd0d@lunn.ch>
Date: Sat, 4 Nov 2023 17:46:44 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Klaus Kudielka <klaus.kudielka@...il.com>
Cc: "David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, netdev <netdev@...r.kernel.org>,
Russell King <rmk+kernel@...linux.org.uk>
Subject: Re: [PATCH] leds: triggers: netdev: add a check, whether device is up
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...
Andrew
Powered by blists - more mailing lists