netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Bryan.Whitehead@microchip.com
Cc: davem@davemloft.net, UNGLinuxDriver@microchip.com,
	netdev@vger.kernel.org
Subject: Re: [PATCH v3 net-next 1/2] lan743x: Add main source files for new lan743x driver
Date: Fri, 2 Mar 2018 14:40:42 +0100	[thread overview]
Message-ID: <20180302134042.GA19566@lunn.ch> (raw)
In-Reply-To: <90A7E81AE28BAE4CBDDB3B35F187D2644071EFDF@CHN-SV-EXMX02.mchp-main.com>

On Fri, Mar 02, 2018 at 05:57:54AM +0000, Bryan.Whitehead@microchip.com wrote:
> > > +static int lan743x_phy_reset(struct lan743x_adapter *adapter) {
> > > +	u32 data;
> > > +
> > > +	data = lan743x_csr_read(adapter, PMT_CTL);
> > > +	data |= PMT_CTL_ETH_PHY_RST_;
> > > +	lan743x_csr_write(adapter, PMT_CTL, data);
> > > +
> > > +	return readx_poll_timeout(LAN743X_CSR_READ_OP, PMT_CTL,
> > data,
> > > +				  (!(data & PMT_CTL_ETH_PHY_RST_) &&
> > > +				  (data & PMT_CTL_READY_)),
> > > +				  50000, 1000000);
> > > +}
> > 
> > Hi Bryan
> > 
> > Could you explain this a bit more. What exactly is it resetting? Do we need to
> > tell the phylib that the PHY has been reset and that it needs to re-program it?
> > Or by phy do you mean a SERDES interface?
> 
> Hi Andrew,
> 
> This function resets the Ethernet phy. But it is called only in
> probe and before mdiobus_register. So I don't believe it is
> necessary to tell phylib.

Hi Bryan

So the PHY is built in? It should be safe. Normally we have the PHY
driver, or the generic layers handle any such reset via a GPIO. But
built in is different.

> [snip]
> > > +
> > > +	/* PHY interrupt enabled here */
> > > +	phy_start(phydev);
> > > +	phy_start_aneg(phydev);
> > > +	return 0;
> > 
> > Are phy interrupts really enabled here? I could of missed it, but i don't see
> > anywhere PHY interrupts are configured. This is either done via device tree,
> > you set phydev->irq, or mdiobus->irq[X].
> 

> Sorry that is an obsolete comment, I will remove it. It is not using
> phy interrupts. It's using polling.

Assuming it is built in, does the MAC get the interrupt?
phy_mac_interrupt() can be called if so.

    Andrew

  reply	other threads:[~2018-03-02 13:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-01 21:00 [PATCH v3 net-next 0/2] lan743x: Add new lan743x driver Bryan Whitehead
2018-03-01 21:00 ` [PATCH v3 net-next 1/2] lan743x: Add main source files for " Bryan Whitehead
2018-03-01 22:12   ` Andrew Lunn
2018-03-02  5:57     ` Bryan.Whitehead
2018-03-02 13:40       ` Andrew Lunn [this message]
2018-03-02 18:26         ` Bryan.Whitehead
2018-03-02 20:14           ` Andrew Lunn
2018-03-01 21:00 ` [PATCH v3 net-next 2/2] lan743x: Update MAINTAINERS to include " Bryan Whitehead

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=20180302134042.GA19566@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=Bryan.Whitehead@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=davem@davemloft.net \
    --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).