netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Nathan Rossi <nathan@nathanrossi.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
	netdev@vger.kernel.org, Nathan Rossi <nathan.rossi@digi.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>
Subject: Re: [PATCH] of: of_mdio: Handle properties for non-phy mdio devices
Date: Wed, 17 Feb 2021 14:25:48 +0100	[thread overview]
Message-ID: <YC0ZXFx98JrtEGA3@lunn.ch> (raw)
In-Reply-To: <CA+aJhH1VeCkk4JB02XVbvgJaM-Ua5i80qaNR7EVUoF-eBx_y5Q@mail.gmail.com>

On Wed, Feb 17, 2021 at 02:48:30PM +1000, Nathan Rossi wrote:
> On Wed, 17 Feb 2021 at 13:19, Andrew Lunn <andrew@lunn.ch> wrote:
> >
> > > > The patch does make sense though, Broadcom 53125 switches have a broken
> > > > turn around and are mdio_device instances, the broken behavior may not
> > > > show up with all MDIO controllers used to interface though. For the
> > >
> > > Yes the reason we needed this change was to enable broken turn around,
> > > specifically with a Marvell 88E6390.
> >
> > Ah, odd. I've never had problems with the 6390, either connected to a
> > Freecale FEC, or the Linux bit banging MDIO bus.
> >
> > What are you using for an MDIO bus controller? Did it already support
> > broken turn around, or did you need to add it?
> 
> Using bit bang MDIO to access the 88e6390. I suspect the issue is
> specific to the board design, another similar design we have uses bit
> bang MDIO but a 88e6193x switch and does not have any issue with turn
> around.

So to me, it sounds like changing the data pin, by the host, from
being driven to high impedance, is taking too long. So this is a bus
problem, not a per device on the bus problem. You need to indicate to
the bus controller that all addresses on the bus have broken turn
around, not just one. If you look at mdio-bitbang.c  it has:

        /* check the turnaround bit: the PHY should be driving it to zero, if this
         * PHY is listed in phy_ignore_ta_mask as having broken TA, skip that
         */
        if (mdiobb_get_bit(ctrl) != 0 &&
            !(bus->phy_ignore_ta_mask & (1 << phy))) {
                /* PHY didn't drive TA low -- flush any bits it
                 * may be trying to send.
                 */
                for (i = 0; i < 32; i++)
                        mdiobb_get_bit(ctrl);

                return 0xffff;
        }

So the property it specific to one address. And the mv88e6xxx normally
takes up multiple addresses on the bus.

So i would do this differently. Add a new property to "mdio-gpio" to
indicate the host has broken turn around, and it needs to set all 32
bits of bus->phy_ignore_ta_mask.

     Andrew

  reply	other threads:[~2021-02-17 13:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-15  7:02 [PATCH] of: of_mdio: Handle properties for non-phy mdio devices Nathan Rossi
2021-02-16 13:06 ` Andrew Lunn
2021-02-16 17:50   ` Florian Fainelli
2021-02-16 22:57     ` Nathan Rossi
2021-02-16 23:14       ` Florian Fainelli
2021-02-17  3:19       ` Andrew Lunn
2021-02-17  4:48         ` Nathan Rossi
2021-02-17 13:25           ` Andrew Lunn [this message]
2021-02-17  4:44 ` [PATCH v2] of: of_mdio: Handle broken-turn-around " Nathan Rossi

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=YC0ZXFx98JrtEGA3@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=nathan.rossi@digi.com \
    --cc=nathan@nathanrossi.com \
    --cc=netdev@vger.kernel.org \
    /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).