From patchwork Tue Jan 9 14:47:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sneh Shah X-Patchwork-Id: 186430 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2411:b0:101:2151:f287 with SMTP id m17csp156892dyi; Tue, 9 Jan 2024 06:48:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IFK04rkarp41eJ5wlF9FooSQWNfQJsoSEyAxRJxNAMcKTDMDdkGkcEM7ZJcY+SOhr1QBTuC X-Received: by 2002:a17:906:2c0d:b0:a27:f130:6b6f with SMTP id e13-20020a1709062c0d00b00a27f1306b6fmr692458ejh.56.1704811706318; Tue, 09 Jan 2024 06:48:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704811706; cv=none; d=google.com; s=arc-20160816; b=00hBkIEhltIFth9ZDzMNhgMleo/d08yaHQIQevLfwewG22sNf1ij3c7pDMl/p9vqvO MyZasaNk+AN9FLBVCiKgZOfE8CnZlHDlRZbbOnE7waJ2J0ARoPZPi/pwEcmqJHirRZ/8 46k1A/0Lovm6+ocpoNi0nhOTTHuIsqZw2+rgVcRqxgyP+TItBKYA8BOSIvOMiJdvyrtl C+2jEYpP3nkPXXDmmBj6VxqaltszSgAhKew7NMgjTRvmI6stDtpycZkQmifAK/vHmZQr 2VYu6DEkHhU7uJXHXZzMMTO1pttKI1KS5zNM1kZe6zYJ/7olknMAis+YixkLvgk/sZIG q7Ww== 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=OqL20283cmYanVhhOuIWVS4+G1Vk8TrfvNXYNcu5O1c=; fh=1Jy5qpJ7e4FuBmQkVP0GCA4F+wDSel+w4r34NwoYij8=; b=0yIcPDMQwMPRa0QVCivWpJn1po1dctBuQqOobnDJ5OZKqFl00pZaowvUzPxX4EHjY4 MLHqV7yHQF6jMAQzp1TWPKcpCndzxggElYZ+eIkTArGnw3DyfM3qqprAY6iTYu+/Jqm+ tw5aINNONKva+tXEDmJBRA+y9RGdsghgKMhqvYQIxQ/ORMBngcV7lwpS39DRY663cyip JrVvXV8Mh6olBhNhU/BBgSSwfV1U53lZKiRtmQ68ks28oE4D76XKfYE+rLIKXF3Xa4bA sujikps3K98HH9S0jHXWezyHHZPOk8/GVY7IbBoceD446+H1TD0crWxO5WlY0TCuhMG0 P9TQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=bfrccbyQ; spf=pass (google.com: domain of linux-kernel+bounces-21013-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21013-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 n16-20020a170906689000b00a269c6fc0f8si865509ejr.891.2024.01.09.06.48.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 06:48:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-21013-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=bfrccbyQ; spf=pass (google.com: domain of linux-kernel+bounces-21013-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21013-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 E80801F25855 for ; Tue, 9 Jan 2024 14:48:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BF71E39FD9; Tue, 9 Jan 2024 14:48:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="bfrccbyQ" 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 8B3C239ACD; Tue, 9 Jan 2024 14:48:04 +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 409EhXLc003595; Tue, 9 Jan 2024 14:47:45 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=OqL20283cmYa nVhhOuIWVS4+G1Vk8TrfvNXYNcu5O1c=; b=bfrccbyQ7eR4Han5QJ/8bfYfj9pf 0LY5d7ketSbvFHfYHh/NkYQDMmGc6sfj7l50YYWIKZzUrXb5X8e9K1UToDTcfeW5 UCbQWuXvgYDaTmIXmZUFOGBDGzjtiS/uokyuFtgJa4IvdMcxnbxoYTifxb+66FPJ DE4yv3PLavyuBc3A+2KdxFNKtJ1Etsk8y8bHGdN/4KYzkx811lTkZD1zuuJEzNsF W5YQ4b+NZnX/duqB4RQSue01CQn/1CqeItl/TkKwqpp2qptf7j+G6WosSpQlcJ/1 tB5L3ijNOUxVi45AMBE/zFKsCTpi/V7ShFjxArNsyAS2b5bccsF89LTbXQ== 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 3vh3g68k2b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 09 Jan 2024 14:47:45 +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 409EjEb0032298; Tue, 9 Jan 2024 14:47:33 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTPS id 3veyxmx1pd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 09 Jan 2024 14:47:33 +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 409ElWuU001731; Tue, 9 Jan 2024 14:47:32 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 409ElWix001730; Tue, 09 Jan 2024 14:47:32 +0000 Received: by hu-maiyas-hyd.qualcomm.com (Postfix, from userid 2319345) id B160F5000AA; Tue, 9 Jan 2024 20:17:31 +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 v3] net: stmmac: Fix ethool link settings ops for integrated PCS Date: Tue, 9 Jan 2024 20:17:29 +0530 Message-Id: <20240109144729.26102-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-GUID: 38MMQMc2tCZ9xTxqaQEs9u4mVVIrzy58 X-Proofpoint-ORIG-GUID: 38MMQMc2tCZ9xTxqaQEs9u4mVVIrzy58 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 priorityscore=1501 mlxscore=0 bulkscore=0 spamscore=0 malwarescore=0 phishscore=0 clxscore=1015 impostorscore=0 suspectscore=0 lowpriorityscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2401090122 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: 1787624639790268764 X-GMAIL-MSGID: 1787624639790268764 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 Reviewed-by: Simon Horman --- 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;