<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/net/pcs, branch for-next</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=for-next</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=for-next'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2025-01-15T21:22:23Z</updated>
<entry>
<title>net: pcs: xpcs: actively unset DW_VR_MII_DIG_CTRL1_2G5_EN for 1G SGMII</title>
<updated>2025-01-15T21:22:23Z</updated>
<author>
<name>Vladimir Oltean</name>
<email>vladimir.oltean@nxp.com</email>
</author>
<published>2025-01-14T16:47:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d6e3316a1680305da291a5b5deaf424559aaf06c'/>
<id>urn:sha1:d6e3316a1680305da291a5b5deaf424559aaf06c</id>
<content type='text'>
xpcs_config_2500basex() sets DW_VR_MII_DIG_CTRL1_2G5_EN, but
xpcs_config_aneg_c37_sgmii() never unsets it. So, on a protocol change
from 2500base-x to sgmii, the DW_VR_MII_DIG_CTRL1_2G5_EN bit will remain
set.

Fixes: f27abde3042a ("net: pcs: add 2500BASEX support for Intel mGbE controller")
Signed-off-by: Vladimir Oltean &lt;vladimir.oltean@nxp.com&gt;
Reviewed-by: Maxime Chevallier &lt;maxime.chevallier@bootlin.com&gt;
Reviewed-by: Russell King (Oracle) &lt;rmk+kernel@armlinux.org.uk&gt;
Link: https://patch.msgid.link/20250114164721.2879380-2-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: pcs: xpcs: fix DW_VR_MII_DIG_CTRL1_2G5_EN bit being set for 1G SGMII w/o inband</title>
<updated>2025-01-15T21:22:23Z</updated>
<author>
<name>Vladimir Oltean</name>
<email>vladimir.oltean@nxp.com</email>
</author>
<published>2025-01-14T16:47:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5c71729ab92c7e710d48ed93043a2d1e35cc8d3c'/>
<id>urn:sha1:5c71729ab92c7e710d48ed93043a2d1e35cc8d3c</id>
<content type='text'>
On a port with SGMII fixed-link at SPEED_1000, DW_VR_MII_DIG_CTRL1 gets
set to 0x2404. This is incorrect, because bit 2 (DW_VR_MII_DIG_CTRL1_2G5_EN)
is set.

It comes from the previous write to DW_VR_MII_AN_CTRL, because the "val"
variable is reused and is dirty. Actually, its value is 0x4, aka
FIELD_PREP(DW_VR_MII_PCS_MODE_MASK, DW_VR_MII_PCS_MODE_C37_SGMII).

Resolve the issue by clearing "val" to 0 when writing to a new register.
After the fix, the register value is 0x2400.

Prior to the blamed commit, when the read-modify-write was open-coded,
the code saved the content of the DW_VR_MII_DIG_CTRL1 register in the
"ret" variable.

Fixes: ce8d6081fcf4 ("net: pcs: xpcs: add _modify() accessors")
Signed-off-by: Vladimir Oltean &lt;vladimir.oltean@nxp.com&gt;
Reviewed-by: Maxime Chevallier &lt;maxime.chevallier@bootlin.com&gt;
Reviewed-by: Russell King (Oracle) &lt;rmk+kernel@armlinux.org.uk&gt;
Link: https://patch.msgid.link/20250114164721.2879380-1-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: pcs: xpcs: remove return statements in void function</title>
<updated>2024-10-23T14:10:16Z</updated>
<author>
<name>Russell King (Oracle)</name>
<email>rmk+kernel@armlinux.org.uk</email>
</author>
<published>2024-10-17T11:53:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fd4056db7aee901677a3c62534b2d31b38678cb4'/>
<id>urn:sha1:fd4056db7aee901677a3c62534b2d31b38678cb4</id>
<content type='text'>
While using "return" when calling a void returning function inside a
function that returns void doesn't cause a compiler warning, it looks
weird. Convert the bunch of if() statements to a switch() and remove
these return statements.

Signed-off-by: Russell King (Oracle) &lt;rmk+kernel@armlinux.org.uk&gt;
Tested-by: Serge Semin &lt;fancer.lancer@gmail.com&gt;
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
</content>
</entry>
<entry>
<title>net: pcs: xpcs: rename xpcs_config_usxgmii()</title>
<updated>2024-10-23T14:10:16Z</updated>
<author>
<name>Russell King (Oracle)</name>
<email>rmk+kernel@armlinux.org.uk</email>
</author>
<published>2024-10-17T11:53:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=11afdf3b2ecee038dda8a38b6b6e6d232e64a210'/>
<id>urn:sha1:11afdf3b2ecee038dda8a38b6b6e6d232e64a210</id>
<content type='text'>
xpcs_config_usxgmii() is only called from the xpcs_link_up() method, so
let's name it similarly to the SGMII and 1000BASEX functions.

Signed-off-by: Russell King (Oracle) &lt;rmk+kernel@armlinux.org.uk&gt;
Tested-by: Serge Semin &lt;fancer.lancer@gmail.com&gt;
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
</content>
</entry>
<entry>
<title>net: pcs: xpcs: combine xpcs_link_up_{1000basex,sgmii}()</title>
<updated>2024-10-23T14:10:16Z</updated>
<author>
<name>Russell King (Oracle)</name>
<email>rmk+kernel@armlinux.org.uk</email>
</author>
<published>2024-10-17T11:52:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4145921c305545cf86d49c0dd665084fb7245225'/>
<id>urn:sha1:4145921c305545cf86d49c0dd665084fb7245225</id>
<content type='text'>
xpcs_link_up_sgmii() and xpcs_link_up_1000basex() are almost identical
with the exception of checking the speed and duplex for 1000BASE-X.
Combine the two functions.

Signed-off-by: Russell King (Oracle) &lt;rmk+kernel@armlinux.org.uk&gt;
Tested-by: Serge Semin &lt;fancer.lancer@gmail.com&gt;
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
</content>
</entry>
<entry>
<title>net: pcs: xpcs: replace open-coded mii_bmcr_encode_fixed()</title>
<updated>2024-10-23T14:10:16Z</updated>
<author>
<name>Russell King (Oracle)</name>
<email>rmk+kernel@armlinux.org.uk</email>
</author>
<published>2024-10-17T11:52:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1c17f9d3fe17d296ff2d93740ee96a52a2343628'/>
<id>urn:sha1:1c17f9d3fe17d296ff2d93740ee96a52a2343628</id>
<content type='text'>
We can now see that we have an open-coded version of
mii_bmcr_encode_fixed() when this is called with SPEED_1000:

        val = BMCR_SPEED1000;
        if (duplex == DUPLEX_FULL)
                val |= BMCR_FULLDPLX;

Replace this with a call to mii_bmcr_encode_fixed().

Signed-off-by: Russell King (Oracle) &lt;rmk+kernel@armlinux.org.uk&gt;
Tested-by: Serge Semin &lt;fancer.lancer@gmail.com&gt;
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
</content>
</entry>
<entry>
<title>net: pcs: xpcs: rearrange xpcs_link_up_1000basex()</title>
<updated>2024-10-23T14:10:16Z</updated>
<author>
<name>Russell King (Oracle)</name>
<email>rmk+kernel@armlinux.org.uk</email>
</author>
<published>2024-10-17T11:52:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b61a465a761921d11f99492ce41b85cfba7d6161'/>
<id>urn:sha1:b61a465a761921d11f99492ce41b85cfba7d6161</id>
<content type='text'>
Rearrange xpcs_link_up_1000basex() to make it more obvious what will
happen in the following commit.

Signed-off-by: Russell King (Oracle) &lt;rmk+kernel@armlinux.org.uk&gt;
Tested-by: Serge Semin &lt;fancer.lancer@gmail.com&gt;
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
</content>
</entry>
<entry>
<title>net: pcs: xpcs: remove switch() in xpcs_link_up_1000basex()</title>
<updated>2024-10-23T14:10:16Z</updated>
<author>
<name>Russell King (Oracle)</name>
<email>rmk+kernel@armlinux.org.uk</email>
</author>
<published>2024-10-17T11:52:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8d2aeab4ce782df9d7cd035938f4545af7db260e'/>
<id>urn:sha1:8d2aeab4ce782df9d7cd035938f4545af7db260e</id>
<content type='text'>
Remove an unnecessary switch() statement in xpcs_link_up_1000basex().
The only value this switch statement is interested in is SPEED_1000,
all other values lead to an error. Replace this with a simple if()
statement.

Signed-off-by: Russell King (Oracle) &lt;rmk+kernel@armlinux.org.uk&gt;
Tested-by: Serge Semin &lt;fancer.lancer@gmail.com&gt;
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
</content>
</entry>
<entry>
<title>net: pcs: xpcs: use generic register definitions</title>
<updated>2024-10-23T14:10:16Z</updated>
<author>
<name>Russell King (Oracle)</name>
<email>rmk+kernel@armlinux.org.uk</email>
</author>
<published>2024-10-17T11:52:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1d2709d6d3902786bfc3e9ede627e7364633cff7'/>
<id>urn:sha1:1d2709d6d3902786bfc3e9ede627e7364633cff7</id>
<content type='text'>
As a general policy, we refer our generic register definitions over
vendor specific definitions. In XPCS, it appears that the register
layout follows a BMCR, BMSR and ADVERTISE register definition. We
already refer to this BMCR register using several different macros
which is confusing.

Convert the following register definitions to generic versions:

DW_VR_MII_MMD_CTRL =&gt; MII_BMCR
MDIO_CTRL1 =&gt; MII_BMCR
AN_CL37_EN =&gt; BMCR_ANENABLE
SGMII_SPEED_SS6 =&gt; BMCR_SPEED1000
SGMII_SPEED_SS13 =&gt; BMCR_SPEED100
MDIO_CTRL1_RESET =&gt; BMCR_RESET

DW_VR_MII_MMD_STS =&gt; MII_BMSR
DW_VR_MII_MMD_STS_LINK_STS =&gt; BMSR_LSTATUS

DW_FULL_DUPLEX =&gt; ADVERTISE_1000XFULL
iDW_HALF_DUPLEX =&gt; ADVERTISE_1000XHALF

Signed-off-by: Russell King (Oracle) &lt;rmk+kernel@armlinux.org.uk&gt;
Tested-by: Serge Semin &lt;fancer.lancer@gmail.com&gt;
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
</content>
</entry>
<entry>
<title>net: pcs: xpcs: move Wangxun VR_XS_PCS_DIG_CTRL1 configuration</title>
<updated>2024-10-09T11:13:12Z</updated>
<author>
<name>Russell King (Oracle)</name>
<email>rmk+kernel@armlinux.org.uk</email>
</author>
<published>2024-10-04T10:21:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bb0b8aeca636373a9136a7a5b7594031c7587c5e'/>
<id>urn:sha1:bb0b8aeca636373a9136a7a5b7594031c7587c5e</id>
<content type='text'>
According to commits 2a22b7ae2fa3 ("net: pcs: xpcs: adapt Wangxun NICs
for SGMII mode") and 2deea43f386d ("net: pcs: xpcs: add 1000BASE-X AN
interrupt support"), Wangxun devices need special VR_XS_PCS_DIG_CTRL1
settings for SGMII and 1000BASE-X. Both SGMII and 1000BASE-X use the
same settings.

Rather than placing these in the individual xpcs_config_*() functions,
move it to where we already test for the Wangxun devices in
xpcs_do_config().

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>
</feed>
