Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp696532imi; Thu, 21 Jul 2022 09:10:18 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vGinARwDS0ioFTkak0d8sXjbKMP2Fg18kMMroaNE7ILBKzNmzUm9bPHWdkwvwVeAPyH7kx X-Received: by 2002:a81:342:0:b0:31e:5b9b:c04d with SMTP id 63-20020a810342000000b0031e5b9bc04dmr14736394ywd.298.1658419817706; Thu, 21 Jul 2022 09:10:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658419817; cv=none; d=google.com; s=arc-20160816; b=qXJZEOdtUomEMoIR23pl1yVNW2+YDExku92Fbow0f4FhLSObgJenlVTq8m+xBJRl82 6fEiJ6a95ZJc9CvcxBs/lDJfPSPIR5FROCWoVFjkqhsCn1rvHUMXWwNavypTOrT65Grt mXuvh1tRPYVaEnAf5UPGJQX/RfqeYl/gWj6dDw2QevUPkJRZ41l1a7JGz6nlT0d0w5KR cDekcsoksZzn0NmSekEZ+tRQAVeOEnro/eo7+O7hXHc4Rco8j+oLrmaTt4Er7DAVVHzC k7MWhMIuDiaHZ/4LeAP5cUsgt6vwWB2f0lnicADWuuZ8akkxHwtay03SFvyKR/20RzBu JoKg== 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:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=yb4FZU2sS2ec3vg0Ki3FrlpdsmD+gWNYDrl+E3MSovU=; b=KOewRD9avSnmWy197jr4HyOONCBOhyXfP4HCuS1shl+qt38/wFgE1gM2/hrS17ENxM J4rgC4GrW4stNgAnILb1LLFX2RrpJuyW2hBVSmKqo1sftfb4Jp9sEajsM2ddnd31Aj48 q/7qC50lH9ijJdtfu+YYqoOFoUR+E2nSk7tqySuKJXg4rse2b+T8Up2OMJloNS2dTHXb W5o+KN3jnD7UEGtruoyGPZjQnEob47YDeD752EFNBosHkwniwKErqxPMPw/lasWiioAG 5sF0TYvi36Y3A5qjbcXV/OJ6jm5jd25xrSyFVGrGElwNcJjhG4wi0J2T1RYVTN5cN3/D nbJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=ZY3aB3P2; 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 65-20020a250d44000000b0066e2f2ad554si1644281ybn.89.2022.07.21.09.10.02; Thu, 21 Jul 2022 09:10:17 -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=ZY3aB3P2; 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 S229808AbiGUQEt (ORCPT + 99 others); Thu, 21 Jul 2022 12:04:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229588AbiGUQEs (ORCPT ); Thu, 21 Jul 2022 12:04:48 -0400 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B0D387C1C; Thu, 21 Jul 2022 09:04:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1658419488; x=1689955488; h=message-id:date:mime-version:subject:from:to:cc: references:in-reply-to:content-transfer-encoding; bh=yb4FZU2sS2ec3vg0Ki3FrlpdsmD+gWNYDrl+E3MSovU=; b=ZY3aB3P2f9yuLoBzPsOSM/gdwBrHbzoU3YApNen2ILyNBmk0DnUPjG+K wO7PheNIFU9ANpdZU5oGAwZprYOlDDKQCJhymZWm3Z1TQV3jvT5+stLQu fiQFQzWU6YYBTjXWjKVe6XhLw+RUT5x4t7l9yg6W+ysfPoue6HM1W3esh A=; Received: from ironmsg-lv-alpha.qualcomm.com ([10.47.202.13]) by alexa-out.qualcomm.com with ESMTP; 21 Jul 2022 09:04:47 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg-lv-alpha.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jul 2022 09:04:45 -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; Thu, 21 Jul 2022 09:04:45 -0700 Received: from [10.216.44.13] (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; Thu, 21 Jul 2022 09:04:39 -0700 Message-ID: <1e39d008-f8e5-eea5-90f4-78293bf2c580@quicinc.com> Date: Thu, 21 Jul 2022 21:34:35 +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 From: Akhil P Oommen To: Rajendra Nayak , Stephen Boyd , Doug Anderson , Taniya Das , Bjorn Andersson CC: , Jonathan Marek , linux-arm-msm , Andy Gross , dri-devel , 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> <698d3279-6a02-9b1e-a3bd-627b6afbc57e@quicinc.com> In-Reply-To: <698d3279-6a02-9b1e-a3bd-627b6afbc57e@quicinc.com> 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/20/2022 11:34 AM, Akhil P Oommen wrote: > 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. > But, we can move the cx collapse polling to gpucc and expose it to gpu driver using 'reset' framework. I am not very familiar with clk driver, but I did a rough prototype here (untested): https://zerobin.net/?d34b5f958be3b9b8#NKGzdPy9fgcuOqXZ/XqjI7b8JWcivqe+oSTf4yWHSOU= If this approach is acceptable, I will send it out as a separate series. -Akhil.