linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Prasanna Vengateshan <prasanna.vengateshan@microchip.com>
Cc: andrew@lunn.ch, netdev@vger.kernel.org, olteanv@gmail.com,
	robh+dt@kernel.org, UNGLinuxDriver@microchip.com,
	Woojung.Huh@microchip.com, hkallweit1@gmail.com,
	davem@davemloft.net, kuba@kernel.org,
	linux-kernel@vger.kernel.org, vivien.didelot@gmail.com,
	f.fainelli@gmail.com, devicetree@vger.kernel.org
Subject: Re: [PATCH v5 net-next 06/10] net: dsa: microchip: add support for phylink management
Date: Fri, 29 Oct 2021 08:57:02 +0100	[thread overview]
Message-ID: <YXupTqhiarSjbwaT@shell.armlinux.org.uk> (raw)
In-Reply-To: <b3c069c8bc9b2f68d4705c04fb010cb4aaa0b29b.camel@microchip.com>

On Fri, Oct 29, 2021 at 08:29:49AM +0530, Prasanna Vengateshan wrote:
> On Thu, 2021-10-28 at 18:05 +0100, Russell King (Oracle) wrote:
> > Hi,
> > 
> > I've just sent "net: dsa: populate supported_interfaces member"
> > which adds a hook to allow DSA to populate the newly introduced
> > supported_interfaces member of phylink_config. Once this patch is
> > merged, it would be great to see any new drivers setting this
> > member.
> > 
> > Essentially, the phylink_get_interfaces method is called with the
> > DSA switch and port number, and a pointer to the supported_interfaces
> > member - which is a bitmap of PHY_INTERFACE_MODEs that are supported
> > by this port.
> > 
> > When you have set any bit in the supported interfaces, phylink's
> > behaviour when calling your lan937x_phylink_validate changes - it will
> > no longer call it with PHY_INTERFACE_MODE_NA, but will instead do a
> > bitwalk over the bitmap, and call it for each supported interface type
> > instead.
> > 
> > When phylink has a specific interface mode, it will continue to make a
> > single call - but only if the interface mode is indicated as supported
> > in the supported interfaces bitmap.
> > 
> > Please keep an eye on "net: dsa: populate supported_interfaces member"
> > and if you need to respin this series after that patch has been merged,
> > please update in regards of this.
> 
> Sure, i will watch out for this series and add to my new driver. Do the 
> new drivers need to still return all supported modes if state->interface
> is set to %PHY_INTERFACE_MODE_NA as per phylink documentation? I 
> understand that supported_interfaces will not be empty if
> phylink_get_interfaces() is handled. But i just wanted to double check
> with you.

The phylink documentation has already been updated:

 * When @config->supported_interfaces has been set, phylink will iterate
 * over the supported interfaces to determine the full capability of the
 * MAC. The validation function must not print errors if @state->interface
 * is set to an unexpected value.
 *
 * When @config->supported_interfaces is empty, phylink will call this
 * function with @state->interface set to %PHY_INTERFACE_MODE_NA, and
 * expects the MAC driver to return all supported link modes.

As I state in my initial reply, ->validate will never be called with
PHY_INTERFACE_MODE_NA if supported_interfaces is populated.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

  reply	other threads:[~2021-10-29  7:57 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-28 16:41 [PATCH v5 net-next 00/10] net: dsa: microchip: DSA driver support for LAN937x switch Prasanna Vengateshan
2021-10-28 16:41 ` [PATCH v5 net-next 01/10] dt-bindings: net: dsa: dt bindings for microchip lan937x Prasanna Vengateshan
2021-10-28 16:41 ` [PATCH v5 net-next 02/10] net: dsa: move mib->cnt_ptr reset code to ksz_common.c Prasanna Vengateshan
2021-10-28 16:41 ` [PATCH v5 net-next 03/10] net: phy: Add support for LAN937x T1 phy driver Prasanna Vengateshan
2021-10-28 16:41 ` [PATCH v5 net-next 04/10] net: dsa: tag_ksz: add tag handling for Microchip LAN937x Prasanna Vengateshan
2021-10-28 16:41 ` [PATCH v5 net-next 05/10] net: dsa: microchip: add DSA support for microchip lan937x Prasanna Vengateshan
2021-10-28 16:41 ` [PATCH v5 net-next 06/10] net: dsa: microchip: add support for phylink management Prasanna Vengateshan
2021-10-28 17:05   ` Russell King (Oracle)
2021-10-29  2:59     ` Prasanna Vengateshan
2021-10-29  7:57       ` Russell King (Oracle) [this message]
2021-10-28 16:41 ` [PATCH v5 net-next 07/10] net: dsa: microchip: add support for ethtool port counters Prasanna Vengateshan
2021-10-28 16:41 ` [PATCH v5 net-next 08/10] net: dsa: microchip: add support for port mirror operations Prasanna Vengateshan
2021-10-28 16:41 ` [PATCH v5 net-next 09/10] net: dsa: microchip: add support for fdb and mdb management Prasanna Vengateshan
2021-10-28 16:41 ` [PATCH v5 net-next 10/10] net: dsa: microchip: add support for vlan operations Prasanna Vengateshan
2021-10-28 19:05 ` [PATCH v5 net-next 00/10] net: dsa: microchip: DSA driver support for LAN937x switch Jakub Kicinski

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=YXupTqhiarSjbwaT@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=Woojung.Huh@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=prasanna.vengateshan@microchip.com \
    --cc=robh+dt@kernel.org \
    --cc=vivien.didelot@gmail.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).