netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: andrew@lunn.ch
Cc: netdev@vger.kernel.org, f.fainelli@gmail.com,
	vivien.didelot@savoirfairelinux.com
Subject: Re: [PATCH net-next] net: phy: mdio-boardinfo: Allow recursive mdiobus_register()
Date: Fri, 20 Apr 2018 10:34:30 -0400 (EDT)	[thread overview]
Message-ID: <20180420.103430.1692883931904134627.davem@davemloft.net> (raw)
In-Reply-To: <1524096047-16823-1-git-send-email-andrew@lunn.ch>

From: Andrew Lunn <andrew@lunn.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@lunn.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.

  parent reply	other threads:[~2018-04-20 14:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-19  0:00 [PATCH net-next] net: phy: mdio-boardinfo: Allow recursive mdiobus_register() Andrew Lunn
2018-04-19  0:14 ` Florian Fainelli
2018-04-19  0:33   ` Andrew Lunn
2018-04-20 14:34 ` David Miller [this message]
2018-04-20 21:59   ` Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180420.103430.1692883931904134627.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=andrew@lunn.ch \
    --cc=f.fainelli@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=vivien.didelot@savoirfairelinux.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).