Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp3509778rwb; Mon, 5 Sep 2022 13:03:58 -0700 (PDT) X-Google-Smtp-Source: AA6agR4xZ/rOE3wL4jnT9RHDsWkXeyT7dD1verVJO5FkrOtNaYwLEcqSxmWkyj8op1ROGuDj5M67 X-Received: by 2002:a17:906:730d:b0:73d:c8a1:a6ae with SMTP id di13-20020a170906730d00b0073dc8a1a6aemr37936324ejc.540.1662408238257; Mon, 05 Sep 2022 13:03:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662408238; cv=none; d=google.com; s=arc-20160816; b=cDb++g9sBR6qBASr3y3Pyx+9i5XIgc6cfmvvQdkQwIuJ63Pf1R9iub7H7Qctq25IH1 W+bXAVIvsgjMLshF0d47hbC4xS7Os1ygW+d6TjwVV8GuLBxwYWBX2ZVyBFQT1V2mbL02 SVmi+nWVbhUi0px34ptoL8OYc2aP6tj6+qYRCOFjQ0nYWPKqFWbM8H4ZcTCzpxnG/e6o GJ0xPVrPO2mPouCLQyK4v9FSh/CmTjCHL8XyoxqxIpj5+8AgQ+OeIYLayfQrEP4bNa+9 5wlT26MDoxPdAqiHIeJdMvHeM7GfgsQgnmGU0gz/yoWj9kZKWnUtB5UEsvTb652QqcT4 JXMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=7sK3Pxg5lI33PaTu+416/SIw+tV3vaPUu4gPNzWPobI=; b=AbhRy3lsTxhqrV+08Vf6/V4VaTnpojMi42NQtFoqCPJ7sYjiI9RLHs1photp59wTp0 ER3TVVjblOG19LXbwUk7wN574B0oK/KAGUtZxYvleIV8xMi17PaUSIw8TwoOf1rqbI37 trljWkd/ttGWqs8mQYg/lpy1XwnxAwqXsg8qTBv0NEAYBqbPr1oaSmwbf9ujSGppMU/t j7Hwloq689OFHb7g+qXs0Z1Hg3zQLbQ5WWTKOzc32ttgxBkr/dTxwgFlaN+7TEZAKvib bCvyjIqfll/bdsU/48ZF9FZgG5udC7Sc5M9HurJNjet7SXxggHdCyl87MdNkkLG5m4KG UNPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NH4qlg6Q; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dk6-20020a170906f0c600b007418e2229c8si7076540ejb.521.2022.09.05.13.03.33; Mon, 05 Sep 2022 13:03:58 -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=@gmail.com header.s=20210112 header.b=NH4qlg6Q; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231407AbiIETjr (ORCPT + 99 others); Mon, 5 Sep 2022 15:39:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230037AbiIETjo (ORCPT ); Mon, 5 Sep 2022 15:39:44 -0400 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC87113CD1; Mon, 5 Sep 2022 12:39:42 -0700 (PDT) Received: by mail-ed1-x530.google.com with SMTP id 29so7404295edv.2; Mon, 05 Sep 2022 12:39:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date; bh=7sK3Pxg5lI33PaTu+416/SIw+tV3vaPUu4gPNzWPobI=; b=NH4qlg6QZbeqoZj2Tm2AcMxa8dQt6DIOCmBbcpO/afGOmdkHJcxG6jxB6WcHA2zgZr idzdlVtYYBmnO5OjykgPHGjqJguRfUJ8AJ6wuCKJwhP2kPNBb1vbriSXXdqvRGzgOK+x 7QRwxQ2ZxFvWz+99M7MaMNy07R4c5Fk1fLBQ8J5h2tTPuIU5HkUIND5fT2SzEfFizdj0 j1qedhwfOykL7oofHK38q0xsLgxlDMDSkanFA5SzEGZZX56RhDeE3JT8Cv1cMeoPxYbE wwtggQukF1Vi9dumdIfhYW5DEjfh+LWhGrMoQIBATY0KhSzp73lDSRCb714AKRbHeeMJ 09+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date; bh=7sK3Pxg5lI33PaTu+416/SIw+tV3vaPUu4gPNzWPobI=; b=Euq7NOmABQG3Az1rB+lBuC/8tE92NdTExf1rHik9aUsNxeiAsuuxbAutl8ZVgXrezq B6jyaABcVmiwg8pVzin4vSpn1q8LHov+6QiliwlwJEocCi2bHsCfoAU4bVO9D9UAhZo+ H836OswkJapWZgb0B8Z/0iP3u+wMSiPeSrCdM+9u8wAHEuJc8EEPBVYilFQsN+45bKq6 MWNNEtVbn/JWgchC3Ju0g2EUKKJFc9ch7gcXntpSiAGBo71Jpu1gj70JC7bc4aU1XsU4 TnYmOvsCBT4XZAo0TSOYAu2ia+6aCy5QVdeTxVr69Eq5q+fq2YMIM58f6n7uRvSVoGtz 5TMw== X-Gm-Message-State: ACgBeo1o9nIZqpV4PsHa4yGY2jFtGVecxVqh4JVLM5eW+ox2qAbVT3Cv W1APIZwLNaHV1fwpX8CKe5M39yRD3/VpPDBbBaFiL4wHqshwQg== X-Received: by 2002:aa7:c610:0:b0:44e:9a0f:753a with SMTP id h16-20020aa7c610000000b0044e9a0f753amr3781906edq.140.1662406781082; Mon, 05 Sep 2022 12:39:41 -0700 (PDT) MIME-Version: 1.0 References: <20220905171601.79284-1-peron.clem@gmail.com> <20220905171601.79284-5-peron.clem@gmail.com> In-Reply-To: From: =?UTF-8?B?Q2zDqW1lbnQgUMOpcm9u?= Date: Mon, 5 Sep 2022 21:39:29 +0200 Message-ID: Subject: Re: [PATCH v3 4/5] drm/panfrost: devfreq: set opp to the recommended one to configure and enable regulator To: Biju Das Cc: Rob Herring , Krzysztof Kozlowski , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Catalin Marinas , Will Deacon , Tomeu Vizoso , Steven Price , Alyssa Rosenzweig , David Airlie , Daniel Vetter , Bjorn Andersson , Shawn Guo , Geert Uytterhoeven , Arnd Bergmann , Marcel Ziswiler , Vinod Koul , Dmitry Baryshkov , Rob Herring , "devicetree@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-sunxi@lists.linux.dev" , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , Viresh Kumar Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Hi, On Mon, 5 Sept 2022 at 20:17, Biju Das wrote: > > Hi, > > Thanks for the patch. > > > Subject: [PATCH v3 4/5] drm/panfrost: devfreq: set opp to the recommend= ed > > one to configure and enable regulator > > > > devm_pm_opp_set_regulators() doesn't enable regulator, which make > > regulator framework switching it off during regulator_late_cleanup(). > > In that case, why not regulator_get()for > Dynamic regulator(non fixed regulator)?? Sorry I don't understand, what do you mean? > > > > > Call dev_pm_opp_set_opp() with the recommend OPP in > > panfrost_devfreq_init() to enable the regulator and avoid any switch of= f > > by regulator_late_cleanup(). > > > > Suggested-by: Viresh Kumar > > Signed-off-by: Cl=C3=A9ment P=C3=A9ron > > --- > > drivers/gpu/drm/panfrost/panfrost_devfreq.c | 8 ++++++++ > > 1 file changed, 8 insertions(+) > > > > diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c > > b/drivers/gpu/drm/panfrost/panfrost_devfreq.c > > index 5110cd9b2425..67b242407156 100644 > > --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c > > +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c > > @@ -131,6 +131,14 @@ int panfrost_devfreq_init(struct panfrost_device > > *pfdev) > > return PTR_ERR(opp); > > > > panfrost_devfreq_profile.initial_freq =3D cur_freq; > > + > > + /* Setup and enable regulator */ > > + ret =3D dev_pm_opp_set_opp(dev, opp); > > + if (ret) { > > + DRM_DEV_ERROR(dev, "Couldn't set recommended OPP\n"); > > + return ret; > > + } > > > FYI, > On RZ/G2L mali gpu, we have fixed regulator and > I was able to do GPU OPP transition without any issues previously. rzg2l-smarc-som.dtsi uses regulator reg_1p1v; which is marked as regulator-always-on; that's why regulator_late_cleanup() doesn't switch it off. Regards, Clement > > root@smarc-rzg2l:~# cat /sys/class/devfreq/11840000.gpu/trans_stat > From : To > : 50000000 62500000 100000000 125000000 200000000 250000000 = 400000000 500000000 time(ms) > * 50000000: 0 0 0 0 0 0 = 0 1 144 > 62500000: 0 0 0 0 0 0 = 0 0 0 > 100000000: 0 0 0 0 0 0 = 0 9 524 > 125000000: 0 0 9 0 0 0 = 0 3 2544 > 200000000: 0 0 0 11 0 0 = 0 46 3304 > 250000000: 1 0 0 0 33 0 = 0 0 7496 > 400000000: 0 0 0 0 16 19 = 0 0 2024 > 500000000: 1 0 0 1 8 15 = 35 0 4032 > Total transition : 208 > > Cheers, > Biju >