From patchwork Tue Jun 25 23:49:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sagar Cheluvegowda X-Patchwork-Id: 13712138 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 78F07C30659 for ; Tue, 25 Jun 2024 23:50:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:CC:To:In-Reply-To:References :Message-ID:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=h6xmPDGCRPL/2GvBe6CxwPI9XXigNbBXpXVWEsb4Grc=; b=q6Wu5H2x126wuMewFYIBwdTe4W GXNnQComeNa0RnLTKTrqsvPYD74+FCvj6yN0VSZ5GPNZ+mX14vTalHq/jzgp3ekT90AUizYXmSlQW kkdYLTn+1nGzB59juuS0GdC8DYypI1bLsHxzAy2QEeDwz9lUj2r22fi8RMjZvfDDJY3oaVR4g062Q fGRQNYDeYvYoqkj9o0yZluSr7s1OO941Uj7R/dR2RVTyUSSpxvBY5sUhnQ3dQEhbiIT0RrtsxGzlW rVH2cvU9XJ31NiSLarnG7kdowVlBV+evviJ6qss1tIuS1umF+yIY5/m01F04f4iMhwRRviRCabyq4 1XwWhgdQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sMFvP-00000004pZr-0aWd; Tue, 25 Jun 2024 23:50:11 +0000 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sMFvE-00000004pXG-3DsU for linux-arm-kernel@lists.infradead.org; Tue, 25 Jun 2024 23:50:03 +0000 Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45PIUQ72017339; Tue, 25 Jun 2024 23:49:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= h6xmPDGCRPL/2GvBe6CxwPI9XXigNbBXpXVWEsb4Grc=; b=iDhdFZUulyz3CqRT xGurLQPUdbPygJ2QxmfAdw4pILjRFYg+GlnGP+fE5wXDWljphT4CzWarK5FbsQv8 fnyn8NYyJzK8s4smS8FI5/h71uohG1CwfWaqcGS4NQ0Rrh2Me112mlv62N+Fb+h5 c8VNha+yi9vW1UyNjrYiCjhccjqUYNSgjgltPI0HJLdrG/6suyXW4qFUGy4xjR2Q q4vxOmw/2TVXNXBlTzlKDjtjz6ZaZ5Um6kKfOisR4o4uOopd4kn0ZCLijxiELveL hSPzCPo4gHHZz47Jzdz1czKK84utLnpCSbmfc+vY/ndxHx5evHP6xxpG0CfLNHwv 9EPeUA== Received: from nasanppmta03.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3ywqw9fkeb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Jun 2024 23:49:43 +0000 (GMT) Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA03.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 45PNnh8j002713 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Jun 2024 23:49:43 GMT Received: from hu-scheluve-lv.qualcomm.com (10.49.16.6) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Tue, 25 Jun 2024 16:49:40 -0700 From: Sagar Cheluvegowda Date: Tue, 25 Jun 2024 16:49:28 -0700 Subject: [PATCH v2 1/3] dt-bindings: net: qcom: ethernet: Add interconnect properties MIME-Version: 1.0 Message-ID: <20240625-icc_bw_voting_from_ethqos-v2-1-eaa7cf9060f0@quicinc.com> References: <20240625-icc_bw_voting_from_ethqos-v2-0-eaa7cf9060f0@quicinc.com> In-Reply-To: <20240625-icc_bw_voting_from_ethqos-v2-0-eaa7cf9060f0@quicinc.com> To: Vinod Koul , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , "Jakub Kicinski" , Paolo Abeni , Maxime Coquelin , Russell King , "Rob Herring" , Krzysztof Kozlowski , "Conor Dooley" , Bhupesh Sharma CC: , Andrew Halaney , Andrew Lunn , , , , , , , Sagar Cheluvegowda X-Mailer: b4 0.13.0 X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01b.na.qualcomm.com (10.47.209.197) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: kvyOs8RU-uKk8_LGIFxOdx637WHntUSr X-Proofpoint-GUID: kvyOs8RU-uKk8_LGIFxOdx637WHntUSr X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-25_18,2024-06-25_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 priorityscore=1501 clxscore=1015 impostorscore=0 mlxscore=0 lowpriorityscore=0 malwarescore=0 mlxlogscore=999 phishscore=0 bulkscore=0 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2406250177 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240625_165001_042098_92699DA1 X-CRM114-Status: GOOD ( 10.33 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add documentation for the interconnect and interconnect-names properties required when voting for AHB and AXI buses. Suggested-by: Andrew Halaney Signed-off-by: Sagar Cheluvegowda Reviewed-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/net/qcom,ethqos.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/devicetree/bindings/net/qcom,ethqos.yaml b/Documentation/devicetree/bindings/net/qcom,ethqos.yaml index 6672327358bc..b7e2644bfb18 100644 --- a/Documentation/devicetree/bindings/net/qcom,ethqos.yaml +++ b/Documentation/devicetree/bindings/net/qcom,ethqos.yaml @@ -63,6 +63,14 @@ properties: dma-coherent: true + interconnects: + maxItems: 2 + + interconnect-names: + items: + - const: axi + - const: ahb + phys: true phy-names: From patchwork Tue Jun 25 23:49:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sagar Cheluvegowda X-Patchwork-Id: 13712139 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 87CA4C2BBCA for ; Tue, 25 Jun 2024 23:50:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:CC:To:In-Reply-To:References :Message-ID:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=iLSbP+R0CEdDhPOE3qNQkMQzAE8hi6whxHCMBFtTT4U=; b=g7deFtscTUncnAuRB8cApac9/5 aDipo54dWguHxVkz1fmqPnlGdUg4253vmNHU3OHK6pkt4Xbhn/T9ob2u4yZpFY1Fw9drpneU7HSa0 i9cp6WoSkpHOsHR7grRbZWH2SFaRC9LoLRzUgwuYAWGDyT7h6321uOC0xlkTCAopGmnBJ+4TuoCJv SXikCRiWmXHxVcsKrpdxhte5OTcqAREzegtHvwaabe4ID3bRoFhg6mhKpE2yfUgc3NDaxZSZsq8wG HWYVLmIk3rb8iu3GpvNaio4bUWoipcYJpiIPgiITuDJ1ZsDMC1ta1RucxoSOQdx1SYxwuy0PuvQy/ RMZHt4YA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sMFvT-00000004pas-48Pc; Tue, 25 Jun 2024 23:50:15 +0000 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sMFvK-00000004pYh-2CF9 for linux-arm-kernel@lists.infradead.org; Tue, 25 Jun 2024 23:50:08 +0000 Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45PH4j51018178; Tue, 25 Jun 2024 23:49:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= iLSbP+R0CEdDhPOE3qNQkMQzAE8hi6whxHCMBFtTT4U=; b=dEBNzrY6uOkJQKkB E/V0wM1W3lW66TGqU2obb1VhS6CE9uPFUKhAIn+AEqaBOoV24YxnCUOOxuSMgM9k 4h8Okhx/r4vw3hAc/OR2N2Wc+l8SVn8ZVlC9/YEUIvxMK1FP2d778+48UfvTltSj cEc2iL9JtU9JT7LgS7AO1kLFIQQgHo1FSOzMUoUFCOh6iZ6GV76Hn5n6k35QHKVu Rb1dV3Y6vJnkzN+Ta5LAWddLDWfQlg4W+T0X8JOddy9dB1ZJjImu+A3GAHlsgXaI iaV57TDKQLc9b4gCQ7dCHdWWXTJRWg/9O7a9Ls6bRpVuiSiAgHtD+x3SSUXIArsM g3Ml3g== Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3ywkyn82e3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Jun 2024 23:49:45 +0000 (GMT) Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA01.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 45PNnh6c004279 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Jun 2024 23:49:43 GMT Received: from hu-scheluve-lv.qualcomm.com (10.49.16.6) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Tue, 25 Jun 2024 16:49:40 -0700 From: Sagar Cheluvegowda Date: Tue, 25 Jun 2024 16:49:29 -0700 Subject: [PATCH v2 2/3] net: stmmac: Add interconnect support MIME-Version: 1.0 Message-ID: <20240625-icc_bw_voting_from_ethqos-v2-2-eaa7cf9060f0@quicinc.com> References: <20240625-icc_bw_voting_from_ethqos-v2-0-eaa7cf9060f0@quicinc.com> In-Reply-To: <20240625-icc_bw_voting_from_ethqos-v2-0-eaa7cf9060f0@quicinc.com> To: Vinod Koul , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , "Jakub Kicinski" , Paolo Abeni , Maxime Coquelin , Russell King , "Rob Herring" , Krzysztof Kozlowski , "Conor Dooley" , Bhupesh Sharma CC: , Andrew Halaney , Andrew Lunn , , , , , , , Sagar Cheluvegowda X-Mailer: b4 0.13.0 X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01b.na.qualcomm.com (10.47.209.197) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: OnJ8A9uhw5moDN0ij_Ka1IdF-RkQ7LyY X-Proofpoint-GUID: OnJ8A9uhw5moDN0ij_Ka1IdF-RkQ7LyY X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-25_18,2024-06-25_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 malwarescore=0 mlxscore=0 impostorscore=0 phishscore=0 lowpriorityscore=0 adultscore=0 mlxlogscore=999 spamscore=0 clxscore=1015 suspectscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2406250177 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240625_165006_739254_1B6AEF05 X-CRM114-Status: GOOD ( 17.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add interconnect support to vote for bus bandwidth based on the current speed of the driver.This change adds support for two different paths - one from ethernet to DDR and the other from Apps to ethernet. Vote from each interconnect client is aggregated and the on-chip interconnect hardware is configured to the most appropriate bandwidth profile. Suggested-by: Andrew Halaney Signed-off-by: Sagar Cheluvegowda --- drivers/net/ethernet/stmicro/stmmac/stmmac.h | 1 + drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 8 ++++++++ drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 12 ++++++++++++ include/linux/stmmac.h | 2 ++ 4 files changed, 23 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h index b23b920eedb1..56a282d2b8cd 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index b3afc7cb7d72..ec7c61ee44d4 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -985,6 +985,12 @@ static void stmmac_fpe_link_state_handle(struct stmmac_priv *priv, bool is_up) } } +static void stmmac_set_icc_bw(struct stmmac_priv *priv, unsigned int speed) +{ + icc_set_bw(priv->plat->axi_icc_path, Mbps_to_icc(speed), Mbps_to_icc(speed)); + icc_set_bw(priv->plat->ahb_icc_path, Mbps_to_icc(speed), Mbps_to_icc(speed)); +} + static void stmmac_mac_link_down(struct phylink_config *config, unsigned int mode, phy_interface_t interface) { @@ -1080,6 +1086,8 @@ static void stmmac_mac_link_up(struct phylink_config *config, if (priv->plat->fix_mac_speed) priv->plat->fix_mac_speed(priv->plat->bsp_priv, speed, mode); + stmmac_set_icc_bw(priv, speed); + if (!duplex) ctrl &= ~priv->hw->link.duplex; else diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index 54797edc9b38..e46c94b643a3 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c @@ -642,6 +642,18 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac) dev_dbg(&pdev->dev, "PTP rate %d\n", plat->clk_ptp_rate); } + plat->axi_icc_path = devm_of_icc_get(&pdev->dev, "axi"); + if (IS_ERR(plat->axi_icc_path)) { + ret = (void *)plat->axi_icc_path; + goto error_hw_init; + } + + plat->ahb_icc_path = devm_of_icc_get(&pdev->dev, "ahb"); + if (IS_ERR(plat->ahb_icc_path)) { + ret = (void *)plat->ahb_icc_path; + goto error_hw_init; + } + plat->stmmac_rst = devm_reset_control_get_optional(&pdev->dev, STMMAC_RESOURCE_NAME); if (IS_ERR(plat->stmmac_rst)) { diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index f92c195c76ed..385f352a0c23 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -283,6 +283,8 @@ struct plat_stmmacenet_data { struct reset_control *stmmac_rst; struct reset_control *stmmac_ahb_rst; struct stmmac_axi *axi; + struct icc_path *axi_icc_path; + struct icc_path *ahb_icc_path; int has_gmac4; int rss_en; int mac_port_sel_speed; From patchwork Tue Jun 25 23:49:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sagar Cheluvegowda X-Patchwork-Id: 13712137 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C071CC2BBCA for ; Tue, 25 Jun 2024 23:50:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:CC:To:In-Reply-To:References :Message-ID:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=O43sibDg+dMXQKePxUuuoJG91U2ze1ldrF9Fvd3uN5g=; b=oziNgIptCPUXYK2vxWQxAgONGW 1I+By+OwprLthSyz4cJcsN69n2S71BtpSVwTKzPL+Jo6hIh6geDoUnJijNVcjy8EAO0HvjBhF+6hv YDGvgpSGo259cv9BBQFdvT9ZBuTqV1I4dP5ddEyvvYwdDGR8ITa+TeZsO1heL5xMo+ert9cNmN8o5 uV8fkVgU+zxev2C0pp5mXWh2Sd1QJwfvzPwUEGKjmd7F/FavXYz3YEXxSQY2ARIj4MxelNLIyCC5F IHh9oO7yWdZCdFQ7+748V6Tl/+mJCmrSV+hOsKClyIDsQ79v78RM/Aq3dBUFE4utJ85HC5oSWjlmZ /w3mtVGA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sMFvL-00000004pZC-1Zrp; Tue, 25 Jun 2024 23:50:07 +0000 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sMFvE-00000004pXH-3LCt for linux-arm-kernel@lists.infradead.org; Tue, 25 Jun 2024 23:50:02 +0000 Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45PG0cu3001505; Tue, 25 Jun 2024 23:49:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= O43sibDg+dMXQKePxUuuoJG91U2ze1ldrF9Fvd3uN5g=; b=ftvZU6DLvDRBPN7t N10UNHO8sZ3Bm+uJwPnTFu8jX9N4yJ5XB7hIgEWYDcfAcBgK8UM5xN5Mppvzroh2 eO8u5mpsi/QFujSUbRbEHmc2OsjhcROSHBGPpinscOGdsWU2dMou6OTVXW5hRjaA 6A3bXlcYbR352BQlrmV1DFLLzCxTjTcU56Bj3n7vnzvdGCWDxqJlIQnsE1fCTDfx qSGWL+mVAuhqPzSBgzWvUBlYOEndfhts6wYWqCXSyzyeWdpgI8RsoFFyzh7aTn91 hrlvfEXK16Z3793LzQcCsrGVOGNnIZ/3OWMYH6ReSFYGSZPXwirle0eaJtqxR2ZV 3pdhnw== Received: from nasanppmta05.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3ywmaf0anf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Jun 2024 23:49:45 +0000 (GMT) Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA05.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 45PNniiG019459 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Jun 2024 23:49:44 GMT Received: from hu-scheluve-lv.qualcomm.com (10.49.16.6) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Tue, 25 Jun 2024 16:49:41 -0700 From: Sagar Cheluvegowda Date: Tue, 25 Jun 2024 16:49:30 -0700 Subject: [PATCH v2 3/3] net: stmmac: Bring down the clocks to lower frequencies when mac link goes down MIME-Version: 1.0 Message-ID: <20240625-icc_bw_voting_from_ethqos-v2-3-eaa7cf9060f0@quicinc.com> References: <20240625-icc_bw_voting_from_ethqos-v2-0-eaa7cf9060f0@quicinc.com> In-Reply-To: <20240625-icc_bw_voting_from_ethqos-v2-0-eaa7cf9060f0@quicinc.com> To: Vinod Koul , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , "Jakub Kicinski" , Paolo Abeni , Maxime Coquelin , Russell King , "Rob Herring" , Krzysztof Kozlowski , "Conor Dooley" , Bhupesh Sharma CC: , Andrew Halaney , Andrew Lunn , , , , , , , Sagar Cheluvegowda X-Mailer: b4 0.13.0 X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01b.na.qualcomm.com (10.47.209.197) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: fm7vUTx5GK8DQoBwG72MZPU5HNOJh1mn X-Proofpoint-GUID: fm7vUTx5GK8DQoBwG72MZPU5HNOJh1mn X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-25_18,2024-06-25_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 suspectscore=0 spamscore=0 bulkscore=0 phishscore=0 malwarescore=0 clxscore=1015 mlxscore=0 lowpriorityscore=0 priorityscore=1501 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2406250176 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240625_165001_026557_84DCDA6A X-CRM114-Status: GOOD ( 12.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When mac link goes down we don't need to mainitain the clocks to operate at higher frequencies, as an optimized solution to save power when the link goes down we are trying to bring down the clocks to the frequencies corresponding to the lowest speed possible. Signed-off-by: Sagar Cheluvegowda --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index ec7c61ee44d4..f0166f0bc25f 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -996,6 +996,9 @@ static void stmmac_mac_link_down(struct phylink_config *config, { struct stmmac_priv *priv = netdev_priv(to_net_dev(config->dev)); + if (priv->plat->fix_mac_speed) + priv->plat->fix_mac_speed(priv->plat->bsp_priv, SPEED_10, mode); + stmmac_mac_set(priv, priv->ioaddr, false); priv->eee_active = false; priv->tx_lpi_enabled = false; @@ -1004,6 +1007,11 @@ static void stmmac_mac_link_down(struct phylink_config *config, if (priv->dma_cap.fpesel) stmmac_fpe_link_state_handle(priv, false); + + stmmac_set_icc_bw(priv, SPEED_10); + + if (priv->plat->fix_mac_speed) + priv->plat->fix_mac_speed(priv->plat->bsp_priv, SPEED_10, mode); } static void stmmac_mac_link_up(struct phylink_config *config,