lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 29 Oct 2021 08:57:02 +0100
From:   "Russell King (Oracle)" <linux@...linux.org.uk>
To:     Prasanna Vengateshan <prasanna.vengateshan@...rochip.com>
Cc:     andrew@...n.ch, netdev@...r.kernel.org, olteanv@...il.com,
        robh+dt@...nel.org, UNGLinuxDriver@...rochip.com,
        Woojung.Huh@...rochip.com, hkallweit1@...il.com,
        davem@...emloft.net, kuba@...nel.org, linux-kernel@...r.kernel.org,
        vivien.didelot@...il.com, f.fainelli@...il.com,
        devicetree@...r.kernel.org
Subject: Re: [PATCH v5 net-next 06/10] net: dsa: microchip: add support for
 phylink management

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!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ