CINXE.COM

LKML: "Russell King (Oracle)": Re: [PATCH net-next v7 2/7] net: pcs: xpcs: re-initiate clause 37 Auto-negotiation

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>LKML: "Russell King (Oracle)": Re: [PATCH net-next v7 2/7] net: pcs: xpcs: re-initiate clause 37 Auto-negotiation</title><link href="/css/message.css" rel="stylesheet" type="text/css" /><link href="/css/wrap.css" rel="alternate stylesheet" type="text/css" title="wrap" /><link href="/css/nowrap.css" rel="stylesheet" type="text/css" title="nowrap" /><link href="/favicon.ico" rel="shortcut icon" /><script src="/js/simple-calendar.js" type="text/javascript"></script><script src="/js/styleswitcher.js" type="text/javascript"></script><link rel="alternate" type="application/rss+xml" title="lkml.org : last 100 messages" href="/rss.php" /><link rel="alternate" type="application/rss+xml" title="lkml.org : last messages by &quot;Russell King (Oracle)&quot;" href="/groupie.php?aid=" /><!--Matomo--><script> var _paq = window._paq = window._paq || []; /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ _paq.push(["setDoNotTrack", true]); _paq.push(["disableCookies"]); _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u="//m.lkml.org/"; _paq.push(['setTrackerUrl', u+'matomo.php']); _paq.push(['setSiteId', '1']); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); })(); </script><!--End Matomo Code--></head><body onload="es.jasper.simpleCalendar.init();" itemscope="itemscope" itemtype="http://schema.org/BlogPosting"><table border="0" cellpadding="0" cellspacing="0"><tr><td width="180" align="center"><a href="/"><img style="border:0;width:135px;height:32px" src="/images/toprowlk.gif" alt="lkml.org" /></a></td><td width="32">聽</td><td class="nb"><div><a class="nb" href="/lkml"> [lkml]</a> 聽 <a class="nb" href="/lkml/2025"> [2025]</a> 聽 <a class="nb" href="/lkml/2025/2"> [Feb]</a> 聽 <a class="nb" href="/lkml/2025/2/6"> [6]</a> 聽 <a class="nb" href="/lkml/last100"> [last100]</a> 聽 <a href="/rss.php"><img src="/images/rss-or.gif" border="0" alt="RSS Feed" /></a></div><div>Views: <a href="#" class="nowrap" onclick="setActiveStyleSheet('wrap');return false;">[wrap]</a><a href="#" class="wrap" onclick="setActiveStyleSheet('nowrap');return false;">[no wrap]</a> 聽 <a class="nb" href="/lkml/mheaders/2025/2/6/994" onclick="this.href='/lkml/headers'+'/2025/2/6/994';">[headers]</a>聽 <a href="/lkml/bounce/2025/2/6/994">[forward]</a>聽 </div></td><td width="32">聽</td></tr><tr><td valign="top"><div class="es-jasper-simpleCalendar" baseurl="/lkml/"></div><div class="threadlist">Messages in this thread</div><ul class="threadlist"><li class="root"><a href="/lkml/2025/2/6/803">First message in thread</a></li><li><a href="/lkml/2025/2/6/803">Choong Yong Liang</a><ul><li><a href="/lkml/2025/2/6/804">Choong Yong Liang</a></li><li><a href="/lkml/2025/2/6/809">Choong Yong Liang</a><ul><li><a href="/lkml/2025/2/6/1123">Dave Hansen</a><ul><li><a href="/lkml/2025/2/6/1750">Andrew Lunn</a></li><li><a href="/lkml/2025/2/19/1410">"David E. Box"</a><ul><li><a href="/lkml/2025/2/20/108">Choong Yong Liang</a></li></ul></li></ul></li></ul></li><li><a href="/lkml/2025/2/6/810">Choong Yong Liang</a><ul><li><a href="/lkml/2025/2/6/840">=?UTF-8?q?Ilpo=20J=C3=A4rvinen?=</a><ul><li><a href="/lkml/2025/2/7/594">Choong Yong Liang</a></li></ul></li></ul></li><li><a href="/lkml/2025/2/6/811">Choong Yong Liang</a><ul><li class="origin"><a href="/lkml/2025/2/7/523">"Russell King (Oracle)"</a><ul><li><a href="/lkml/2025/2/7/523">Choong Yong Liang</a><ul><li><a href="/lkml/2025/2/7/855">Andrew Lunn</a></li></ul></li><li><a href="/lkml/2025/2/20/105">Choong Yong Liang</a></li></ul></li></ul></li><li><a href="/lkml/2025/2/6/812">Choong Yong Liang</a></li><li><a href="/lkml/2025/2/6/813">Choong Yong Liang</a></li><li><a href="/lkml/2025/2/6/814">Choong Yong Liang</a></li></ul></li></ul></td><td width="32" rowspan="2" class="c" valign="top"><img src="/images/icornerl.gif" width="32" height="32" alt="/" /></td><td class="c" rowspan="2" valign="top" style="padding-top: 1em"><table><tr><td><table><tr><td class="lp">Date</td><td class="rp" itemprop="datePublished">Thu, 6 Feb 2025 15:30:33 +0000</td></tr><tr><td class="lp">From</td><td class="rp" itemprop="author">"Russell King (Oracle)" &lt;&gt;</td></tr><tr><td class="lp">Subject</td><td class="rp" itemprop="name">Re: [PATCH net-next v7 2/7] net: pcs: xpcs: re-initiate clause 37 Auto-negotiation</td></tr></table></td><td></td></tr></table><pre itemprop="articleBody">On Thu, Feb 06, 2025 at 09:18:54PM +0800, Choong Yong Liang wrote:<br />&gt; The xpcs_switch_interface_mode function was introduced to handle<br />&gt; interface switching.<br />&gt; <br />&gt; According to the XPCS datasheet, a soft reset is required to initiate<br />&gt; Clause 37 auto-negotiation when the XPCS switches interface modes.<br /><br />Hmm. Given that description, taking it literally, claus 37<br />auto-negotiation is 1000BASE-X, not Cisco SGMII (which isn't an IEEE<br />802.3 standard.) Are you absolutely sure that this applies to Cisco<br />SGMII?<br /><br />If the reset is required when switching to SGMII, should it be done<br />before or after configuring the XPCS for SGMII?<br /><br />Also, if the reset is required, what happens if we're already using<br />SGMII, but AN has been disabled temporarily and is then re-enabled?<br />Is a reset required?<br /><br />What about 1000BASE-X when AN is enabled or disabled and then switching<br />to SGMII?<br /><br />&gt; +static int xpcs_switch_to_aneg_c37_sgmii(const struct dw_xpcs_compat *compat,<br />&gt; + struct dw_xpcs *xpcs,<br />&gt; + unsigned int neg_mode)<br />&gt; +{<br />&gt; + bool an_c37_enabled;<br />&gt; + int ret, mdio_ctrl;<br />&gt; +<br />&gt; + if (neg_mode == PHYLINK_PCS_NEG_INBAND_ENABLED) {<br />&gt; + mdio_ctrl = xpcs_read(xpcs, MDIO_MMD_VEND2, MII_BMCR);<br />&gt; + if (mdio_ctrl &lt; 0)<br />&gt; + return mdio_ctrl;<br />&gt; +<br />&gt; + an_c37_enabled = mdio_ctrl &amp; BMCR_ANENABLE;<br />&gt; + if (!an_c37_enabled) {<br /><br />I don't think that we need "an_c37_enabled" here, I think simply:<br /><br /> if (!(mdio_ctrl &amp; BMCR_ANENABLE)) {<br /><br />would be sufficient.<br /><br />&gt; + //Perform soft reset to initiate C37 auto-negotiation<br />&gt; + ret = xpcs_soft_reset(xpcs, compat);<br />&gt; + if (ret)<br />&gt; + return ret;<br />&gt; + }<br />&gt; + }<br />&gt; + return 0;<br /><br />I'm also wondering (as above) whether this soft reset needs to happen<br />_after_ xpcs_config_aneg_c37_sgmii() has done its work - this function<br />temporarily disables AN while it's doing its work.<br /><br />I'm also wondering whether AN being disabled is really a deciding<br />factor (e.g. when switching from 1000BASE-X AN-enabled to SGMII, is a<br />reset required?)<br /><br />-- <br />RMK's Patch system: <a href="https://www.armlinux.org.uk/developer/patches/">https://www.armlinux.org.uk/developer/patches/</a><br />FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!<br /><br /></pre></td><td width="32" rowspan="2" class="c" valign="top"><img src="/images/icornerr.gif" width="32" height="32" alt="\" /></td></tr><tr><td align="right" valign="bottom"> 聽 </td></tr><tr><td align="right" valign="bottom">聽</td><td class="c" valign="bottom" style="padding-bottom: 0px"><img src="/images/bcornerl.gif" width="32" height="32" alt="\" /></td><td class="c">聽</td><td class="c" valign="bottom" style="padding-bottom: 0px"><img src="/images/bcornerr.gif" width="32" height="32" alt="/" /></td></tr><tr><td align="right" valign="top" colspan="2"> 聽 </td><td class="lm">Last update: 2025-02-06 16:32 聽聽 [W:0.672 / U:0.119 seconds]<br />漏2003-2020 <a href="http://blog.jasper.es/"><span itemprop="editor">Jasper Spaans</span></a>|hosted at <a href="https://www.digitalocean.com/?refcode=9a8e99d24cf9">Digital Ocean</a> and my Meterkast|<a href="http://blog.jasper.es/categories.html#lkml-ref">Read the blog</a></td><td>聽</td></tr></table><script language="javascript" src="/js/styleswitcher.js" type="text/javascript"></script></body></html>

Pages: 1 2 3 4 5 6 7 8 9 10