linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Antoine Tenart <antoine.tenart@bootlin.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Antoine Tenart <antoine.tenart@bootlin.com>,
	davem@davemloft.net, linux@armlinux.org.uk, f.fainelli@gmail.com,
	hkallweit1@gmail.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com,
	maxime.chevallier@bootlin.com, gregory.clement@bootlin.com,
	miquel.raynal@bootlin.com, nadavh@marvell.com,
	stefanc@marvell.com, mw@semihalf.com
Subject: Re: [PATCH net-next v2 3/3] net: phy: marvell10g: set the PHY in low power by default
Date: Fri, 1 Mar 2019 16:07:06 +0100	[thread overview]
Message-ID: <20190301150706.GD3554@kwain> (raw)
In-Reply-To: <20190301141953.GF19813@lunn.ch>

Hi Andrew,

On Fri, Mar 01, 2019 at 03:19:53PM +0100, Andrew Lunn wrote:
> On Fri, Mar 01, 2019 at 12:00:47PM +0100, Antoine Tenart wrote:
> > When the Marvell 10G PHYs are set out of reset, the LPOWER bit is set
> > depending on an hardware configuration choice. We also do not know what
> > is the PHY state at boot time. Hence, set the PHY in low power by
> > default when this driver probes.
> 
> Florian did some work for c22 PHYs so that the existing link state
> could be used at boot. So for example, the bootloader configured the
> PHY up and it got link, there is no need to down/up the PHY when linux
> takes control. The networking comes up faster that way.
> 
> Can this work for this PHY?

This use case (the bootloader configures the PHY, Linux boots and sets
an interface using this PHY up) would work, and is what's happening in
some situations right now (the 3310 reset is never asserted prior to
this series).

But consider this case (let's say we use a 10G link):

  ----------------               ----------------
  |    Board 1   |               |    Board 2   |
  | MAC — 3310 — | — SFP cable — | — 3310 — MAC |
  ----------------               ----------------

Board 1: The userspace do not set the interface up. The MAC is in reset
         (default state during the MAC driver probe), the PHY was
	 configured by the bootloader.
Board 2: The userspace set the interface up. The MAC is configured, the
         PHY is configured as well.

The two PHY's PCS will establish a link and report it as being up. In
this case, phylink's AN mode is MLO_AN_PHY and thus will report the
overall link as being the PHY's link status: up.

My understanding is that the issue arises because the PHYs were never
set in reset, or low power, and thus act as if the user wanted the port
to be up. As the default behaviour for networking ports is to be down at
boot, I thought to set the PHY as well in a default low power state.

Thanks!
Antoine

-- 
Antoine Ténart, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2019-03-01 15:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-01 11:00 [PATCH net-next v2 0/3] net: phy: marvell10g: implement suspend/resume callbacks Antoine Tenart
2019-03-01 11:00 ` [PATCH net-next v2 1/3] " Antoine Tenart
2019-03-01 14:16   ` Andrew Lunn
2019-03-01 11:00 ` [PATCH net-next v2 2/3] net: phy: marvell10g: add the suspend/resume callbacks for the 88x2210 Antoine Tenart
2019-03-01 14:15   ` Andrew Lunn
2019-03-01 11:00 ` [PATCH net-next v2 3/3] net: phy: marvell10g: set the PHY in low power by default Antoine Tenart
2019-03-01 14:19   ` Andrew Lunn
2019-03-01 15:07     ` Antoine Tenart [this message]
2019-03-02  3:08       ` Florian Fainelli
2019-03-04 10:47         ` Antoine Tenart
2019-03-04 16:10           ` Russell King - ARM Linux admin
2019-03-05 12:54             ` Antoine Tenart
2019-03-04 18:46 ` [PATCH net-next v2 0/3] net: phy: marvell10g: implement suspend/resume callbacks David Miller

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=20190301150706.GD3554@kwain \
    --to=antoine.tenart@bootlin.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=gregory.clement@bootlin.com \
    --cc=hkallweit1@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=maxime.chevallier@bootlin.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=mw@semihalf.com \
    --cc=nadavh@marvell.com \
    --cc=netdev@vger.kernel.org \
    --cc=stefanc@marvell.com \
    --cc=thomas.petazzoni@bootlin.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).