Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7107805rwb; Mon, 12 Dec 2022 10:07:32 -0800 (PST) X-Google-Smtp-Source: AA0mqf5Rt3eb9i6IrPemwajCiyCi9Qn4zlJZ+QsDmJJ1U+QFvReQL9ZLLgPIHLn20gKzdwau+X4T X-Received: by 2002:a17:90b:35d2:b0:21a:146:13c9 with SMTP id nb18-20020a17090b35d200b0021a014613c9mr17437020pjb.36.1670868452066; Mon, 12 Dec 2022 10:07:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670868452; cv=none; d=google.com; s=arc-20160816; b=Kop+ebbup/YFhdSMFLgce6y64u8dH6OMjbeiZZt0Rt2Zoq7mJJrRae6HU9XckP1OXr 7JYB9Ceq4GfRBVHxnUcKfTYIRfKGbt8pLnRw4hArTk0dFWZys5L9kH9tyG7VYivjFnRC VRlf0QC3+/I/KNnhyYnd11Sm+9A783De6zQ5ccX3UKjgdIW6IddA3CjqupD50Sfi3ogm 8ebMYwMGdI5xNF5gJa8BT8fHUmZczZB9zt2WaGdXq8NDur1hDP+N3+E+p0Bx7+5BxQpy QDMKAhdpWbXd8ttQl6zSeyfVgHyZwrvQCyVMXuRMNeSv57KCcZi4Qrwvj3n0lsbuKE6S Im2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=FQ/6lTyzpPWte9JtTBRaMG+LrtODMsTmst64lvQGnHc=; b=Is4KZZjTcqd8lrZKgeltS4g9p6C958VmF5MGPEg2LCf/vsqBPxVATN2vdmux+SeoaI uljq7dRqlh/xZufKXweqMm6bvGU+LsZQbt9wKDuN8Em9MjUvtns+AsD+zNnXPXFFqaS4 mMpM8ZGi4CBciOefmeSV+VtyV7svZ7Mbw+32IsDxJGB0mrAlVo93WmzOAVCXc/9tlHEp poUE1wH5dnCjbw6SC9ozizcQy8HQUTQM6DIgSvhFdonx1U8VVXmNfrJO4WRJ6AzffWk0 rTXdp4rb8IWvUJAgALW0DnDcCN1sKNdEwENyNDjSD9weSHKhZ0APBhXfX6Rgyd4EXb3E itPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=PqmQlOPl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b10-20020a17090a800a00b0021872a7d873si9991201pjn.57.2022.12.12.10.07.22; Mon, 12 Dec 2022 10:07:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=PqmQlOPl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232679AbiLLRuF (ORCPT + 75 others); Mon, 12 Dec 2022 12:50:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232100AbiLLRuD (ORCPT ); Mon, 12 Dec 2022 12:50:03 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44802BB9; Mon, 12 Dec 2022 09:50:02 -0800 (PST) Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BCGkQKh028589; Mon, 12 Dec 2022 17:49:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=FQ/6lTyzpPWte9JtTBRaMG+LrtODMsTmst64lvQGnHc=; b=PqmQlOPlFdC6m5x3UbHIGMfoOIqpRaXdyYzj1vRVn2Lg+ey/LITk9grsR5vTtLf14rx8 BvoJVwTPc9/bo91k1oiGN2+lKZpWkX5ZjbsuajT4MBorzN2Mko5kVD1pyyKxvD4CQECk NrqBem9UTOgEE1Vb+DIHZM3/FfEj7dYXxDYSDIzeKixIn8dCafoWRxqfnXw+Ap4NCkwA Vdbslq8qEiUKKZ0tB1sPiMcz7jyNcIvB32Ti2a5C4d5dBJxZptZpl5kQM9OMO5tDPgWA 1gfZK0TqfhFKvQBQb8UcRSJeEcgmDmZ1GBhFTWMMUtFpQ9M/wpHa4UZfoWi9SP/7WKN5 6w== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3me83sg6fh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 12 Dec 2022 17:49:50 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 2BCHnnOH013750 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 12 Dec 2022 17:49:49 GMT Received: from [10.216.43.29] (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.986.36; Mon, 12 Dec 2022 09:49:43 -0800 Message-ID: <1be71e47-fba3-4795-6950-de3229961215@quicinc.com> Date: Mon, 12 Dec 2022 23:19:40 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 Subject: Re: [PATCH v7 4/6] clk: qcom: gpucc-sc7280: Add cx collapse reset support Content-Language: en-US To: Bjorn Andersson CC: Ulf Hansson , freedreno , , , Rob Clark , Stephen Boyd , Dmitry Baryshkov , Philipp Zabel , Douglas Anderson , , Andy Gross , Konrad Dybcio , Michael Turquette , Stephen Boyd , , References: <1664960824-20951-1-git-send-email-quic_akhilpo@quicinc.com> <20221005143618.v7.4.I5e64ff4b77bb9079eb2edeea8a02585c9e76778f@changeid> <76812eb1-ef4a-48b3-7b7a-231adc8c7c36@quicinc.com> <20221208210929.capfm7jaltxvgpvq@builder.lan> From: Akhil P Oommen In-Reply-To: <20221208210929.capfm7jaltxvgpvq@builder.lan> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] 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-GUID: 6k1emu0vcrTAQxsOXaRZ37Xmbmw3ybeD X-Proofpoint-ORIG-GUID: 6k1emu0vcrTAQxsOXaRZ37Xmbmw3ybeD X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-12_02,2022-12-12_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 mlxscore=0 mlxlogscore=999 bulkscore=0 suspectscore=0 clxscore=1015 spamscore=0 lowpriorityscore=0 malwarescore=0 adultscore=0 phishscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212120161 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/9/2022 2:39 AM, Bjorn Andersson wrote: > On Thu, Dec 08, 2022 at 08:54:39PM +0530, Akhil P Oommen wrote: >> On 12/7/2022 9:16 PM, Ulf Hansson wrote: >>> On Wed, 5 Oct 2022 at 11:08, Akhil P Oommen wrote: >>>> Allow a consumer driver to poll for cx gdsc collapse through Reset >>>> framework. >>> Would you mind extending this commit message, to allow us to better >>> understand what part is really the consumer part. >> Sure. I can do that. >>> I was expecting the consumer part to be the GPU (adreno) driver, but I >>> may have failed to understand correctly. It would be nice to see an >>> example of a typical sequence, where the reset is being >>> asserted/deasserted, from the consumer point of view. Would you mind >>> explaining this a bit more? >> https://elixir.bootlin.com/linux/v6.1-rc8/source/drivers/gpu/drm/msm/adreno/a6xx_gpu.c#L1309 >> You are correct. The consumer is adreno gpu driver. When there is a gpu fault, these sequences are followed: >> 1. drop pm_runtime_put() for gpu device which will drops its vote on 'cx' genpd. line: 1306 >> 2. At this point, there could be vote from either smmu driver (smmu is under same power domain too) or from other subsystems (tz/hyp). > Can you confirm that this is happening completely independent of what > the kernel does? Yes, it is independent. > >> 3. So we call into gdsc driver through reset interface to poll the gdsc register to ensure it collapsed at least once. Line: 1309 > I other words, if we engineered 1. such that it would wait in > gdsc_disable() until the condition for 3. is reached, that should work > for you? (Obviously depending on the ability for us to engineer this...) Yes, it will work. -Akhil. > > Regards, > Bjorn > >> 4. Then we turn ON gpu. line:1314. >> >> -Akhil. >>>> Signed-off-by: Akhil P Oommen >>>> Reviewed-by: Dmitry Baryshkov >>> Kind regards >>> Uffe >>> >>>> --- >>>> >>>> (no changes since v3) >>>> >>>> Changes in v3: >>>> - Convert 'struct qcom_reset_ops cx_gdsc_reset' to 'static const' (Krzysztof) >>>> >>>> Changes in v2: >>>> - Minor update to use the updated custom reset ops implementation >>>> >>>> drivers/clk/qcom/gpucc-sc7280.c | 10 ++++++++++ >>>> 1 file changed, 10 insertions(+) >>>> >>>> diff --git a/drivers/clk/qcom/gpucc-sc7280.c b/drivers/clk/qcom/gpucc-sc7280.c >>>> index 9a832f2..fece3f4 100644 >>>> --- a/drivers/clk/qcom/gpucc-sc7280.c >>>> +++ b/drivers/clk/qcom/gpucc-sc7280.c >>>> @@ -433,12 +433,22 @@ static const struct regmap_config gpu_cc_sc7280_regmap_config = { >>>> .fast_io = true, >>>> }; >>>> >>>> +static const struct qcom_reset_ops cx_gdsc_reset = { >>>> + .reset = gdsc_wait_for_collapse, >>>> +}; >>>> + >>>> +static const struct qcom_reset_map gpucc_sc7280_resets[] = { >>>> + [GPU_CX_COLLAPSE] = { .ops = &cx_gdsc_reset, .priv = &cx_gdsc }, >>>> +}; >>>> + >>>> static const struct qcom_cc_desc gpu_cc_sc7280_desc = { >>>> .config = &gpu_cc_sc7280_regmap_config, >>>> .clks = gpu_cc_sc7280_clocks, >>>> .num_clks = ARRAY_SIZE(gpu_cc_sc7280_clocks), >>>> .gdscs = gpu_cc_sc7180_gdscs, >>>> .num_gdscs = ARRAY_SIZE(gpu_cc_sc7180_gdscs), >>>> + .resets = gpucc_sc7280_resets, >>>> + .num_resets = ARRAY_SIZE(gpucc_sc7280_resets), >>>> }; >>>> >>>> static const struct of_device_id gpu_cc_sc7280_match_table[] = { >>>> -- >>>> 2.7.4 >>>>