From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0507EC433DB for ; Thu, 14 Jan 2021 15:11:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BFFA623A7F for ; Thu, 14 Jan 2021 15:11:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729211AbhANPLO (ORCPT ); Thu, 14 Jan 2021 10:11:14 -0500 Received: from foss.arm.com ([217.140.110.172]:51262 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725878AbhANPLO (ORCPT ); Thu, 14 Jan 2021 10:11:14 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7A9A3ED1; Thu, 14 Jan 2021 07:10:28 -0800 (PST) Received: from [192.168.1.179] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EEF853F70D; Thu, 14 Jan 2021 07:10:26 -0800 (PST) Subject: Re: [PATCH v10 3/4] drm/panfrost: devfreq: Disable devfreq when num_supplies > 1 To: Nicolas Boichat , Rob Herring , Alyssa Rosenzweig Cc: Tomeu Vizoso , fshao@chromium.org, boris.brezillon@collabora.com, hsinyi@chromium.org, hoegsberg@chromium.org, Daniel Vetter , David Airlie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20210113060703.3122661-1-drinkcat@chromium.org> <20210113140546.v10.3.I3af068abe30c9c85cabc4486385c52e56527a509@changeid> From: Steven Price Message-ID: <495a0ad3-ef01-d4b8-eb1f-e70d55fd7ddf@arm.com> Date: Thu, 14 Jan 2021 15:10:25 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210113140546.v10.3.I3af068abe30c9c85cabc4486385c52e56527a509@changeid> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13/01/2021 06:07, Nicolas Boichat wrote: > GPUs with more than a single regulator (e.g. G72 on MT8183) will > require platform-specific handling for devfreq, for 2 reasons: > 1. The opp core (drivers/opp/core.c:_generic_set_opp_regulator) > does not support multiple regulators, so we'll need custom > handlers. > 2. Generally, platforms with 2 regulators have platform-specific > constraints on how the voltages should be set (e.g. > minimum/maximum voltage difference between them), so we > should not just create generic handlers that simply > change the voltages without taking care of those constraints. > > Disable devfreq for now on those GPUs. > > Signed-off-by: Nicolas Boichat > Reviewed-by: Tomeu Vizoso Thanks for the clarification in the commit message. Reviewed-by: Steven Price > --- > > (no changes since v9) > > Changes in v9: > - Explain why devfreq needs to be disabled for GPUs with >1 > regulators. > > Changes in v8: > - Use DRM_DEV_INFO instead of ERROR > > Changes in v7: > - Fix GPU ID in commit message > > Changes in v6: > - New change > > drivers/gpu/drm/panfrost/panfrost_devfreq.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/panfrost/panfrost_devfreq.c > index f44d28fad085..812cfecdee3b 100644 > --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c > +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c > @@ -92,6 +92,15 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev) > struct thermal_cooling_device *cooling; > struct panfrost_devfreq *pfdevfreq = &pfdev->pfdevfreq; > > + if (pfdev->comp->num_supplies > 1) { > + /* > + * GPUs with more than 1 supply require platform-specific handling: > + * continue without devfreq > + */ > + DRM_DEV_INFO(dev, "More than 1 supply is not supported yet\n"); > + return 0; > + } > + > opp_table = dev_pm_opp_set_regulators(dev, pfdev->comp->supply_names, > pfdev->comp->num_supplies); > if (IS_ERR(opp_table)) { >