Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp369300rdd; Tue, 9 Jan 2024 06:48:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IHD56s98R4BxlnoJ45UBcsKLByCTJDZKp9xkhvX0Kcf74lA4YJrSt5mk0Bv0xqvpeZhYq/B X-Received: by 2002:a05:6a20:baa6:b0:199:7db6:1850 with SMTP id fb38-20020a056a20baa600b001997db61850mr2014479pzb.83.1704811700769; Tue, 09 Jan 2024 06:48:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704811700; cv=none; d=google.com; s=arc-20160816; b=L1m7wQSw/U5ckBfTSd/zpeqKNylpZ7WdQtIqCKIDiY0PAoZAX1TVKDRSPSzcbJpmwD QenUEHSi+uYlNauoKwERbtaeVsAqh97lYuwYL3qc26vNI86MpPNdg2GqoYqK6KMl46DO 9z/rsEzeEsLy6L7npkj/tNkiG92Jzql1+ZDYj3PM/QuERcNLkAOWqZ9aqBfib5Qk3VjE lR/sknMSXb8pqwPrGP0MBK0Vee7KN6QFLFvOLkYyCqj9JhRTQWzJ0ioMX0TWSpfZj2KT IVuriJOZFPocIKwOzSALPOvjqeVEduL3hBsHMFOj3jJjFWX0AquPLdzOn9gU7u+4Gy7Q +zrQ== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21013-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id y16-20020a634b10000000b005c6cc61ff0csi1504722pga.152.2024.01.09.06.48.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 06:48:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-21013-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21013-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id F0B3CB229D9 for ; Tue, 9 Jan 2024 14:48:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E23B839AEB; Tue, 9 Jan 2024 14:48:06 +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: 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 --- 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