Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp5153839imw; Tue, 19 Jul 2022 23:06:29 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tWJU7Kqtp6ChYtlrvQfObTjPaihP7MatplgvuBj1TuWZ6tDSTEWIGFjRiY19DzVb6/luIL X-Received: by 2002:a05:6402:5008:b0:437:7f01:82a with SMTP id p8-20020a056402500800b004377f01082amr48964881eda.220.1658297189552; Tue, 19 Jul 2022 23:06:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658297189; cv=none; d=google.com; s=arc-20160816; b=M4CaejKps7xQmtlTmW80kh8aFF1TqbqBTECBK89if9GZocfNL6ortrNI/rInyvYbws tDviHFa8WoYSdDnBH/Pu5On0jUCUmOkror7CJXND9+pj55U8OukjbAnfsLbNZmlQt4VU rEaT7OrpnnJ27JaiRV4hEZtJiA6Gwpvz3NZorbrOL4czFUzOaHK5DjeRnGVffdG2duiN qbPQVrsws3+L4iTMGKZjC7wx142v2NYlgiGYJE/Vus1eeAMuVkz2PTDo0yALcL2E884c en49pzMR3WeAbnbjJ4r0nNpqKhEvQwibPPf8g38PbSdDBJnEzrHPLf68cWzx28ulk7S9 VpeQ== 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=K8/mhv0MjRSe9Bzc9+4/6YLwkZicYPQBjvwzJPEsU7E=; b=FilcOraLLyvQ6eohpEv7hk935Q1NqsOlAMhoOkL54uT36oLAkJIc/nP8AP50Sc6SOW PUCVwF7W96jHeNlKGsCoJohaiXgvsuDucQNjtBZeOCOiNiPRWiwSg/0E9IObSQTAszfu PqS57WU4wI+mowoJCx2CC9ma9pWGYAOwiBRDGR1Fi6CVV4aQCmE8ervYMmAfRj4ankEs ICY72IkZtT4xcq+qP0xIvx8slrwXD+FYSaZtCJ9R6p8CmA9AC0udx3PZRnwmGw7N5HER kIpmTKt+yLrqMBWwAxWddAa0662fLjOkQOvtWUurhmtL3cSD4TPJlCphDtxpm5MUQy/Q 03Ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=cMjwhUVC; 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 cz12-20020a0564021cac00b0043a9e16fb54si19671763edb.77.2022.07.19.23.06.04; Tue, 19 Jul 2022 23:06:29 -0700 (PDT) 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=qcdkim header.b=cMjwhUVC; 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 S238630AbiGTGER (ORCPT + 99 others); Wed, 20 Jul 2022 02:04:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232694AbiGTGEP (ORCPT ); Wed, 20 Jul 2022 02:04:15 -0400 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70E7B6558F; Tue, 19 Jul 2022 23:04:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1658297054; x=1689833054; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=K8/mhv0MjRSe9Bzc9+4/6YLwkZicYPQBjvwzJPEsU7E=; b=cMjwhUVCspgsekra5JkZGb7sAinaZrXck6ty2x0llO/P9lYrGGkzwDxu Mn92QQW9x2jJSeUocTUcG8xUjSsXOWTRLaSSsJl1/6V9qbS2o9LpqmC41 nGsefdh/Z/99D320khBjk+4uY4yYRgcet53ZxFoLWJyzda76EzJplJzEF w=; Received: from ironmsg09-lv.qualcomm.com ([10.47.202.153]) by alexa-out.qualcomm.com with ESMTP; 19 Jul 2022 23:04:14 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg09-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jul 2022 23:04:13 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Tue, 19 Jul 2022 23:04:12 -0700 Received: from [10.216.47.108] (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.22; Tue, 19 Jul 2022 23:04:05 -0700 Message-ID: <698d3279-6a02-9b1e-a3bd-627b6afbc57e@quicinc.com> Date: Wed, 20 Jul 2022 11:34:01 +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: [Freedreno] [PATCH v2 5/7] arm64: dts: qcom: sc7280: Update gpu register list Content-Language: en-US To: Rajendra Nayak , Stephen Boyd , Doug Anderson , Taniya Das CC: , Jonathan Marek , linux-arm-msm , Andy Gross , dri-devel , "Bjorn Andersson" , Rob Herring , Rob Clark , Matthias Kaehlcke , Krzysztof Kozlowski , Jordan Crouse , freedreno , LKML References: <1657346375-1461-1-git-send-email-quic_akhilpo@quicinc.com> <20220709112837.v2.5.I7291c830ace04fce07e6bd95a11de4ba91410f7b@changeid> <0c050434-27ca-1099-d93d-8ad6ace3396e@quicinc.com> From: Akhil P Oommen In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed 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-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, 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 7/19/2022 3:26 PM, Rajendra Nayak wrote: > > > On 7/19/2022 12:49 PM, Stephen Boyd wrote: >> Quoting Akhil P Oommen (2022-07-18 23:37:16) >>> On 7/19/2022 11:19 AM, Stephen Boyd wrote: >>>> Quoting Akhil P Oommen (2022-07-18 21:07:05) >>>>> On 7/14/2022 11:10 AM, Akhil P Oommen wrote: >>>>>> IIUC, qcom gdsc driver doesn't ensure hardware is collapsed since >>>>>> they >>>>>> are vote-able switches. Ideally, we should ensure that the hw has >>>>>> collapsed for gpu recovery because there could be transient votes >>>>>> from >>>>>> other subsystems like hypervisor using their vote register. >>>>>> >>>>>> I am not sure how complex the plumbing to gpucc driver would be >>>>>> to allow >>>>>> gpu driver to check hw status. OTOH, with this patch, gpu driver >>>>>> does a >>>>>> read operation on a gpucc register which is in always-on domain. >>>>>> That >>>>>> means we don't need to vote any resource to access this register. >> >> Reading between the lines here, you're saying that you have to read the >> gdsc register to make sure that the gdsc is in some state? Can you >> clarify exactly what you're doing? And how do you know that something >> else in the kernel can't cause the register to change after it is read? >> It certainly seems like we can't be certain because there is voting >> involved. From gpu driver, cx_gdscr.bit[31] (power off status) register can be polled to ensure that it *collapsed at least once*. We don't need to care if something turns ON gdsc after that. > > yes, this looks like the best case effort to get the gpu to recover, but > the kernel driver really has no control to make sure this condition can > always be met (because it depends on other entities like hyp, > trustzone etc right?) > Why not just put a worst case polling delay? I didn't get you entirely. Where do you mean to keep the polling delay? > >> >>>>>> >>>>>> Stephen/Rajendra/Taniya, any suggestion? >>>> Why can't you assert a gpu reset signal with the reset APIs? This >>>> series >>>> seems to jump through a bunch of hoops to get the gdsc and power >>>> domain >>>> to "reset" when I don't know why any of that is necessary. Can't we >>>> simply assert a reset to the hardware after recovery completes so the >>>> device is back into a good known POR (power on reset) state? >>> That is because there is no register interface to reset GPU CX domain. >>> The recommended sequence from HW design folks is to collapse both cx >>> and >>> gx gdsc to properly reset gpu/gmu. >>> >> >> Ok. One knee jerk reaction is to treat the gdsc as a reset then and >> possibly mux that request along with any power domain on/off so that if >> the reset is requested and the power domain is off nothing happens. >> Otherwise if the power domain is on then it manually sequences and >> controls the two gdscs so that the GPU is reset and then restores the >> enable state of the power domain. It would be fatal to asynchronously pull the plug on CX gdsc forcefully because there might be another gpu/smmu driver thread accessing registers in cx domain. -Akhil.