[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200713164728.GH1078057@lunn.ch>
Date: Mon, 13 Jul 2020 18:47:28 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Vladimir Oltean <olteanv@...il.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org, f.fainelli@...il.com,
vivien.didelot@...il.com, xiyou.wangcong@...il.com,
ap420073@...il.com
Subject: Re: [PATCH net] net: dsa: link interfaces with the DSA master to get
rid of lockdep warnings
> diff --git a/net/dsa/slave.c b/net/dsa/slave.c
> index 743caabeaaa6..a951b2a7d79a 100644
> --- a/net/dsa/slave.c
> +++ b/net/dsa/slave.c
> @@ -1994,6 +1994,13 @@ int dsa_slave_create(struct dsa_port *port)
> ret, slave_dev->name);
> goto out_phy;
> }
> + rtnl_lock();
> + ret = netdev_upper_dev_link(master, slave_dev, NULL);
> + rtnl_unlock();
> + if (ret) {
> + unregister_netdevice(slave_dev);
> + goto out_phy;
> + }
Hi Vladimir
A common pattern we see in bugs is that the driver sets up something
critical after calling register_netdev(), not realising that that call
can go off and really start using the interface before it returns. So
in general, i like to have register_netdev() last, nothing after it.
Please could you move this before register_netdev().
Thanks
Andrew
Powered by blists - more mailing lists