netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <florian@openwrt.org>
To: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Grant Likely <grant.likely@secretlab.ca>,
	Rob Herring <rob.herring@calxeda.com>,
	"David S. Miller" <davem@davemloft.net>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	netdev <netdev@vger.kernel.org>,
	"devicetree-discuss@lists.ozlabs.org"
	<devicetree-discuss@lists.ozlabs.org>,
	Lior Amsalem <alior@marvell.com>,
	Gregory Clement <gregory.clement@free-electrons.com>,
	Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Subject: Re: [RFC PATCH 2/3] net: phy: call mdiobus_scan() after adding a fixed PHY
Date: Mon, 15 Jul 2013 16:46:05 +0100	[thread overview]
Message-ID: <CAGVrzcbn0FASWBbj-zF+pYnUATm02tUurN_wM0YWrWrTBh+dJQ@mail.gmail.com> (raw)
In-Reply-To: <1373902450-11857-3-git-send-email-thomas.petazzoni@free-electrons.com>

Hello Thomas,

2013/7/15 Thomas Petazzoni <thomas.petazzoni@free-electrons.com>:
> The fixed_phy_add() function allows to register a fixed PHY. However,
> when this function gets called *after* fixed_mdio_bus_init() (which
> gets called at the module_init stage), then the fixed PHY is not
> registered into the phylib.
>
> In order to address this, we add a call to mdiobus_scan() in
> fixed_phy_add() to ensure that the PHY indeed gets registered into the
> phylib, even if the fixed_phy_add() is called after
> fixed_mdio_bus_init().
>
> This is needed because until now, the only code that was calling the
> fixed_add_phy() function was PowerPC-specific platform code, which
> could ensure that such fixed PHYs get registered before
> fixed_mdio_bus_init() is called.

arch/mips/ar7/platform.c also calls fixed_phy_add() early enough as
well to ensure that we do not need to rescan the MDIO bus. There is
also another user: arch/m68k/platform/coldfire/m5272.c

>
> However, with the new of_phy_register_fixed_link() function, device
> drivers can parse their 'fixed-link' property and register a fixed PHY
> at ->probe() time, which may happen after fixed_mdio_bus_init() is
> called.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Reviewed-by: Florian Fainelli <florian@openwrt.org>

> ---
>  drivers/net/phy/fixed.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/phy/fixed.c b/drivers/net/phy/fixed.c
> index ba55adf..bd1e67a 100644
> --- a/drivers/net/phy/fixed.c
> +++ b/drivers/net/phy/fixed.c
> @@ -195,6 +195,8 @@ int fixed_phy_add(unsigned int irq, int phy_id,
>
>         list_add_tail(&fp->node, &fmb->phys);
>
> +       mdiobus_scan(fmb->mii_bus, phy_id);
> +
>         return 0;
>
>  err_regs:
> --
> 1.8.1.2
>



--
Florian

  reply	other threads:[~2013-07-15 15:46 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-15 15:34 [RFC PATCH 0/3] Add DT support for fixed PHYs Thomas Petazzoni
2013-07-15 15:34 ` [RFC PATCH 1/3] of: provide a binding for the 'fixed-link' property Thomas Petazzoni
2013-07-15 15:50   ` Florian Fainelli
2013-07-23 11:22   ` Mark Rutland
2013-07-23 11:39     ` Florian Fainelli
2013-07-30  9:16     ` Thomas Petazzoni
2013-07-30 10:26       ` Florian Fainelli
2013-07-30 15:28       ` Mark Rutland
2013-07-23 11:39   ` Grant Likely
2013-07-30  9:07     ` Thomas Petazzoni
2013-07-30 10:05       ` Florian Fainelli
2013-07-30 11:23         ` Thomas Petazzoni
2013-07-30 11:43           ` Florian Fainelli
2013-07-30 15:31       ` Mark Rutland
2013-08-12  6:38   ` Sascha Hauer
2013-08-12  8:16     ` Thomas Petazzoni
2013-08-12  8:37       ` Sascha Hauer
2013-08-21 10:55         ` Christian Gmeiner
2013-08-21 11:25           ` Florian Fainelli
2013-08-21 11:46         ` Florian Fainelli
2013-07-15 15:34 ` [RFC PATCH 2/3] net: phy: call mdiobus_scan() after adding a fixed PHY Thomas Petazzoni
2013-07-15 15:46   ` Florian Fainelli [this message]
2013-07-15 15:34 ` [RFC PATCH 3/3] net: mvneta: add support for fixed links Thomas Petazzoni

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=CAGVrzcbn0FASWBbj-zF+pYnUATm02tUurN_wM0YWrWrTBh+dJQ@mail.gmail.com \
    --to=florian@openwrt.org \
    --cc=alior@marvell.com \
    --cc=davem@davemloft.net \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=ezequiel.garcia@free-electrons.com \
    --cc=grant.likely@secretlab.ca \
    --cc=gregory.clement@free-electrons.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=netdev@vger.kernel.org \
    --cc=rob.herring@calxeda.com \
    --cc=thomas.petazzoni@free-electrons.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).