From: David Miller <davem@davemloft.net>
To: marex@denx.de
Cc: netdev@vger.kernel.org, arnd@arndb.de,
dinguyen@opensource.altera.com, f.fainelli@gmail.com,
sergei.shtylyov@cogentembedded.com
Subject: Re: [PATCH V2] mdio_bus: Fix MDIO bus scanning in __mdiobus_register()
Date: Sun, 01 May 2016 20:50:31 -0400 (EDT) [thread overview]
Message-ID: <20160501.205031.116469285201732756.davem@davemloft.net> (raw)
In-Reply-To: <1462150051-6308-1-git-send-email-marex@denx.de>
From: Marek Vasut <marex@denx.de>
Date: Mon, 2 May 2016 02:47:31 +0200
> Since commit b74766a0a0fe ("phylib: don't return NULL
> from get_phy_device()") in linux-next, phy_get_device() will return
> ERR_PTR(-ENODEV) instead of NULL if the PHY device ID is all ones.
>
> This causes problem with stmmac driver and likely some other drivers
> which call mdiobus_register(). I triggered this bug on SoCFPGA MCVEVK
> board with linux-next 20160427 and 20160428. In case of the stmmac, if
> there is no PHY node specified in the DT for the stmmac block, the stmmac
> driver ( drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c function
> stmmac_mdio_register() ) will call mdiobus_register() , which will
> register the MDIO bus and probe for the PHY.
>
> The mdiobus_register() resp. __mdiobus_register() iterates over all of
> the addresses on the MDIO bus and calls mdiobus_scan() for each of them,
> which invokes get_phy_device(). Before the aforementioned patch, the
> mdiobus_scan() would return NULL if no PHY was found on a given address
> and mdiobus_register() would continue and try the next PHY address. Now,
> mdiobus_scan() returns ERR_PTR(-ENODEV), which is caught by the
> 'if (IS_ERR(phydev))' condition and the loop exits immediately if the
> PHY address does not contain PHY.
>
> Repair this by explicitly checking for the ERR_PTR(-ENODEV) and if this
> error comes around, continue with the next PHY address.
>
> Signed-off-by: Marek Vasut <marex@denx.de>
> Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Applied, thanks.
prev parent reply other threads:[~2016-05-02 0:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-02 0:47 [PATCH V2] mdio_bus: Fix MDIO bus scanning in __mdiobus_register() Marek Vasut
2016-05-02 0:50 ` David Miller [this message]
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=20160501.205031.116469285201732756.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=arnd@arndb.de \
--cc=dinguyen@opensource.altera.com \
--cc=f.fainelli@gmail.com \
--cc=marex@denx.de \
--cc=netdev@vger.kernel.org \
--cc=sergei.shtylyov@cogentembedded.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