Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp106604ybl; Tue, 7 Jan 2020 15:07:46 -0800 (PST) X-Google-Smtp-Source: APXvYqwpHa+IvYy7wfQzbzB9DD9b2B7jdGPMpBxJbFkenJrK52N7jGjBMAwaiGQTYLBIpNoiBHde X-Received: by 2002:a9d:10d:: with SMTP id 13mr1880820otu.149.1578438466328; Tue, 07 Jan 2020 15:07:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578438466; cv=none; d=google.com; s=arc-20160816; b=HoMtuV3RKwUFAt/GwaP+X39DRdjThdJhq/MX0wI/wOA1ZG+c1btpzVlmjoRrOygweC gtfMt2xu0tGGQ7n/7HngUeYxr/ZN/uxv0yc5m36AjA/qfutCJdSH6vKUtvTg6jWft6QW 47b5GtT64tDx7RkAs9uIIL9z6J5ACcK9UJ7pws9gxUi+T7VMK7PMJzZBq/EwE4m1TT6s DYaYcbjzj6+xOh5z4NRlK9qfwl6nKAAns3svJKfTr3k8okoymK6kyNY2GfBX8+mCQMqm e5A7n7+QoxwmdSIn3+o0Zwh9GKO5RQ+kmfNV6jO6c8QN6SViiAOAGCrkxteNpeDABq/l D1IQ== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=TO4ro9G4vD3zIHyJt/0agdTa39l4m1TB7ZW3wf7lrf0=; b=VFedQfAXBNRoNh4atDL2Twtm538bcY6nTbDm1w7ZR1d2l/iCKihIIbLI4H5MRyJUN3 sbDmwv7e+X+al30Z0jPEV7wIoR3JRPO32JtLerA2pG8mjAMmiwR5O2Q++FxWycZwJ9Hd YScJ9CIxEd7st43oCOG/C0BvWYQvrFIfAbCd49IOk4JT7ZQX/loWXHZw1axhceS0VGw4 zXLDMm0o2jsnu/PwUCgcqgZYKHMHaViby4zVhudmMd+WwojIp9THZgz5QCHeEWYuNd1D yGXE/QGhfG0acWfVNvyIAXTxg1zG+wNNHJ86RIL1T9HtQnAugxsdIdFY9nRbuUs63rU7 voGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=ul1VNMWd; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i11si715786otc.105.2020.01.07.15.07.34; Tue, 07 Jan 2020 15:07:46 -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; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=ul1VNMWd; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727539AbgAGXGw (ORCPT + 99 others); Tue, 7 Jan 2020 18:06:52 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:56223 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727158AbgAGXGv (ORCPT ); Tue, 7 Jan 2020 18:06:51 -0500 Received: by mail-wm1-f68.google.com with SMTP id q9so566302wmj.5 for ; Tue, 07 Jan 2020 15:06:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TO4ro9G4vD3zIHyJt/0agdTa39l4m1TB7ZW3wf7lrf0=; b=ul1VNMWdK7uKGRgck+BrFSydL/s/Tw5QhgyBT4DSfsstUAyGpFR/AU4EDOx+DdfG37 Y8hsECeqX1FLtrkERluaTjYnbnoJXVYK/+2+EI5+/5eAvHRVVQ4DZE/GY7QsOi1AZkOy ub87rujVUaGCIcTefUUmY/uIS7J0zxSUrl2apAjNU+xig9grpK5nrGlzUtcthKZCXmYG 24pxMeo/tVCAL9pKLtCC522yVhyRmaYVefxrdeoPOam/uyFSLiQqFAC5CTsp0p/5scnN mOYq06dZzoJlLIMiBr6QKAWbmoYzQpBiIFyWOEaphB465iDqgpqeJ0NY3W0Gi7xJdDCD iDrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TO4ro9G4vD3zIHyJt/0agdTa39l4m1TB7ZW3wf7lrf0=; b=GzflsvFSC1SWAHd5zIxzTt+wxGO8PUEHFFRi/zHFOknNsJmjUWGDRUPt1OcKSY34yo 92hA+shFdn7uJ3F0NmKwevY18PwmQP3eUUmvh9kkO7a7ugJY5JfOdekOPqi7wF2JTfWl 18zkClaV9yw1cM5inoWjuP/Yn1JaUaNfIuHblf5j9lnl0vGROd9BoVoMq/ebm+lFE8H/ kdYfVrwDnInoSMYMv6onYcRGpo6pSZZXZTTc/GPEgW0/7eOG9hB5LGWz42H43h0NFYH/ Xai32Oj9Pt+2XjFAQ8uXgJiBLr2NE8drttqNV9LCM86Xa6r33Oo562mTFEmaKs6ZlNJ4 3rcA== X-Gm-Message-State: APjAAAVf1eNx0y5GkEfZ4B/tkTe7nm5jobNGifvbdHGSCdsbaopWQjPp RVKKz0xM9Thc75deCoaKqDk= X-Received: by 2002:a7b:c5cd:: with SMTP id n13mr597432wmk.172.1578438409183; Tue, 07 Jan 2020 15:06:49 -0800 (PST) Received: from localhost.localdomain (p200300F1373A1900428D5CFFFEB99DB8.dip0.t-ipconnect.de. [2003:f1:373a:1900:428d:5cff:feb9:9db8]) by smtp.googlemail.com with ESMTPSA id g21sm1335912wmh.17.2020.01.07.15.06.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jan 2020 15:06:48 -0800 (PST) From: Martin Blumenstingl To: 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, robin.murphy@arm.com, linux-amlogic@lists.infradead.org, linux-rockchip@lists.infradead.org, Martin Blumenstingl Subject: [PATCH RFT v1 1/3] drm/panfrost: enable devfreq based the "operating-points-v2" property Date: Wed, 8 Jan 2020 00:06:24 +0100 Message-Id: <20200107230626.885451-2-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200107230626.885451-1-martin.blumenstingl@googlemail.com> References: <20200107230626.885451-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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). 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); -- 2.24.1