[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180420.103430.1692883931904134627.davem@davemloft.net>
Date: Fri, 20 Apr 2018 10:34:30 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: andrew@...n.ch
Cc: netdev@...r.kernel.org, f.fainelli@...il.com,
vivien.didelot@...oirfairelinux.com
Subject: Re: [PATCH net-next] net: phy: mdio-boardinfo: Allow recursive
mdiobus_register()
From: Andrew Lunn <andrew@...n.ch>
Date: Thu, 19 Apr 2018 02:00:47 +0200
> mdiobus_register will search for any mdiobus board info registered for
> the bus being registered. If found, it will probe devices on the bus.
> That device, if for example it is an ethernet switch, may then try to
> register an mdio bus. Thus we need to allow recursive calls to
> mdiobus_register.
>
> Holding the mdio_board_lock will cause a deadlock during this
> recursion. Release the lock and use list_for_each_entry_safe.
>
> Signed-off-by: Andrew Lunn <andrew@...n.ch>
Applied.
While looking over this code I see that we currently never unregister
mdio boardinfo objects.
If we have drivers that can be unloaded, as it seems the one you plan
to add that needs this change should be, the situation could get more
tricky here.
Powered by blists - more mailing lists