Received: by 2002:a05:7412:a9a3:b0:f9:327e:43ab with SMTP id o35csp106623rdh; Mon, 18 Dec 2023 05:51:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IHDomA58N8y+HwM1NiCj/cCU7mElQBC5N9KTHUST6qQMHUZw5PtF3iKHbzJssJSlxtEsV5t X-Received: by 2002:a05:6a20:9711:b0:18c:5b3a:1405 with SMTP id hr17-20020a056a20971100b0018c5b3a1405mr18421084pzc.37.1702907472525; Mon, 18 Dec 2023 05:51:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702907472; cv=none; d=google.com; s=arc-20160816; b=iFVfMiBjKe4bFR5ncvwyRxzYWFPUwUaaTJ/s09FuqOgyv14nfu0fvgedwquX9CCwed 6hIXWn2R+iYFByXh3ZFqyridwCG36S8A3BmGRDwr5jD5W4HzisJZTQ1Io+U2jaYxCke0 +B0lXB7IomaLs7IYL3UPhB3uqguU0M9m5KQRwXzjC8XQa1SRBtc49YJkZFU8HxRwiLnc e2V/qmpJSwpszpVb1tYSC2+JyadVg1sbiiNPIY9qCJa1pNNDv21NuDglwrrqInzEKa+O le+kSt49DrDnUiwTz81h+za7DWFKBzMqMcbUvFAz4qNSQx/KZv+X9hyDxRATrQUBCdvE 085g== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3775-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id j11-20020a056a00174b00b006cb88a16f29si17919391pfc.161.2023.12.18.05.51.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 05:51:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-3775-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3775-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 3524E2838E2 for ; Mon, 18 Dec 2023 13:51:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CA2C71D142; Mon, 18 Dec 2023 13:51:01 +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 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, Andrew Halaney Cc: Sneh Shah , 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: List-Subscribe: List-Unsubscribe: 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 --- 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