Message ID | 20231218135032.27209-1-quic_snehshah@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-3775-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp1252205dyi; Mon, 18 Dec 2023 05:51:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IEsZ0048wOzh/oNH0TXeWU36FGHzqjgsnhNiLRd2a8CilvGblN4zBRK+ix55S5KVoKhNxW9 X-Received: by 2002:a17:906:a016:b0:a1c:616e:cdd2 with SMTP id p22-20020a170906a01600b00a1c616ecdd2mr6502482ejy.35.1702907499321; Mon, 18 Dec 2023 05:51:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702907499; cv=none; d=google.com; s=arc-20160816; b=nvLgxQobA/1vH8MmMU/taORseBDIURPitU6Ky8kIYX02zLh2SlH2Jm2dZe1AEUDcmY PxT0Hs53HgOMovaJL8BxZ8vTtfpe5LUiRUyTV4HnenK25kJ7a5kJ8HdnLp7jIGhoRP9r bQrgT2yIYYTZZSPHMIV9XY+5XobK0OrHsDq5aeq1mIrHk+6fKpuatXoWtEOmMOyq7frL pGiV18Oeav1/NSg9aZ2wqzNSqPJ3apd5SbiesFjELbLcMDMpvkrxLZan5FkmkNDJwprE znAC/oRdOGPqAo4K5YJPW0t/7VdW/claS+urvNhTmNBQ/NCHcr5UuAqJo1RT8rKTcAdp 5icA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:message-id:date :subject:cc:to:from:dkim-signature; bh=nUdOg7e/uqM8fAT/uL8XeBHHGJeylXDTsQX179ijxSk=; fh=gcKuIwxwcx3z1X4hsHxbeqcdgBOSbYQMQyUNPBSxPTA=; b=bNfo1m1EKyZlwEEW0zLgGY5E4+A+nwK4a08UvLOBomckdVEG+E/JO4E6gQ6uH2VlwV HNRhpSC1gXTDzCmZE9o6pPsRxA9C1duvL3EIvKYC27ZV9mkd53bJsfYuYezvPTj1MF8n mZZNF0BByt+9W5mHlYNgniTrkILR0mXBrI74i9bj9Hp/GuNKrRN4iEN3c18g5w/W3Lt4 uZMROIIzAzAekCA5p2FHHX28KNBQMJJavaah58pe+/YtHJ/lLobbGsrdImCfqN5cHUCH uftH42SRk+wuTOSWY3UUFiW6CbXHXazAeqpTC1ibt/s4en1DumkRkw0+iX3rpY2wKO99 72ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=RxMEhI0N; spf=pass (google.com: domain of linux-kernel+bounces-3775-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3775-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id w17-20020a17090633d100b00a233bf3629bsi1553185eja.566.2023.12.18.05.51.39 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 05:51:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-3775-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=RxMEhI0N; spf=pass (google.com: domain of linux-kernel+bounces-3775-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3775-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D601D1F23A5A for <ouuuleilei@gmail.com>; Mon, 18 Dec 2023 13:51:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C802F200A0; Mon, 18 Dec 2023 13:51:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="RxMEhI0N" X-Original-To: linux-kernel@vger.kernel.org Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 70755129EF3; Mon, 18 Dec 2023 13:50:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=qualcomm.com Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BIAsVWW017332; Mon, 18 Dec 2023 13:50:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id; s=qcppdkim1; bh=nUdOg7e/uqM8 fAT/uL8XeBHHGJeylXDTsQX179ijxSk=; b=RxMEhI0NwhaB8DgcapUyRgMHCN/n zk6Pivg5MSY+vm24um1dVW2c+hxXhFP9ETICnsUGFxQ4oqmg2LfbksgnakeayWjo hI21iB9FuXMVuALz31K+kvN87u1/4mlEmyvzAUusGz8lsb4MnAglB90RoJeZ3eo2 vlOhsdBDVarMUE3WhAIE+DwJ4+e7LN8W9UEs2+ymvoXoJpSJQe/aK/+erWx1LVDg OZiQ9RkkgtONSfrxVQFUrc7N2oflGFjs1bXbZ/kLzNuA/uMkJNFlpb2cMCNEPXSD lkorj2AdpJVZBuFQNtu87uO0CDqjdLeJVUbkMtvyUoagVzKYWbW/wRynUA== Received: from apblrppmta01.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3v2j2dgr4p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 18 Dec 2023 13:50:41 +0000 (GMT) Received: from pps.filterd (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 3BIDoblo013928; Mon, 18 Dec 2023 13:50:37 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTP id 3v14ym0na4-1; Mon, 18 Dec 2023 13:50:37 +0000 Received: from APBLRPPMTA01.qualcomm.com (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3BIDoa0d013922; Mon, 18 Dec 2023 13:50:36 GMT Received: from hu-maiyas-hyd.qualcomm.com (hu-snehshah-hyd.qualcomm.com [10.147.246.35]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTP id 3BIDoa8n013918; Mon, 18 Dec 2023 13:50:36 +0000 Received: by hu-maiyas-hyd.qualcomm.com (Postfix, from userid 2319345) id 9DB1D5001DB; Mon, 18 Dec 2023 19:20:35 +0530 (+0530) From: Sneh Shah <quic_snehshah@quicinc.com> To: Vinod Koul <vkoul@kernel.org>, Bhupesh Sharma <bhupesh.sharma@linaro.org>, Alexandre Torgue <alexandre.torgue@foss.st.com>, Jose Abreu <joabreu@synopsys.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Maxime Coquelin <mcoquelin.stm32@gmail.com>, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Andrew Halaney <ahalaney@redhat.com> Cc: Sneh Shah <quic_snehshah@quicinc.com>, kernel@quicinc.com Subject: [PATCH net-next] net: stmmac: Fix ethool link settings ops for integrated PCS Date: Mon, 18 Dec 2023 19:20:32 +0530 Message-Id: <20231218135032.27209-1-quic_snehshah@quicinc.com> X-Mailer: git-send-email 2.17.1 X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: MsEGX18yZSJR_NepSVO8KsNU-e5xjiMl X-Proofpoint-GUID: MsEGX18yZSJR_NepSVO8KsNU-e5xjiMl X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_02,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 mlxlogscore=999 mlxscore=0 bulkscore=0 suspectscore=0 impostorscore=0 priorityscore=1501 adultscore=0 malwarescore=0 lowpriorityscore=0 spamscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312180100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785627934068783799 X-GMAIL-MSGID: 1785627934068783799 |
Series |
[net-next] net: stmmac: Fix ethool link settings ops for integrated PCS
|
|
Commit Message
Sneh Shah
Dec. 18, 2023, 1:50 p.m. UTC
Currently get/set_link_ksettings ethtool ops are dependent on PCS.
When PCS is integrated in MAC, it will not have separate link config.
Bypass cofiguring and checking PCS link config for integrated PCS.
Signed-off-by: Sneh Shah <quic_snehshah@quicinc.com>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
Comments
Hi, I think the subject should be [PATCH net] since this is a fix. On Mon, Dec 18, 2023 at 07:20:32PM +0530, Sneh Shah wrote: > Currently get/set_link_ksettings ethtool ops are dependent on PCS. > When PCS is integrated in MAC, it will not have separate link config. > Bypass cofiguring and checking PCS link config for integrated PCS. s/cofiguring/configuring/ Please add: Fixes: ("aa571b6275fb net: stmmac: add new switch to struct plat_stmmacenet_data") This fixes using the ethtool ops for me so also please feel free to add: Tested-by: Andrew Halaney <ahalaney@redhat.com> # sa8775p-ride Thanks for the patch! > > Signed-off-by: Sneh Shah <quic_snehshah@quicinc.com> > --- > 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 >
> 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) && [Suman] A personal preference here, I think the code will be more readable if we handle the !if condition @ the beginning. Something like, if (priv->plat->flags & STMMAC_FLAG_HAS_INTEGRATED_PCS || !(priv->hw->pcs & STMMAC_PCS_RGMII) || !(priv->hw->pcs & STMMAC_PCS_RGMII)) return phylink_ethtool_ksettings_get(priv->phylink, cmd); and keep the rest of the code without any check. But it is up-to you. >+ (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 >
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;