[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9fe98cb8-f1c7-472c-a619-1ecabd636b07@altera.com>
Date: Thu, 17 Jul 2025 17:56:43 +0530
From: "G Thomas, Rohan" <rohan.g.thomas@...era.com>
To: "Russell King (Oracle)" <linux@...linux.org.uk>
Cc: Andrew Lunn <andrew+netdev@...n.ch>, "David S. Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Serge Semin <fancer.lancer@...il.com>,
Romain Gantois <romain.gantois@...tlin.com>, netdev@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
Matthew Gerlach <matthew.gerlach@...era.com>
Subject: Re: [PATCH net-next 2/3] net: stmmac: xgmac: Correct supported speed
modes
Hi Russell,
Thanks for reviewing the patch.
On 7/17/2025 12:15 PM, Russell King (Oracle) wrote:
> On Mon, Jul 14, 2025 at 03:59:18PM +0800, Rohan G Thomas via B4 Relay wrote:
>> @@ -1532,8 +1542,8 @@ int dwxgmac2_setup(struct stmmac_priv *priv)
>> mac->mcast_bits_log2 = ilog2(mac->multicast_filter_bins);
>>
>> mac->link.caps = MAC_ASYM_PAUSE | MAC_SYM_PAUSE |
>> - MAC_1000FD | MAC_2500FD | MAC_5000FD |
>> - MAC_10000FD;
>> + MAC_10FD | MAC_100FD | MAC_1000FD |
>> + MAC_2500FD | MAC_5000FD | MAC_10000FD;
> ...
>> @@ -405,6 +405,7 @@ static int dwxgmac2_get_hw_feature(void __iomem *ioaddr,
>> dma_cap->sma_mdio = (hw_cap & XGMAC_HWFEAT_SMASEL) >> 5;
>> dma_cap->vlhash = (hw_cap & XGMAC_HWFEAT_VLHASH) >> 4;
>> dma_cap->half_duplex = (hw_cap & XGMAC_HWFEAT_HDSEL) >> 3;
>> + dma_cap->mbps_10_100 = (hw_cap & XGMAC_HWFEAT_GMIISEL) >> 1;
>
> What if dma_cap->mbps_10_100 is false? Should MAC_10FD | MAC_100FD
> still be set? What if dma_cap->half_duplex is set but
> dma_cap->mbps_10_100 is not? Should we avoid setting 10HD and 100HD?
As per the XGMAC databook, 10Mbps/100Mbps/1Gbps speeds are supported
only when the GMIISEL bit is set. As Serge pointed out, I also need to
consider the MAC version (≥ v3.00a) when enabling these modes. I’ll
update the next version of the patch to include checks for both the
GMIISEL bit and the MAC version before enabling the
MAC_10FD/MAC_100FD/MAC_1000FD capabilities.
Also, regarding the HDSEL bit — it is set only if 10Mbps/100Mbps modes
are supported. I’ll include this condition as well when handling half
duplex support in the updated patch.
>
Best Regards,
Rohan
Powered by blists - more mailing lists