[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230804111045.rk3yvo5xb4wxyvoa@skbuf>
Date: Fri, 4 Aug 2023 14:10:45 +0300
From: Vladimir Oltean <vladimir.oltean@....com>
To: Simon Horman <horms@...nel.org>
Cc: netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
Claudiu Manoil <claudiu.manoil@....com>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
UNGLinuxDriver@...rochip.com,
Colin Foster <colin.foster@...advantage.com>
Subject: Re: [PATCH net] net: dsa: ocelot: call dsa_tag_8021q_unregister()
under rtnl_lock() on driver remove
On Thu, Aug 03, 2023 at 09:29:38PM +0200, Simon Horman wrote:
> On Thu, Aug 03, 2023 at 04:42:53PM +0300, Vladimir Oltean wrote:
> > diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c
> > index fd7eb4a52918..9a3e5ec16972 100644
> > --- a/drivers/net/dsa/ocelot/felix.c
> > +++ b/drivers/net/dsa/ocelot/felix.c
> > @@ -1619,8 +1619,10 @@ static void felix_teardown(struct dsa_switch *ds)
> > struct felix *felix = ocelot_to_felix(ocelot);
> > struct dsa_port *dp;
> >
> > + rtnl_lock();
> > if (felix->tag_proto_ops)
> > felix->tag_proto_ops->teardown(ds);
> > + rtnl_unlock();
>
> Hi Vladimir,
>
> I am curious to know if RTNL could be taken in
> felix_tag_8021q_teardown() instead.
Negative. This call path also exists:
dsa_tree_change_tag_proto()
-> rtnl_trylock()
-> dsa_tree_notify(dst, DSA_NOTIFIER_TAG_PROTO, &info)
-> dsa_switch_change_tag_proto()
-> ds->ops->change_tag_protocol()
-> felix_change_tag_protocol()
-> old_proto_ops->teardown()
-> felix_tag_8021q_teardown()
where the rtnl_mutex is already held.
Powered by blists - more mailing lists