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.3 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=ham 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 341A9C433DB for ; Mon, 8 Mar 2021 09:51:08 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id B3888651B9 for ; Mon, 8 Mar 2021 09:51:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B3888651B9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 000A089C54; Mon, 8 Mar 2021 09:51:06 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by gabe.freedesktop.org (Postfix) with ESMTP id C80DB89C54 for ; Mon, 8 Mar 2021 09:51:05 +0000 (UTC) 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 13933D6E; Mon, 8 Mar 2021 01:51:05 -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 7481E3F73C; Mon, 8 Mar 2021 01:51:03 -0800 (PST) Subject: Re: [PATCH v5 3/4] PM / devfreq: panfrost: Use devfreq cooling device registration To: Daniel Lezcano , cwchoi00@gmail.com References: <20210308091646.28096-1-daniel.lezcano@linaro.org> <20210308091646.28096-3-daniel.lezcano@linaro.org> From: Steven Price Message-ID: <59627ba5-2602-73cd-c24c-b6695a4fd650@arm.com> Date: Mon, 8 Mar 2021 09:51:46 +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: <20210308091646.28096-3-daniel.lezcano@linaro.org> Content-Language: en-GB 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: Tomeu Vizoso , linux-pm@vger.kernel.org, David Airlie , linux-kernel@vger.kernel.org, "open list:ARM MALI PANFROST DRM DRIVER" , Alyssa Rosenzweig , lukasz.luba@arm.com Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On 08/03/2021 09:16, Daniel Lezcano wrote: > The devfreq core code is able to register the devfreq device as a > cooling device if the 'is_cooling_device' flag is set in the profile. > > Use this flag and remove the cooling device registering code. > > Tested on rock960. > > Signed-off-by: Daniel Lezcano Reviewed-by: Steven Price > --- > drivers/gpu/drm/panfrost/panfrost_devfreq.c | 14 +------------- > drivers/gpu/drm/panfrost/panfrost_devfreq.h | 3 --- > 2 files changed, 1 insertion(+), 16 deletions(-) > > diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/panfrost/panfrost_devfreq.c > index 56b3f5935703..4d96edf1bc54 100644 > --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c > +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c > @@ -3,7 +3,6 @@ > > #include > #include > -#include > #include > #include > > @@ -80,6 +79,7 @@ static struct devfreq_dev_profile panfrost_devfreq_profile = { > .polling_ms = 50, /* ~3 frames */ > .target = panfrost_devfreq_target, > .get_dev_status = panfrost_devfreq_get_dev_status, > + .is_cooling_device = true, > }; > > int panfrost_devfreq_init(struct panfrost_device *pfdev) > @@ -90,7 +90,6 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev) > struct device *dev = &pfdev->pdev->dev; > struct devfreq *devfreq; > struct opp_table *opp_table; > - struct thermal_cooling_device *cooling; > struct panfrost_devfreq *pfdevfreq = &pfdev->pfdevfreq; > > opp_table = dev_pm_opp_set_regulators(dev, pfdev->comp->supply_names, > @@ -139,12 +138,6 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev) > } > pfdevfreq->devfreq = devfreq; > > - cooling = devfreq_cooling_em_register(devfreq, NULL); > - if (IS_ERR(cooling)) > - DRM_DEV_INFO(dev, "Failed to register cooling device\n"); > - else > - pfdevfreq->cooling = cooling; > - > return 0; > > err_fini: > @@ -156,11 +149,6 @@ void panfrost_devfreq_fini(struct panfrost_device *pfdev) > { > struct panfrost_devfreq *pfdevfreq = &pfdev->pfdevfreq; > > - if (pfdevfreq->cooling) { > - devfreq_cooling_unregister(pfdevfreq->cooling); > - pfdevfreq->cooling = NULL; > - } > - > if (pfdevfreq->opp_of_table_added) { > dev_pm_opp_of_remove_table(&pfdev->pdev->dev); > pfdevfreq->opp_of_table_added = false; > diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.h b/drivers/gpu/drm/panfrost/panfrost_devfreq.h > index db6ea48e21f9..470f5c974703 100644 > --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.h > +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.h > @@ -9,14 +9,11 @@ > > struct devfreq; > struct opp_table; > -struct thermal_cooling_device; > - > struct panfrost_device; > > struct panfrost_devfreq { > struct devfreq *devfreq; > struct opp_table *regulators_opp_table; > - struct thermal_cooling_device *cooling; > bool opp_of_table_added; > > ktime_t busy_time; > _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel