[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <64b70058-f823-131f-9926-ee36cac69105@gmail.com>
Date: Mon, 7 Feb 2022 18:49:05 -0800
From: Florian Fainelli <f.fainelli@...il.com>
To: Vladimir Oltean <vladimir.oltean@....com>, netdev@...r.kernel.org
Cc: Andrew Lunn <andrew@...n.ch>,
Vivien Didelot <vivien.didelot@...il.com>,
Vladimir Oltean <olteanv@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Hauke Mehrtens <hauke@...ke-m.de>,
Sean Wang <sean.wang@...iatek.com>,
Landen Chao <Landen.Chao@...iatek.com>,
DENG Qingfang <dqfext@...il.com>,
Matthias Brugger <matthias.bgg@...il.com>,
Claudiu Manoil <claudiu.manoil@....com>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
UNGLinuxDriver@...rochip.com,
Oleksij Rempel <linux@...pel-privat.de>,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
Laurentiu Tudor <laurentiu.tudor@....com>,
Rafael Richter <rafael.richter@....de>,
Daniel Klauer <daniel.klauer@....de>
Subject: Re: [PATCH net 6/7] net: dsa: mt7530: fix kernel bug in
mdiobus_free() when unbinding
On 2/7/2022 8:15 AM, Vladimir Oltean wrote:
> Nobody in this driver calls mdiobus_unregister(), which is necessary if
> mdiobus_register() completes successfully. So if the devres callbacks
> that free the mdiobus get invoked (this is the case when unbinding the
> driver), mdiobus_free() will BUG if the mdiobus is still registered,
> which it is.
>
> My speculation is that this is due to the fact that prior to commit
> ac3a68d56651 ("net: phy: don't abuse devres in devm_mdiobus_register()")
> from June 2020, _devm_mdiobus_free() used to call mdiobus_unregister().
> But at the time that the mt7530 support was introduced in May 2021, the
> API was already changed. It's therefore likely that the blamed patch was
> developed on an older tree, and incorrectly adapted to net-next. This
> makes the Fixes: tag correct.
>
> Fix the problem by using the devres variant of mdiobus_register.
>
> Fixes: ba751e28d442 ("net: dsa: mt7530: add interrupt support")
> Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>
Reviewed-by: Florian Fainelli <f.fainelli@...il.com>
--
Florian
Powered by blists - more mailing lists