Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp3928973rwb; Mon, 5 Sep 2022 22:50:20 -0700 (PDT) X-Google-Smtp-Source: AA6agR6RtI7cuYq7mL6sA3mjnhylzge526zmSzBaxZaxb7I0lAC0DeyLhAqW3XW+HBh2/RK8L847 X-Received: by 2002:a63:88c8:0:b0:42b:59d4:ea81 with SMTP id l191-20020a6388c8000000b0042b59d4ea81mr42624051pgd.344.1662443419874; Mon, 05 Sep 2022 22:50:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662443419; cv=none; d=google.com; s=arc-20160816; b=NTtvrSkIUNYU6kuRuFF6/htEQB1wbH1clZARqytQ7zYJx62B6AJPrFy8E/x2I6F88O R5Xrp5Yc6ta9cHcUCU4VHUGGnSyuOU+bcLgpVoWBL8SIHMO4JlGbTUvH094MXSko7Lnr XJ9Qrs2z5RBxKLAgPagrBlc18FaN67iO6EgI+ne5Z9I+ihX0tbV5eDcvTBvB9/nGzxIW DhgW58unrPvGmqhj7mo/mreQ/Nh5ILJu8oHloJV/Fb8DkQqgGLxFPLQEoCA6MEkXwsyE kpc1dJP85z7GOCAnhIJGR2O3QpLKsn/5F90NznQVIf9wG9kIlU2MrcPPjH4ukedAzldY fPxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=8BL6o4IX1wUUdMQMOvYouiU2H1/IxMVvREYC6zLqjSM=; b=Bv0Q+9p9dRVqINztCVxEPoYqxrKbnpXbmfxKJtFw3xwVB8rtLhPGOuAEer/ubYEVqa Xlhabj5KXSWFrmdvl3xMM3OTNtv9+NfHx/6OhR5pIU0t0cGREZ1CT+MSWl0NxwBdepL9 9sNyuo65FRpuwzxus/ilm99GPMXojrhP/hAyM4f4vgC3EHBLoCttyDZzBMD7QeQo7AU8 1tjVbo5n+oDUyETBs4E5YnctdHrwRATr7sQ+6iAegnqAC69t4AZ9tA1u2hQIjYNN286N ydc2Im/d/Vo+Rzh6ZLz9WQwOpCSB1FW/zcQzGWp0c4d8uEs4bDrH7NnU4xg0pLob94B1 R9MQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="TWVCL/xy"; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l3-20020a6542c3000000b0042c70461ea5si12130941pgp.361.2022.09.05.22.50.08; Mon, 05 Sep 2022 22:50:19 -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=@linaro.org header.s=google header.b="TWVCL/xy"; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231913AbiIFFRp (ORCPT + 99 others); Tue, 6 Sep 2022 01:17:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229499AbiIFFRn (ORCPT ); Tue, 6 Sep 2022 01:17:43 -0400 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 539226745D for ; Mon, 5 Sep 2022 22:17:42 -0700 (PDT) Received: by mail-pj1-x102f.google.com with SMTP id p1-20020a17090a2d8100b0020040a3f75eso5378808pjd.4 for ; Mon, 05 Sep 2022 22:17:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date; bh=8BL6o4IX1wUUdMQMOvYouiU2H1/IxMVvREYC6zLqjSM=; b=TWVCL/xy2HDW+mX4jbgIhLGwdV/WxyPA4RoAN/5cH9gLWKElDmudiSt+BLgWyygYUL auKw1A2QkYSevImuO2n+o1XgSBLll2Nco8q4XhnA187HbOc+U5Cp2i67rR50rs/ELzDy NOtzxC8RjpPfc87jCp8e46Po/HF2L2I6nSSJbvvD4JIfQX74pWpHmEYRtB4vJrLGTYca 4ujNx+OlzLtM/0sqxh9DgCzOQT2n5EXHKZTz1lQZ/Fd6ziMtNu6WBBgU06Oqa3MTPYnl hX27qfDSveO7p6PQRACejLid/fnq8hfCpPvh9G5VqGJjnxXq7xfwCNID6B7qc2jqgHMK vsAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date; bh=8BL6o4IX1wUUdMQMOvYouiU2H1/IxMVvREYC6zLqjSM=; b=GDW+90J6JY7Q35qR4UbWVhLH42dSazJGIfQguNTEERWg06CNaPgVRb1e8b031edHuw HLav8dmBaEYElV2qdNDGcU8kaJyLlUEGmCcJgzdMVQ7IC8Bl1FElgzneQGeAgb0kP+R3 1+UAdWzsybCDBTzJzct8H/dnir0VkSMs1sHKlLSCEMH/9APxOJyx0F5PwF7XPXbnoEag 3s7dO6a5FTrIz4KBtRM1goIatfaeJvGvJEyJ1nNYXa6IWYb5LiAWv66K0/KDVX1aBSNy acuZpIVITCY5xeWcacXe6DL2gwYGV1E5UaPtgN367nNaSTqDqK2OZHjxyR35enIYyGHG T5Jg== X-Gm-Message-State: ACgBeo2xoXZhvhKtPgDeXIRLw7tIVScM9JfeSm/0rbdrovx28nTthiq2 H1geiSCV54jG5uPjy2qhdDMrmw== X-Received: by 2002:a17:902:9007:b0:176:9f9d:463 with SMTP id a7-20020a170902900700b001769f9d0463mr10844798plp.32.1662441461799; Mon, 05 Sep 2022 22:17:41 -0700 (PDT) Received: from localhost ([122.171.18.80]) by smtp.gmail.com with ESMTPSA id cp15-20020a170902e78f00b00176ae5c0f38sm3276959plb.178.2022.09.05.22.17.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Sep 2022 22:17:40 -0700 (PDT) Date: Tue, 6 Sep 2022 10:47:38 +0530 From: Viresh Kumar To: =?utf-8?B?Q2zDqW1lbnQgUMOpcm9u?= 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 , Biju Das , 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 Subject: Re: [PATCH v3 4/5] drm/panfrost: devfreq: set opp to the recommended one to configure and enable regulator Message-ID: <20220906051738.doyrdfcas7f5avkp@vireshk-i7> References: <20220905171601.79284-1-peron.clem@gmail.com> <20220905171601.79284-5-peron.clem@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220905171601.79284-5-peron.clem@gmail.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 Your subject is 87 columns long, better to squeeze it a bit. On 05-09-22, 19:16, Cl?ment P?ron wrote: > devm_pm_opp_set_regulators() doesn't enable regulator, which make > regulator framework switching it off during regulator_late_cleanup(). This isn't the normal behavior as it works for everyone at the moment. You need to explain what special you are doing here, because of which you are reaching such a situation. i.e. you are disabling some code that uses GPU ? Please specify exact code so others can reproduce it as well. > Call dev_pm_opp_set_opp() with the recommend OPP in > panfrost_devfreq_init() to enable the regulator and avoid any switch off > by regulator_late_cleanup(). The regulator is already enabled I think at this point by the bootloader. What you are doing here is syncing the state of the hardware with the software, which would disallow disabling of the resource unnecessarily. > Suggested-by: Viresh Kumar > Signed-off-by: Cl?ment P?ron > --- > 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 = cur_freq; > + > + /* Setup and enable regulator */ Similarly here, explain why this is required to be done. > + ret = dev_pm_opp_set_opp(dev, opp); > + if (ret) { > + DRM_DEV_ERROR(dev, "Couldn't set recommended OPP\n"); > + return ret; > + } > + > dev_pm_opp_put(opp); Do this before checking if (ret), so the resource can be freed all the time. > > /* > -- > 2.34.1 -- viresh