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: 12966443 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 37B4CECAAD5 for ; Mon, 5 Sep 2022 18:57:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=vnwmr5QZGJzXIIY1SUET5nD3OTbLwbulGOF5Bx/6pMs=; b=e69TgpU2Tp5adr 2nfm37zcE7a0r/rrBU42jub8Qge+jKLzLkAh3lV5xjqkl3Jg5kUqqhEX42jGXkQMvhR6I8aKjF0QJ sFLyDQtok0ga4lbmgIe+J4cF2mA4LYaCZc2ff+dP1UbA3cXCW0PlN0K0nSD7hNibC7qz51QJkVR+I Uywt/QBMv2Vwom7j9LQ4kNYnYPy9K+Uf0AZHDPPCtZ+1uEZpI51K2UqhbBGOKQwbZLc8p2rF+yBCL cjYM0Kv7l9duIuAkiYAgLBE9n9M4uUjcWRkCsd6YNRMwYcdJU/dqIRG2F3mbE66tNV9xqSlcY85Tb 1/S0ee1XnxWlEFD642SQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVHGn-008ogq-II; Mon, 05 Sep 2022 18:56:29 +0000 Received: from desiato.infradead.org ([90.155.92.199]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVFvt-007ZwY-7H for linux-arm-kernel@bombadil.infradead.org; Mon, 05 Sep 2022 17:30:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=NET4x4RxN//LkpTQU1F+09NLgubloV7JTbO9k0HaAgY=; b=NUUtPHYQpPF/IOX9YXDo/Cds4J 5tckpUyPmGD+JmNIs+uaKgv2laPUX3tA92zvmoYD2l9N0mDql49dUxUx+cG+WI8grWLQB2uxwFPhs prhPxNlCRGizmAH7VvWs2wa0RS1QIfzhMqVlbyP2fQWB9WjSvPrUxje9pRkiwMiRNCjG/Vi0dtErN koZy/5ZYO5SEFYhcCZVUlzdV48fZk32pIRivru1bbq2nzYIOfXr/Xmdneq+97Pz0ADvlSxDt/SZrA e5cY8ZOe5Ky8/xNAwV22H/BoAAv7PWY639KTinUdKinrDevcMhb16x2Ev2MCPljKjSkfIs8jfZT9F NcRSkzzA==; Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVFhl-009rQU-8W for linux-arm-kernel@lists.infradead.org; Mon, 05 Sep 2022 17:16:22 +0000 Received: by mail-wr1-x42e.google.com with SMTP id b5so12160912wrr.5 for ; Mon, 05 Sep 2022 10:16:12 -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=6jjr03XhZHtmI/9NwRyvcb5wR4j57J4auskLI1KCUX08kZh3hNDKt5nRf8tpsie8oA DbbV5VvD1a771vBu/RC/PHBXmdYoW4/lzJpEcKf6c2mTsKIoseFhqzBDIe8dQgym6sSu UsNB8kPR4EWy49xeo0DATJpyrYvicGHToAvCRE00zxt0p05nGXqp2xNi6Ud13tfSYBZU SS1O+pFmrFgflOnyVXSC/12tiZ601ROzVniY46WyCK06jxDyHK97EzNDihoRM0aq9ft7 eukhsShtDwqT7NzyFn2Zur6yTOPNzAQnTsxavrzAWKH8GcD2YJfWLg6/a4lTdn9gcB0G qJvg== X-Gm-Message-State: ACgBeo2Pl1X/vDSkZZkRyWz2MnTn5QSbO1IlpxM68aVQQAnJB9u9SEMx lEanSUqKSA+EQyvj5apCCPc= 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 Cc: 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, =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= , Viresh Kumar 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220905_181615_486547_A6C12638 X-CRM114-Status: GOOD ( 12.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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); /*