From patchwork Thu Dec 21 03:50:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 181989 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp168675dyi; Wed, 20 Dec 2023 19:53:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IF4YadMK22m39SPFBMGgBPAdf8g+E9qH+JYXKAtYiUsz+hA8J75WZ1uXnV/lA0MgxfmI1UH X-Received: by 2002:a05:6870:e2d2:b0:203:d297:a711 with SMTP id w18-20020a056870e2d200b00203d297a711mr975528oad.66.1703130813206; Wed, 20 Dec 2023 19:53:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703130813; cv=none; d=google.com; s=arc-20160816; b=r++ZY9Ji97J0b7/HMsqYoj2hj17lXRB1VVEdHXPlBkJPMuJT4SPepr2xXyYSCy3cYZ rGyFfdMTk22veWLG3vUdgRNQnxp4awbWDr1I/lo5+h5FPYQzqcBd1hSYg153AJfJsbK9 Cj63aQWq2+0NnYQddNp0Fx1/fXVdJubkE3rZKFYg5F/4YtaoLegeDBHdvQnIVb/K4tZU yciEmFr2ZMr57lKuwA1oSbQ2UpE0soWP2GoCZ6DYoRxY7isbqd2OZiQphd1miHWJn83N 5utznm7/2FoMfD+myljQDLBRX1Wd3KKJKxL4pab7NmMp1mBLg7pKlcNgKkkb1/wA1R2C 2m+w== 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=8cQR0bgH4ekU1zZfVJJ3KFyRZ0SmaEyRsEKEDKifM6g=; fh=foPuD/1Jb/JHGIlIIMSam5lBCF16WurQwdJ9iwCwP6c=; b=PNIKLtKf2NBtrtJcrwhNlDYb5Q1C6EwJXLM10mg20GZJzK1liTf2TPzfOUfduB0WAI kuVmP/31ZCgeOZVeR3pb0CnbiDxrhGYkTgdcZTjQmU9+xtRprqU0mvYqFGFNiOjaGWy+ K7nuR95b1xnZOY6XevBmVR8n+6AzdVwW4JTed+CnUsHGiJK/xFV6rCm+Bp2+LDO5jk1G ywxpGTWjxBR7mT0wdphcqOnZaFgMx5rP9UWgLbXFUGn1FuXaSziZlrTnD+OO7MQGkHoZ Mgnl7rFayU425ih1eFbmNzoXWEHj6ksFRGgA/KLySoy/YmVZHAQcDx5z9ZCNS5VnzIaJ Yu+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=cIGOmNmb; spf=pass (google.com: domain of linux-kernel+bounces-7824-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7824-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d124-20020a633682000000b005cda184c28asi852955pga.204.2023.12.20.19.53.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 19:53:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7824-ouuuleilei=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=cIGOmNmb; spf=pass (google.com: domain of linux-kernel+bounces-7824-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7824-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 224F9B23A12 for ; Thu, 21 Dec 2023 03:53:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 97F2E18E3C; Thu, 21 Dec 2023 03:51:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="cIGOmNmb" X-Original-To: linux-kernel@vger.kernel.org Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 B18D45249; Thu, 21 Dec 2023 03:51: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=quicinc.com Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BL2RrVT028351; Thu, 21 Dec 2023 03:50:51 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=8cQR0bgH4ekU1zZfVJJ3KFyRZ0SmaEyRsEKEDKifM6g =; b=cIGOmNmbN6XzCrkkVLTQPN5FWGFrH2JnS4ODVyoVjJtSy3V1I6gxTlvlfS1 8Cr38029PUj8yW9z7RtTM5pWF/TH54i/28HitCF90mBJqi6b9WJI4FQ6a1gbRIMc Jl0hysktuNC7PQ8vedcxVGaFuGcyqX+kadogK6qy9FY+J99kI+RbHRl0jjSlw+86 N8FKxpC+P2I9Goj5Ro2kdRcn1CCeFYp+3krKi+jbnwZFVKajkkNU99M/YIlouFxi 49L1TEcdbAlyvrQVGUCtsrxoq1r3aMnpZKa4Nv5G/HnxYWKk8jYRddo+SeQTPwb9 MzHIe9mduRka6vxW5Q4vWDaNPlg== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3v3tnw33aq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 21 Dec 2023 03:50:51 +0000 (GMT) Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3BL3oonV011706 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 21 Dec 2023 03:50:50 GMT Received: from [169.254.0.1] (10.49.16.6) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Wed, 20 Dec 2023 19:50:50 -0800 From: Bjorn Andersson Date: Wed, 20 Dec 2023 19:50:36 -0800 Subject: [PATCH 2/8] clk: qcom: gdsc: Enable supply reglator in GPU GX handler Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20231220-sa8295p-gpu-v1-2-d8cdf2257f97@quicinc.com> References: <20231220-sa8295p-gpu-v1-0-d8cdf2257f97@quicinc.com> In-Reply-To: <20231220-sa8295p-gpu-v1-0-d8cdf2257f97@quicinc.com> To: Bjorn Andersson , Konrad Dybcio , Michael Turquette , Stephen Boyd , Rob Herring , "Krzysztof Kozlowski" , Conor Dooley , Taniya Das , Ulf Hansson , Johan Hovold , "Catalin Marinas" , Will Deacon CC: , , , , , , "Bjorn Andersson" X-Mailer: b4 0.12.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1703130649; l=1170; i=quic_bjorande@quicinc.com; s=20230915; h=from:subject:message-id; bh=NRcjjCsDovL9I1ze2bc9Mx0aQssR4APji3KJJF2CHFc=; b=+IIJYZC7MtZAIxx8g+S8H7rfx+fxUQ/rQ/1F9o5CXT11uGqEfmW5vC6m8i11QxyUkdh0etMIcUMz uio/xpvfBuxjbWu7NwmGTrLqPUEXJ1zLkU7lGam7BCiU4Nx16kvD X-Developer-Key: i=quic_bjorande@quicinc.com; a=ed25519; pk=VkhObtljigy9k0ZUIE1Mvr0Y+E1dgBEH9WoLQnUtbIM= X-ClientProxiedBy: nalasex01c.na.qualcomm.com (10.47.97.35) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: msi8icBqaIBCMa-5gcEzsM1rMbyGclam X-Proofpoint-ORIG-GUID: msi8icBqaIBCMa-5gcEzsM1rMbyGclam 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 priorityscore=1501 spamscore=0 impostorscore=0 suspectscore=0 phishscore=0 bulkscore=0 clxscore=1015 mlxlogscore=976 lowpriorityscore=0 adultscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312210025 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785862095743031987 X-GMAIL-MSGID: 1785862095743031987 The GX GDSC is modelled to aid the GMU in powering down the GPU in the event that the GPU crashes, so that it can be restarted again. But in the event that the power-domain is supplied through a dedicated regulator (in contrast to being a subdomin of another power-domain), something needs to turn that regulator on, both to make sure things are powered and to match the operation in gdsc_disable(). Signed-off-by: Bjorn Andersson --- drivers/clk/qcom/gdsc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/clk/qcom/gdsc.c b/drivers/clk/qcom/gdsc.c index 5358e28122ab..d1139c895503 100644 --- a/drivers/clk/qcom/gdsc.c +++ b/drivers/clk/qcom/gdsc.c @@ -557,7 +557,13 @@ void gdsc_unregister(struct gdsc_desc *desc) */ int gdsc_gx_do_nothing_enable(struct generic_pm_domain *domain) { + struct gdsc *sc = domain_to_gdsc(domain); + int ret = 0; + /* Do nothing but give genpd the impression that we were successful */ - return 0; + if (sc->rsupply) + ret = regulator_enable(sc->rsupply); + + return ret; } EXPORT_SYMBOL_GPL(gdsc_gx_do_nothing_enable);