From patchwork Mon Sep 5 17:16:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= X-Patchwork-Id: 12966891 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 24A1FC38145 for ; Tue, 6 Sep 2022 06:11:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0EC3610E524; Tue, 6 Sep 2022 06:11:28 +0000 (UTC) Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by gabe.freedesktop.org (Postfix) with ESMTPS id 39E6D10E44E for ; Mon, 5 Sep 2022 17:16:13 +0000 (UTC) Received: by mail-wr1-x42e.google.com with SMTP id e20so12119033wri.13 for ; Mon, 05 Sep 2022 10:16:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=NET4x4RxN//LkpTQU1F+09NLgubloV7JTbO9k0HaAgY=; b=dPN1jPhO3Ox1DPE1QeeWh7fFaJiVMYKpZrIWkTLDULG8JKbE0BG12yAZD7LUspmR4c 5L82zH3hO5Cg2erfw//Iou0IjhGaXHrFIgoC9/Bd7LO4sWlc6besZC8bfzIYaxVYMyvX sl4uEY+E81PXs4qkPVQTl9qNHHS68+Qj8PQYP01hmd4MPqOguVyRpNAMjRJ/iedES2uf NONZestwjbNy5HZxctzLKRgZWmkSDKtqdTAJA/2amlzQZaqnvrlOCT4LBPnGYJ2tg27B 8mzBO+i1r7IiZ3NhusdNrP/Fzb0xEKXp/ExoQYRhpQTsRSff+MLQhH13Bo7MZySuc/B9 6MbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=NET4x4RxN//LkpTQU1F+09NLgubloV7JTbO9k0HaAgY=; b=o9/CNNbjAXsy0xEAM664x9zhjHmvQ4EfOwhfsk03k7p91ph26JGurtVFnQR9dDpYXb 6CbM+RUMEWhI8zWkJSuN39YzoA2PJlllacWXxxUNS+WpwWNbYdry6PrwWYIuWaOV4NoB kvOQXKpJlaV5J+3iJ1wuqRCf9zFs5b5pVdILHAisawsgHDBjcx+e6w+oKGDy9SaAA1M0 5SdxOZG86j4xy+pp75/2iMjID9POUcHGDDEiNLJRGCtBpOZxvIX3lSWAX4erVmAULhfX QiBkNlQco+VCZXBW38gz94fMsjbGVLdbICPCREp0r/F3uPMMMVIUZb7AINxMuAOoH0Oh PFpQ== X-Gm-Message-State: ACgBeo2M/asRKfzEA/a2RVyUqAd7kMpUgq6i2CkZZBzRXoTvIhY89e2k ONRx+RpOEeKZ0u22JC7NrMs= X-Google-Smtp-Source: AA6agR58EyV1FL2fPMl6goDeHTg46yXYvXzdF0Scctk5jBM1pIRE9np9mQxUokCZZNVmHaVghq1qfw== X-Received: by 2002:a05:6000:184e:b0:228:bb9d:f98a with SMTP id c14-20020a056000184e00b00228bb9df98amr1987643wri.479.1662398171522; Mon, 05 Sep 2022 10:16:11 -0700 (PDT) Received: from Clement-Blade14.home (2a01cb000c0d3d00995730c36491d21b.ipv6.abo.wanadoo.fr. [2a01:cb00:c0d:3d00:9957:30c3:6491:d21b]) by smtp.gmail.com with ESMTPSA id v22-20020a7bcb56000000b003a5ad7f6de2sm11437072wmj.15.2022.09.05.10.16.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Sep 2022 10:16:11 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: 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 Subject: [PATCH v3 4/5] drm/panfrost: devfreq: set opp to the recommended one to configure and enable regulator Date: Mon, 5 Sep 2022 19:16:00 +0200 Message-Id: <20220905171601.79284-5-peron.clem@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220905171601.79284-1-peron.clem@gmail.com> References: <20220905171601.79284-1-peron.clem@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 06 Sep 2022 06:11:24 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Viresh Kumar , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= , linux-sunxi@lists.linux.dev, linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" devm_pm_opp_set_regulators() doesn't enable regulator, which make regulator framework switching it off during regulator_late_cleanup(). 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(). 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 */ + 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); /*