netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net v3] net: stmmac: Fix ethool link settings ops for integrated PCS
@ 2024-01-09 14:47 Sneh Shah
  2024-01-10 13:33 ` Simon Horman
  2024-01-13 12:50 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Sneh Shah @ 2024-01-09 14:47 UTC (permalink / raw)
  To: Vinod Koul, Bhupesh Sharma, Alexandre Torgue, Jose Abreu,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Maxime Coquelin, netdev, linux-arm-msm, linux-stm32,
	linux-arm-kernel, linux-kernel
  Cc: Sneh Shah, kernel, Andrew Halaney

Currently get/set_link_ksettings ethtool ops are dependent on PCS.
When PCS is integrated, it will not have separate link config.
Bypass configuring and checking PCS for integrated PCS.

Fixes: aa571b6275fb ("net: stmmac: add new switch to struct plat_stmmacenet_data")
Tested-by: Andrew Halaney <ahalaney@redhat.com> # sa8775p-ride
Signed-off-by: Sneh Shah <quic_snehshah@quicinc.com>
---
V3 changelog:
- Updated Fixes tag
v2 changelog:
- Added tested by tag.
- Added Fixes tag.
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
index f628411ae4ae..e3ba4cd47b8d 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
@@ -311,8 +311,9 @@ static int stmmac_ethtool_get_link_ksettings(struct net_device *dev,
 {
 	struct stmmac_priv *priv = netdev_priv(dev);
 
-	if (priv->hw->pcs & STMMAC_PCS_RGMII ||
-	    priv->hw->pcs & STMMAC_PCS_SGMII) {
+	if (!(priv->plat->flags & STMMAC_FLAG_HAS_INTEGRATED_PCS) &&
+	    (priv->hw->pcs & STMMAC_PCS_RGMII ||
+	     priv->hw->pcs & STMMAC_PCS_SGMII)) {
 		struct rgmii_adv adv;
 		u32 supported, advertising, lp_advertising;
 
@@ -397,8 +398,9 @@ stmmac_ethtool_set_link_ksettings(struct net_device *dev,
 {
 	struct stmmac_priv *priv = netdev_priv(dev);
 
-	if (priv->hw->pcs & STMMAC_PCS_RGMII ||
-	    priv->hw->pcs & STMMAC_PCS_SGMII) {
+	if (!(priv->plat->flags & STMMAC_FLAG_HAS_INTEGRATED_PCS) &&
+	    (priv->hw->pcs & STMMAC_PCS_RGMII ||
+	     priv->hw->pcs & STMMAC_PCS_SGMII)) {
 		/* Only support ANE */
 		if (cmd->base.autoneg != AUTONEG_ENABLE)
 			return -EINVAL;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net v3] net: stmmac: Fix ethool link settings ops for integrated PCS
  2024-01-09 14:47 [PATCH net v3] net: stmmac: Fix ethool link settings ops for integrated PCS Sneh Shah
@ 2024-01-10 13:33 ` Simon Horman
  2024-01-13 12:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2024-01-10 13:33 UTC (permalink / raw)
  To: Sneh Shah
  Cc: Vinod Koul, Bhupesh Sharma, Alexandre Torgue, Jose Abreu,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Maxime Coquelin, netdev, linux-arm-msm, linux-stm32,
	linux-arm-kernel, linux-kernel, kernel, Andrew Halaney

On Tue, Jan 09, 2024 at 08:17:29PM +0530, Sneh Shah wrote:
> Currently get/set_link_ksettings ethtool ops are dependent on PCS.
> When PCS is integrated, it will not have separate link config.
> Bypass configuring and checking PCS for integrated PCS.
> 
> Fixes: aa571b6275fb ("net: stmmac: add new switch to struct plat_stmmacenet_data")
> Tested-by: Andrew Halaney <ahalaney@redhat.com> # sa8775p-ride
> Signed-off-by: Sneh Shah <quic_snehshah@quicinc.com>

Reviewed-by: Simon Horman <horms@kernel.org>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net v3] net: stmmac: Fix ethool link settings ops for integrated PCS
  2024-01-09 14:47 [PATCH net v3] net: stmmac: Fix ethool link settings ops for integrated PCS Sneh Shah
  2024-01-10 13:33 ` Simon Horman
@ 2024-01-13 12:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-01-13 12:50 UTC (permalink / raw)
  To: Sneh Shah
  Cc: vkoul, bhupesh.sharma, alexandre.torgue, joabreu, davem, edumazet,
	kuba, pabeni, mcoquelin.stm32, netdev, linux-arm-msm, linux-stm32,
	linux-arm-kernel, linux-kernel, kernel, ahalaney

Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:

On Tue,  9 Jan 2024 20:17:29 +0530 you wrote:
> Currently get/set_link_ksettings ethtool ops are dependent on PCS.
> When PCS is integrated, it will not have separate link config.
> Bypass configuring and checking PCS for integrated PCS.
> 
> Fixes: aa571b6275fb ("net: stmmac: add new switch to struct plat_stmmacenet_data")
> Tested-by: Andrew Halaney <ahalaney@redhat.com> # sa8775p-ride
> Signed-off-by: Sneh Shah <quic_snehshah@quicinc.com>
> 
> [...]

Here is the summary with links:
  - [net,v3] net: stmmac: Fix ethool link settings ops for integrated PCS
    https://git.kernel.org/netdev/net/c/08300adac3b8

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-01-13 12:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-09 14:47 [PATCH net v3] net: stmmac: Fix ethool link settings ops for integrated PCS Sneh Shah
2024-01-10 13:33 ` Simon Horman
2024-01-13 12:50 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).