From patchwork Tue Dec 26 08:34:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sneh Shah X-Patchwork-Id: 183284 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp746355dyb; Tue, 26 Dec 2023 00:35:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IHk1aw71lO7kXpSHkYIx/uWvH4slA82HEC0b0Hg8+DiZILXMP+jO5/pX2A+xu844F3evGKW X-Received: by 2002:a50:d48f:0:b0:554:7c17:98ca with SMTP id s15-20020a50d48f000000b005547c1798camr4046556edi.78.1703579733018; Tue, 26 Dec 2023 00:35:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703579733; cv=none; d=google.com; s=arc-20160816; b=1G5eJRO/zJLdlup+syK413H1ClVcCkrD8VjWmH5EZG7QKKim25umeTTzwd75ANnBjO b4ocZpb/H3D03d4t1Ru4UNf1HcdZdP8TDifEeEXI564j9jfxLkBjVdXe8uReIORJdCa3 CoZfY4VJq0tGLgjgf6bmgl+tpNeJuvW+MZmeUuVNdp/YojKV0j9fqOjFz2kCw1GaOyUB UN+466B1v4BTdn61qEFscSEi4dhgpjr1oAS1oc3YUml/nRTWFjBqBu5pX1XWexQRSkyv cLlBOyMBoc3or+mjQGtU4X+WASzTA6K/Mh5L2RpElTnqpCOR0rSBPPaBLZ7Hs/6TQDSX x6rA== 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-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11414-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. [147.75.80.249]) by mx.google.com with ESMTPS id cx16-20020a05640222b000b00554bb66e7d9si2153079edb.6.2023.12.26.00.35.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Dec 2023 00:35:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-11414-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; 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-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11414-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 A05DF1F226B3 for ; Tue, 26 Dec 2023 08:35:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ADF2F4CE19; Tue, 26 Dec 2023 08:35:14 +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: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786332822377155573 X-GMAIL-MSGID: 1786332822377155573 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;