Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp636054ybl; Wed, 8 Jan 2020 03:23:41 -0800 (PST) X-Google-Smtp-Source: APXvYqxFTbPpNwRpe2AIbf4qgrLnKegahgkdGGxZ1ZBbnJICPWt8HbgsAlD71IEhxqqkOCZeFMn5 X-Received: by 2002:a05:6808:9a4:: with SMTP id e4mr2642859oig.127.1578482621447; Wed, 08 Jan 2020 03:23:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578482621; cv=none; d=google.com; s=arc-20160816; b=NM1i4400/lVNehlKgRk00wCcw5Fo+VZm4RzYmubwVETZhYB9nw3Q29Fhl+rmCS25/E ZyqFyN0hkVr8ntmjgr80r7+g1jT94p/d9IkHY+0DARoCOjLianjI6llmFwQwSwYnrDHb d6edrjyMGKljkBkEEimOXSijDmlOl/d4pjWQSqHBHa+NVRKe2k5EDvsB+NElff6ew2m0 3NcIbK/nGqmqzU4ZhxPo5nnMA5D1fWARYXL3nQr2mV5kYgIE/nBSsX8Hhk4G4k56TEWc 9smXCmA30jr+lEQVAv2l/dOnGTKUHYN558nqjP4oEtIgdmCWSOhkKUFBFne7J99FWPV9 peiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=d745aT60771aC/WGjT9sWA7E48imzqCK+drjTuIi9ow=; b=zh5ih/AjE/DnqK9AHgpnr+r77KbiKknx/voP0ENCO/Khk/k1SwlSPaYiNlP4bCuvur 5H9VXfxIPXlzo5pfK6lZ88zp0w5eCl7lFysgecaqar32cBGiDr9nT9sNNH2hqIiPNzSG cvwUH3QMHy4ZqyNF8pxS1iqPIbI2IAJSKp4ipt/7AGaR+n1CsrD8fabAXeLoA0c+yLKD 5U+brAQQo2GW+vls2byZ+u8b0UDi3dmPTIuSC1EQB3p9jmQMw+hWmB59jGGYwgqjYNx6 bFwqy96YXgc0kw2+3HdCjtJRG3bR008V6yK3kMtTLHFcytW2nLCcGVmtBRDpRNNwWmBg At4A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v23si1595233otk.321.2020.01.08.03.23.29; Wed, 08 Jan 2020 03:23:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728183AbgAHLTB (ORCPT + 99 others); Wed, 8 Jan 2020 06:19:01 -0500 Received: from foss.arm.com ([217.140.110.172]:42644 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727795AbgAHLS7 (ORCPT ); Wed, 8 Jan 2020 06:18:59 -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 E4F7630E; Wed, 8 Jan 2020 03:18:58 -0800 (PST) Received: from [10.1.196.37] (e121345-lin.cambridge.arm.com [10.1.196.37]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6F1133F703; Wed, 8 Jan 2020 03:18:57 -0800 (PST) Subject: Re: [PATCH RFT v1 1/3] drm/panfrost: enable devfreq based the "operating-points-v2" property To: Martin Blumenstingl , dri-devel@lists.freedesktop.org, alyssa@rosenzweig.io, steven.price@arm.com, tomeu.vizoso@collabora.com, robh@kernel.org Cc: linux-kernel@vger.kernel.org, daniel@ffwll.ch, airlied@linux.ie, linux-amlogic@lists.infradead.org, linux-rockchip@lists.infradead.org References: <20200107230626.885451-1-martin.blumenstingl@googlemail.com> <20200107230626.885451-2-martin.blumenstingl@googlemail.com> From: Robin Murphy Message-ID: Date: Wed, 8 Jan 2020 11:18:53 +0000 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20200107230626.885451-2-martin.blumenstingl@googlemail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/01/2020 11:06 pm, Martin Blumenstingl wrote: > Decouple the check to see whether we want to enable devfreq for the GPU > from dev_pm_opp_set_regulators(). This is preparation work for adding > back support for regulator control (which means we need to call > dev_pm_opp_set_regulators() before dev_pm_opp_of_add_table(), which > means having a check for "is devfreq enabled" that is not tied to > dev_pm_opp_of_add_table() makes things easier). Hmm, what about cases like the SCMI DVFS protocol where the OPPs are dynamically discovered rather than statically defined in DT? Robin. > Signed-off-by: Martin Blumenstingl > --- > drivers/gpu/drm/panfrost/panfrost_devfreq.c | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/panfrost/panfrost_devfreq.c > index 413987038fbf..1471588763ce 100644 > --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c > +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c > @@ -5,6 +5,7 @@ > #include > #include > #include > +#include > #include > > #include "panfrost_device.h" > @@ -79,10 +80,12 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev) > struct devfreq *devfreq; > struct thermal_cooling_device *cooling; > > - ret = dev_pm_opp_of_add_table(dev); > - if (ret == -ENODEV) /* Optional, continue without devfreq */ > + if (!device_property_present(dev, "operating-points-v2")) > + /* Optional, continue without devfreq */ > return 0; > - else if (ret) > + > + ret = dev_pm_opp_of_add_table(dev); > + if (ret) > return ret; > > panfrost_devfreq_reset(pfdev); >