All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org
Subject: Re: [PATCH net-next v2 3/3] net: phylink: add separate pcs operations structure
Date: Mon, 30 Mar 2020 11:08:44 +0100	[thread overview]
Message-ID: <20200330100844.GE25745@shell.armlinux.org.uk> (raw)
In-Reply-To: <ab4164b1-2415-ec81-c235-0d3469dba4af@gmail.com>

On Sun, Mar 29, 2020 at 01:42:08PM -0700, Florian Fainelli wrote:
> 
> 
> On 3/29/2020 9:01 AM, Russell King wrote:
> > Add a separate set of PCS operations, which MAC drivers can use to
> > couple phylink with their associated MAC PCS layer.  The PCS
> > operations include:
> > 
> > - pcs_get_state() - reads the link up/down, resolved speed, duplex
> >    and pause from the PCS.
> > - pcs_config() - configures the PCS for the specified mode, PHY
> >    interface type, and setting the advertisement.
> > - pcs_an_restart() - restarts 802.3 in-band negotiation with the
> >    link partner
> > - pcs_link_up() - informs the PCS that link has come up, and the
> >    parameters of the link. Link parameters are used to program the
> >    PCS for fixed speed and non-inband modes.
> > 
> > Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
> > ---
> 
> Although your kernel documentation is pretty comprehensive, I am fairly
> sure people are going to get confused about whether they need to
> implement pcs_an_restart vs. mac_an_restart and pcs_get_state vs.
> mac_pcs_get_state (with the possibility of a naming confusion for the
> latter). Maybe some guidelines in the comment as to which one to
> implement could save some support.

If one is making use of the PCS operations, then the PCS operations
are used in preference to the MAC operations in all cases except the
pcs_config() and pcs_link_up() methods.

This is already documented with:

 * When present, this overrides mac_pcs_get_state() in &struct
 * phylink_mac_ops.

 * When PCS ops are present, this overrides mac_an_restart() in &struct
 * phylink_mac_ops.

I'm not sure adding more words will help - in my experience, the more
words that are used, the more people nitpick and mess up.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 10.2Mbps down 587kbps up

      reply	other threads:[~2020-03-30 10:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-29 16:00 [PATCH net-next v2 0/3] split phylink PCS operations and add PCS support for dpaa2 Russell King - ARM Linux admin
2020-03-29 16:01 ` [PATCH net-next v2 1/3] net: phylink: change phylink_mii_c22_pcs_set_advertisement() prototype Russell King
2020-03-29 17:19   ` Andrew Lunn
2020-03-29 20:29   ` Florian Fainelli
2020-03-29 16:01 ` [PATCH net-next v2 2/3] net: phylink: rename 'ops' to 'mac_ops' Russell King
2020-03-29 20:33   ` Florian Fainelli
2020-03-29 16:01 ` [PATCH net-next v2 3/3] net: phylink: add separate pcs operations structure Russell King
2020-03-29 17:23   ` Andrew Lunn
2020-03-29 20:42   ` Florian Fainelli
2020-03-30 10:08     ` Russell King - ARM Linux admin [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=20200330100844.GE25745@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.