Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp2326168rdd; Fri, 12 Jan 2024 06:24:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IE0Xyo+GWIxHSh9NXqOdHJeMZdZOHtPRpRM6lMJpPgyAwOqGDCSvkPV5fYio0AEssnPsTOI X-Received: by 2002:a9d:4f04:0:b0:6db:c120:2819 with SMTP id d4-20020a9d4f04000000b006dbc1202819mr1814768otl.55.1705069470294; Fri, 12 Jan 2024 06:24:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705069470; cv=none; d=google.com; s=arc-20160816; b=X1JnGqHs8Q4IrQQkYYWKYNVsPd/vbDu/IXz8032qHhz5hWdYbNng7L//+nbkhuBonX EZ5MaOQMVy3IwAq5s9KZN9pstLwpNIbK9KHF6V4fyywUQpFiVpjFZB760nRnpUQ7dBMJ qFI3UPJSZEUAjg9NiNqri8KvLBEP6nIHnfxaFMl47Vh1JQlrxPHO21iSFQI6VD42k4ym F4nOdfDO0TA+9nZ5LMkLETqu6+/MoH23e4wj+t5SRspPKkzbMwGexnU41UMZ7fCPivCL Yl2M5KHlBLQn5D21+BDOzibmDWL+2lhfclTKHTmZUOg0TZzzcNcSw1xPrVBksel555+l czsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=EQEeixSS21OvGRSeYUgmkjCTDJPNCEH8blpRpvwWulo=; fh=t3TklgoSlm2/4MZbuogAzhiaZ561HR3kFygAeMtFlAM=; b=ZEWXyoOtcAwdi/51gkeMZ6aCNYLHw1y3bWVaMkjhT6+lKC7xJjcVjLJQBjAG3tkfmz xV94o2FeS0tocT2arbU8GM77zfGuCWpIOzZILn1dBtxNbSmjrutGACyiBlyiT23xPpA1 qGVlPPKYDUjRcgzgVtKgmnbso5jYEBuzlR1FjuCBHSLV1sgsjoruNq3dOxx4hop5Yg/z tBJVNkGUOvtAFiIALblY+rIOZWMRTwlooLX+fjNlWuE5zTPu24AwQWDOj32g1g4L4qWL i17t4aO9arhzYhRBai1jXt4tGMsp+GodS0MxDUftdqpU+fd8BefCWP2JjwusT2TNDfHv wYYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=E9MySg8r; spf=pass (google.com: domain of linux-kernel+bounces-24737-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24737-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id fe6-20020a056130188600b007ce92136758si505088uab.87.2024.01.12.06.24.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 06:24:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-24737-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=E9MySg8r; spf=pass (google.com: domain of linux-kernel+bounces-24737-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24737-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id F19881C2117D for ; Fri, 12 Jan 2024 14:24:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7672873170; Fri, 12 Jan 2024 14:22:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="E9MySg8r" 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 1975973165; Fri, 12 Jan 2024 14:22:47 +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=quicinc.com Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40CEDXQo017105; Fri, 12 Jan 2024 14:22:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:date:subject:mime-version:content-type :content-transfer-encoding:message-id:references:in-reply-to:to :cc; s=qcppdkim1; bh=EQEeixSS21OvGRSeYUgmkjCTDJPNCEH8blpRpvwWulo =; b=E9MySg8rgLCLwCKtTyphzAZbEvDOsQRv7D667BFQLDoFgSoc3L1Z9SV5bZG y1hdimD5sTau7j5RyoTz1IzLs7lm1FWgeKkt4tOEqEphYqTF2x1cgxhn96+Z+b9u txm9szokaxsyK9mkKlHlOvezFiJ6K7jKEiVlydfKJIWML+iixy0rTJOvP/rKX6Au DGXisaZe8Dz6Lnkaahgy2DQx9cg37hXMYh9yWTMVx73bWLVoP8ITtvYn/Gt/lG5D vXo3MCuKWcqMvI4NhMtmAtY3TeLE/eWDG9mOKJcgbTk/xM14xkwLyWLrDOIDC9GM 0OX2WbItBEOgCOikKsNfV/X2ajA== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vk43xgbcd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 12 Jan 2024 14:22:40 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 40CEMdkj011714 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 12 Jan 2024 14:22:39 GMT Received: from hu-krichai-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Fri, 12 Jan 2024 06:22:32 -0800 From: Krishna chaitanya chundru Date: Fri, 12 Jan 2024 19:52:02 +0530 Subject: [PATCH v6 3/6] PCI: qcom: Add missing icc bandwidth vote for cpu to PCIe path Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-ID: <20240112-opp_support-v6-3-77bbf7d0cc37@quicinc.com> References: <20240112-opp_support-v6-0-77bbf7d0cc37@quicinc.com> In-Reply-To: <20240112-opp_support-v6-0-77bbf7d0cc37@quicinc.com> To: Bjorn Andersson , Konrad Dybcio , Bjorn Helgaas , "Lorenzo Pieralisi" , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Manivannan Sadhasivam , Rob Herring , Johan Hovold , Brian Masney , Georgi Djakov CC: , , , , , , , , "Krishna chaitanya chundru" , X-Mailer: b4 0.13-dev-83828 X-Developer-Signature: v=1; a=ed25519-sha256; t=1705069332; l=3246; i=quic_krichai@quicinc.com; s=20230907; h=from:subject:message-id; bh=9bCFz+lZJI8GM831PH82WVVxMQprMLSvdXOop7GXH9Y=; b=VVi1UDKlo3vYBI49ftq/ntnaqa85Nd9ACeOsUql1Qyhn1zfhXkuysn1molksAB34a4Ikdj5lP xcYuoxaxMocALD1ZQIzg26yuoFAExK7FedsyFCEJchU8+POws8yJeHp X-Developer-Key: i=quic_krichai@quicinc.com; a=ed25519; pk=10CL2pdAKFyzyOHbfSWHCD0X0my7CXxj8gJScmn1FAg= X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: 1rv0c96tkg-QRl0fpOEOdTufjUHDgWAe X-Proofpoint-GUID: 1rv0c96tkg-QRl0fpOEOdTufjUHDgWAe 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_01,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 malwarescore=0 spamscore=0 impostorscore=0 lowpriorityscore=0 bulkscore=0 phishscore=0 priorityscore=1501 mlxlogscore=845 mlxscore=0 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2401120113 CPU-PCIe path consits for registers PCIe BAR space, config space. As there is less access on this path compared to pcie to mem path add minimum vote i.e GEN1x1 bandwidth always. In suspend remove the cpu vote after register space access is done. Fixes: c4860af88d0c ("PCI: qcom: Add basic interconnect support") cc: stable@vger.kernel.org Signed-off-by: Krishna chaitanya chundru --- drivers/pci/controller/dwc/pcie-qcom.c | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c index 11c80555d975..035953f0b6d8 100644 --- a/drivers/pci/controller/dwc/pcie-qcom.c +++ b/drivers/pci/controller/dwc/pcie-qcom.c @@ -240,6 +240,7 @@ struct qcom_pcie { struct phy *phy; struct gpio_desc *reset; struct icc_path *icc_mem; + struct icc_path *icc_cpu; const struct qcom_pcie_cfg *cfg; struct dentry *debugfs; bool suspended; @@ -1372,6 +1373,9 @@ static int qcom_pcie_icc_init(struct qcom_pcie *pcie) if (IS_ERR(pcie->icc_mem)) return PTR_ERR(pcie->icc_mem); + pcie->icc_cpu = devm_of_icc_get(pci->dev, "cpu-pcie"); + if (IS_ERR(pcie->icc_cpu)) + return PTR_ERR(pcie->icc_cpu); /* * Some Qualcomm platforms require interconnect bandwidth constraints * to be set before enabling interconnect clocks. @@ -1381,7 +1385,18 @@ static int qcom_pcie_icc_init(struct qcom_pcie *pcie) */ ret = icc_set_bw(pcie->icc_mem, 0, QCOM_PCIE_LINK_SPEED_TO_BW(1)); if (ret) { - dev_err(pci->dev, "failed to set interconnect bandwidth: %d\n", + dev_err(pci->dev, "failed to set interconnect bandwidth for pcie-mem: %d\n", + ret); + return ret; + } + + /* + * The config space, BAR space and registers goes through cpu-pcie path. + * Set peak bandwidth to single-lane Gen1 for this path all the time. + */ + ret = icc_set_bw(pcie->icc_cpu, 0, QCOM_PCIE_LINK_SPEED_TO_BW(1)); + if (ret) { + dev_err(pci->dev, "failed to set interconnect bandwidth for cpu-pcie: %d\n", ret); return ret; } @@ -1573,7 +1588,7 @@ static int qcom_pcie_suspend_noirq(struct device *dev) */ ret = icc_set_bw(pcie->icc_mem, 0, kBps_to_icc(1)); if (ret) { - dev_err(dev, "Failed to set interconnect bandwidth: %d\n", ret); + dev_err(dev, "Failed to set interconnect bandwidth for pcie-mem: %d\n", ret); return ret; } @@ -1597,6 +1612,12 @@ static int qcom_pcie_suspend_noirq(struct device *dev) pcie->suspended = true; } + /* Remove cpu path vote after all the register access is done */ + ret = icc_set_bw(pcie->icc_cpu, 0, 0); + if (ret) { + dev_err(dev, "failed to set interconnect bandwidth for cpu-pcie: %d\n", ret); + return ret; + } return 0; } @@ -1605,6 +1626,12 @@ static int qcom_pcie_resume_noirq(struct device *dev) struct qcom_pcie *pcie = dev_get_drvdata(dev); int ret; + ret = icc_set_bw(pcie->icc_cpu, 0, QCOM_PCIE_LINK_SPEED_TO_BW(1)); + if (ret) { + dev_err(dev, "failed to set interconnect bandwidth for cpu-pcie: %d\n", ret); + return ret; + } + if (pcie->suspended) { ret = qcom_pcie_host_init(&pcie->pci->pp); if (ret) -- 2.42.0