<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/net/phy/phylink.c, branch linux-5.16.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.16.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.16.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-12-08T05:26:22Z</updated>
<entry>
<title>net: phy: Add the missing blank line in the phylink_suspend comment</title>
<updated>2021-12-08T05:26:22Z</updated>
<author>
<name>Yanteng Si</name>
</author>
<published>2021-12-06T08:12:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c35e8de704560846dab964a2df2e548818a424d3'/>
<id>urn:sha1:c35e8de704560846dab964a2df2e548818a424d3</id>
<content type='text'>
Fix warning as:

Documentation/networking/kapi:147: ./drivers/net/phy/phylink.c:1657: WARNING: Unexpected indentation.
Documentation/networking/kapi:147: ./drivers/net/phy/phylink.c:1658: WARNING: Block quote ends without a blank line; unexpected unindent.

Signed-off-by: Yanteng Si &lt;siyanteng@loongson.cn&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: phylink: Force retrigger in case of latched link-fail indicator</title>
<updated>2021-11-25T02:40:07Z</updated>
<author>
<name>Russell King (Oracle)</name>
</author>
<published>2021-11-23T15:44:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dbae3388ea9ca33bd1d5eabc3b0ef17e69c74677'/>
<id>urn:sha1:dbae3388ea9ca33bd1d5eabc3b0ef17e69c74677</id>
<content type='text'>
On mv88e6xxx 1G/2.5G PCS, the SerDes register 4.2001.2 has the following
description:
  This register bit indicates when link was lost since the last
  read. For the current link status, read this register
  back-to-back.

Thus to get current link state, we need to read the register twice.

But doing that in the link change interrupt handler would lead to
potentially ignoring link down events, which we really want to avoid.

Thus this needs to be solved in phylink's resolve, by retriggering
another resolve in the event when PCS reports link down and previous
link was up, and by re-reading PCS state if the previous link was down.

The wrong value is read when phylink requests change from sgmii to
2500base-x mode, and link won't come up. This fixes the bug.

Fixes: 9525ae83959b ("phylink: add phylink infrastructure")
Signed-off-by: Russell King (Oracle) &lt;rmk+kernel@armlinux.org.uk&gt;
Signed-off-by: Marek Behún &lt;kabel@kernel.org&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: phylink: Force link down and retrigger resolve on interface change</title>
<updated>2021-11-25T02:40:06Z</updated>
<author>
<name>Russell King (Oracle)</name>
</author>
<published>2021-11-23T15:44:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=80662f4fd4771bc9c7cc4abdfbe866ebd1179621'/>
<id>urn:sha1:80662f4fd4771bc9c7cc4abdfbe866ebd1179621</id>
<content type='text'>
On PHY state change the phylink_resolve() function can read stale
information from the MAC and report incorrect link speed and duplex to
the kernel message log.

Example with a Marvell 88X3310 PHY connected to a SerDes port on Marvell
88E6393X switch:
- PHY driver triggers state change due to PHY interface mode being
  changed from 10gbase-r to 2500base-x due to copper change in speed
  from 10Gbps to 2.5Gbps, but the PHY itself either hasn't yet changed
  its interface to the host, or the interrupt about loss of SerDes link
  hadn't arrived yet (there can be a delay of several milliseconds for
  this), so we still think that the 10gbase-r mode is up
- phylink_resolve()
  - phylink_mac_pcs_get_state()
    - this fills in speed=10g link=up
  - interface mode is updated to 2500base-x but speed is left at 10Gbps
  - phylink_major_config()
    - interface is changed to 2500base-x
  - phylink_link_up()
    - mv88e6xxx_mac_link_up()
      - .port_set_speed_duplex()
        - speed is set to 10Gbps
    - reports "Link is Up - 10Gbps/Full" to dmesg

Afterwards when the interrupt finally arrives for mv88e6xxx, another
resolve is forced in which we get the correct speed from
phylink_mac_pcs_get_state(), but since the interface is not being
changed anymore, we don't call phylink_major_config() but only
phylink_mac_config(), which does not set speed/duplex anymore.

To fix this, we need to force the link down and trigger another resolve
on PHY interface change event.

Fixes: 9525ae83959b ("phylink: add phylink infrastructure")
Signed-off-by: Russell King (Oracle) &lt;rmk+kernel@armlinux.org.uk&gt;
Signed-off-by: Marek Behún &lt;kabel@kernel.org&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net</title>
<updated>2021-11-02T03:05:14Z</updated>
<author>
<name>Jakub Kicinski</name>
</author>
<published>2021-11-02T03:05:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8a33dcc2f6d5cf60cc77b72c277d1eba8e4ac8fb'/>
<id>urn:sha1:8a33dcc2f6d5cf60cc77b72c277d1eba8e4ac8fb</id>
<content type='text'>
Merge in the fixes we had queued in case there was another -rc.

Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: phylink: avoid mvneta warning when setting pause parameters</title>
<updated>2021-10-29T12:29:30Z</updated>
<author>
<name>Russell King (Oracle)</name>
</author>
<published>2021-10-28T14:55:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fd8d9731bcdfb22d28e45bce789bcb211c868c78'/>
<id>urn:sha1:fd8d9731bcdfb22d28e45bce789bcb211c868c78</id>
<content type='text'>
mvneta does not support asymetric pause modes, and it flags this by the
lack of AsymPause in the supported field. When setting pause modes, we
check that pause-&gt;rx_pause == pause-&gt;tx_pause, but only when pause
autoneg is enabled. When pause autoneg is disabled, we still allow
pause-&gt;rx_pause != pause-&gt;tx_pause, which is incorrect when the MAC
does not support asymetric pause, and causes mvneta to issue a warning.

Fix this by removing the test for pause-&gt;autoneg, so we always check
that pause-&gt;rx_pause == pause-&gt;tx_pause for network devices that do not
support AsymPause.

Fixes: 9525ae83959b ("phylink: add phylink infrastructure")
Signed-off-by: Russell King (Oracle) &lt;rmk+kernel@armlinux.org.uk&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: phylink: use supported_interfaces for phylink validation</title>
<updated>2021-10-26T14:10:36Z</updated>
<author>
<name>Russell King (Oracle)</name>
</author>
<published>2021-10-26T10:06:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d25f3a74f30aace819163dfa54f2a4b8ca1dc932'/>
<id>urn:sha1:d25f3a74f30aace819163dfa54f2a4b8ca1dc932</id>
<content type='text'>
If the network device supplies a supported interface bitmap, we can use
that during phylink's validation to simplify MAC drivers in two ways by
using the supported_interfaces bitmap to:

1. reject unsupported interfaces before calling into the MAC driver.
2. generate the set of all supported link modes across all supported
   interfaces (used mainly for SFP, but also some 10G PHYs.)

Suggested-by: Sean Anderson &lt;sean.anderson@seco.com&gt;
Signed-off-by: Russell King (Oracle) &lt;rmk+kernel@armlinux.org.uk&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: phylink: Convert some users of mdiobus_* to mdiodev_*</title>
<updated>2021-10-24T12:40:33Z</updated>
<author>
<name>Sean Anderson</name>
</author>
<published>2021-10-22T15:59:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c8fb89a7a7d117fc1e2cbce6f0d3fd58008878fe'/>
<id>urn:sha1:c8fb89a7a7d117fc1e2cbce6f0d3fd58008878fe</id>
<content type='text'>
This refactors the phylink pcs helper functions to use mdiobus_* instead
of mdiodev_*.

Signed-off-by: Sean Anderson &lt;sean.anderson@seco.com&gt;
Reviewed-by: Russell King (Oracle) &lt;rmk+kernel@armlinux.org.uk&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: phylink: Support disabling autonegotiation for PCS</title>
<updated>2021-10-19T12:07:36Z</updated>
<author>
<name>Robert Hancock</name>
</author>
<published>2021-10-19T10:24:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=92817dad7dcb781561dcebbf1b19a177774d84c2'/>
<id>urn:sha1:92817dad7dcb781561dcebbf1b19a177774d84c2</id>
<content type='text'>
The auto-negotiation state in the PCS as set by
phylink_mii_c22_pcs_config was previously always enabled when the
driver is configured for in-band autonegotiation, even if
autonegotiation was disabled on the interface with ethtool. Update the
code to set the BMCR_ANENABLE bit based on the interface's
autonegotiation enabled state.

Update phylink_mii_c22_pcs_get_state to not check
autonegotiation-related fields when autonegotiation is disabled.

Update phylink_mac_pcs_get_state to initialize the state based on the
interface's configured speed, duplex and pause parameters rather than
to unknown when autonegotiation is disabled, before calling the
driver's pcs_get_state functions, as they are not likely to provide
meaningful data for these fields when autonegotiation is disabled. In
this case the driver is really just filling in the link state field.

Note that in cases where there is a downstream PHY connected, such as
with SGMII and a copper PHY, the configuration set by ethtool is
handled by phy_ethtool_ksettings_set and not propagated to the PCS.
This is correct since SGMII or 1000Base-X autonegotiation with the PCS
should normally still be used even if the copper side has disabled it.

Signed-off-by: Robert Hancock &lt;robert.hancock@calian.com&gt;
Signed-off-by: Russell King (Oracle) &lt;rmk+kernel@armlinux.org.uk&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: phylink: rejig SFP interface selection in ksettings_set()</title>
<updated>2021-10-19T12:07:35Z</updated>
<author>
<name>Russell King (Oracle)</name>
</author>
<published>2021-10-19T10:00:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dc90604b5836998bb2911faf80dc204f35db08a0'/>
<id>urn:sha1:dc90604b5836998bb2911faf80dc204f35db08a0</id>
<content type='text'>
Commit ea269a6f7207 ("net: phylink: Update SFP selected interface on
advertising changes") added a better solution to selecting the
interface mode for SFPs using the advertisement mask. This method will
work for mvneta and mvpp2 when selecting between 2500base-X and
1000base-X without needing to use the basex helper, or indicate that
we support both 1000base-X and 2500base-X when in either of these two
interface modes.

Hence, we need to eliminate the validation prior to selecting the
interface, otherwise when we clean up mvneta's validation function, we
will end up locking to 2500base-X as we validate with an interface mode
of PHY_INERFACE_MODE_2500BASEX.

The supported mask will already have been reduced down to the union of
support for the SFP and MAC already, so we can be confident that the
advertisement mask is already appropriately restricted. We only need to
select the appropriate interface, and then revalidate with the new
interface mode.

We get rid of the check for pl-&gt;sfp_port too, this is meaningless here
as it doesn't get cleared when a module is removed, so it doesn't
indicate if a module is present. Just rely on pl-&gt;sfp_bus.

Signed-off-by: Russell King &lt;rmk+kernel@armlinux.org.uk&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: phylink: use mdiobus_modify_changed() helper</title>
<updated>2021-10-07T00:49:21Z</updated>
<author>
<name>Russell King (Oracle)</name>
</author>
<published>2021-10-06T12:19:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=078e0b5363db4c00bac4dde8c14998b4e29261aa'/>
<id>urn:sha1:078e0b5363db4c00bac4dde8c14998b4e29261aa</id>
<content type='text'>
Use the mdiobus_modify_changed() helper in the C22 PCS advertisement
helper.

Signed-off-by: Russell King (Oracle) &lt;rmk+kernel@armlinux.org.uk&gt;
Reviewed-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
</feed>
