From: Florian Fainelli <f.fainelli@gmail.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, pgynther@google.com, jaedon.shin@gmail.com
Subject: Re: [PATCH net-next 2/2] net: phy: mdio-bcm-unimac: handle broken turn-around for specific PHYs
Date: Wed, 10 Jun 2015 12:17:49 -0700 [thread overview]
Message-ID: <55788D5D.4080304@gmail.com> (raw)
In-Reply-To: <1433963643-15851-3-git-send-email-f.fainelli@gmail.com>
On 10/06/15 12:14, Florian Fainelli wrote:
> Some Ethernet PHYs/switches such as Broadcom's BCM53125 have a hardware bug
> which makes them not release the MDIO line during turn-around time. This gets
> flagged by the UniMAC MDIO controller as a read failure, and we fail the read
> transaction.
>
> Check the MDIO bus phy_ignore_ta_mask bitmask for the PHY we are reading
> from and if it is listed in this bitmask, ignore the read failure and
> proceed with returning the data we read out of the controller.
Scratch that version, it contains an unnecessary include and does not
have the same comment as the GENET version, let me resubmit that.
>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
> drivers/net/phy/mdio-bcm-unimac.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/phy/mdio-bcm-unimac.c b/drivers/net/phy/mdio-bcm-unimac.c
> index 414fdf1f343f..2237d5554e02 100644
> --- a/drivers/net/phy/mdio-bcm-unimac.c
> +++ b/drivers/net/phy/mdio-bcm-unimac.c
> @@ -16,6 +16,7 @@
> #include <linux/module.h>
> #include <linux/io.h>
> #include <linux/delay.h>
> +#include <linux/brcmphy.h>
>
> #include <linux/of.h>
> #include <linux/of_platform.h>
> @@ -81,7 +82,7 @@ static int unimac_mdio_read(struct mii_bus *bus, int phy_id, int reg)
> return -ETIMEDOUT;
>
> cmd = __raw_readl(priv->base + MDIO_CMD);
> - if (cmd & MDIO_READ_FAIL)
> + if (!(bus->phy_ignore_ta_mask & 1 << phy_id) && (cmd & MDIO_READ_FAIL))
> return -EIO;
>
> return cmd & 0xffff;
>
--
Florian
prev parent reply other threads:[~2015-06-10 19:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-10 19:14 [PATCH net-next 0/2] net: broadcom MDIO support for broken turn-around Florian Fainelli
2015-06-10 19:14 ` [PATCH net-next 1/2] net: bcmgenet: handle broken turn-around for specific PHYs Florian Fainelli
2015-06-10 19:14 ` [PATCH net-next 2/2] net: phy: mdio-bcm-unimac: " Florian Fainelli
2015-06-10 19:17 ` Florian Fainelli [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=55788D5D.4080304@gmail.com \
--to=f.fainelli@gmail.com \
--cc=davem@davemloft.net \
--cc=jaedon.shin@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pgynther@google.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).