Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp2670099rdb; Tue, 26 Dec 2023 00:35:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IEUutEGacpAOR/ydqJ+Vp72f9TVdsoxcTL0OMeyg3mJqsGs9jPmZ/IExndNXCV5Ngd/wGha X-Received: by 2002:ac8:5c48:0:b0:425:4042:f456 with SMTP id j8-20020ac85c48000000b004254042f456mr9166437qtj.58.1703579723297; Tue, 26 Dec 2023 00:35:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703579723; cv=none; d=google.com; s=arc-20160816; b=X0svPaJ3bPTFp2JAj2Phtyf/MjD6zl2VORQ/7iWpzjsHks7JlsS40rOE9ebFb8llu8 J4ksao6y1NaU3QiRxpc6cgj05LhgzflULSWcl++YyY0Ui5UWoKsUVZoCyYljQ+363hmq 3A0doTzHNFjtSiPTo8diWLd5mr+efRdd1+gjvQMGsxZ1x7wPAXy6trF1yRryjWBHemiZ BwS0gJqmKlPWWyjjVStAhur2ZT4jO7Gv5umYVLxMVjxbjR/gWY/JxdPIV5FdzarZGwS0 oLAF62TUGcoc6kZIvuKRZAbw1SksVK9WipFlwKPR1PwHXPI1SyIcivZjJz+MT0xomC4s Ekjw== 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=loTYWzO9V2laV51pZPGKA3Tqqx72zGLxFo0XGcH+SFY=; fh=1Jy5qpJ7e4FuBmQkVP0GCA4F+wDSel+w4r34NwoYij8=; b=uz8PPaScoIjAeQ50eRlo1w2Fi+ClEXITCEdJ1oRzqQHcxeI6N3qylzJTDySZWM1iNw k+VlX6nveOaBo84t9DJoC5/lzV2Y9mcB+nScyhSvWc69YOTd77ML0MX7y8kRB5qTWrDV s/SZavD2JiY2Tc5TCXXAgBckrbaGQME0Nb0kzHji9WeCDZcG+POtPsRSaxZWFziBaOqA oPAen3E7+zdVED6AwxmKriuoqjHgmq7yN5AYyBUwrXuLuH1PFQaOoe6kwwktN8lzp+sh Pa1sXuqxhTgE37rzXtVmwyH9NTzlhTW4lp/Kbhvqil2N3NRoArBFcToM/tGXPewbO26m pwEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ZreBZp4n; spf=pass (google.com: domain of linux-kernel+bounces-11414-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11414-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d13-20020a05622a15cd00b0042560e940dfsi12577051qty.138.2023.12.26.00.35.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Dec 2023 00:35:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-11414-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ZreBZp4n; spf=pass (google.com: domain of linux-kernel+bounces-11414-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11414-linux.lists.archive=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 0177E1C21D68 for ; Tue, 26 Dec 2023 08:35:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D65BF4CDF3; Tue, 26 Dec 2023 08:35:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="ZreBZp4n" 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 8468D224CE; Tue, 26 Dec 2023 08:35:10 +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 (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BQ67c6u018268; Tue, 26 Dec 2023 08:34:38 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=loTYWzO9V2la V51pZPGKA3Tqqx72zGLxFo0XGcH+SFY=; b=ZreBZp4na0b3ooxc63SYfGxKfgAt YusPVjOT++23bo12c0kD2LbAMcMjTLXQF7tl78L65Q8lnfESK0+t2al3JZnu3GKg hD0wHqjV7x30L9Q+GIlQvbzSkkSafbzCEqAZRs9p7NX74U8PbV0I+kirXEUrYXaI lA2whaTMPkJRYg0vB2EY0kkuNBSmktaNQ+XLWz7oOySGo+mu/HxXjnhZfpsHix7r 8Nk8Ui7sdV64Ck0onjAzqYqAsoKVWikNRSa5NsxGyV5VhOq/447NwsLoV6ApML3V 1NasdzSDPNq4sX/CiOUutB9ZvLtJRXn3ZdmxorVtfphZNUMTF5gGv7B2DA== Received: from apblrppmta02.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3v7s95rb7r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 26 Dec 2023 08:34:38 +0000 (GMT) Received: from pps.filterd (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 3BQ8YYUP017003; Tue, 26 Dec 2023 08:34:34 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 3v5rmkmhje-1; Tue, 26 Dec 2023 08:34:34 +0000 Received: from APBLRPPMTA02.qualcomm.com (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3BQ8YXTe016996; Tue, 26 Dec 2023 08:34:34 GMT Received: from hu-maiyas-hyd.qualcomm.com (hu-snehshah-hyd.qualcomm.com [10.147.246.35]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 3BQ8YXFX016995; Tue, 26 Dec 2023 08:34:33 +0000 Received: by hu-maiyas-hyd.qualcomm.com (Postfix, from userid 2319345) id 0C21D5299C3; Tue, 26 Dec 2023 14:04:33 +0530 (+0530) From: Sneh Shah To: Vinod Koul , Bhupesh Sharma , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , 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 Cc: Sneh Shah , kernel@quicinc.com, Andrew Halaney Subject: [PATCH net v2] net: stmmac: Fix ethool link settings ops for integrated PCS Date: Tue, 26 Dec 2023 14:04:32 +0530 Message-Id: <20231226083432.24920-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: Fa070FFpTpNBAynbl0Tru0yvGrIJ8Idl X-Proofpoint-GUID: Fa070FFpTpNBAynbl0Tru0yvGrIJ8Idl 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 lowpriorityscore=0 malwarescore=0 phishscore=0 priorityscore=1501 bulkscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 mlxscore=0 spamscore=0 clxscore=1015 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312260061 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 # sa8775p-ride Signed-off-by: Sneh Shah --- 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