Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1830296pxb; Fri, 5 Mar 2021 00:14:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJzl6Eg74HMgSLAjOoUjLWdGb4Y5MnfC6N9SjzjGUx49ycwpqCwSWYL6dnGoM6t+bnw9I3RZ X-Received: by 2002:a17:906:380c:: with SMTP id v12mr1255376ejc.65.1614932072712; Fri, 05 Mar 2021 00:14:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614932072; cv=none; d=google.com; s=arc-20160816; b=Aw8yK44MLN5NPHLyvCC9QfmlAkjlimYBngYzKl9247ebFD5ceuc3lwehboCCgmw2Xi BjnbfYkm3RJAW3BnQHDctTKBsNQCF9d/rgtO/th/ABLRYiI0zZsSZIvWfd17MtD1Qgf9 NjxiOqcuD/9qUDDZt2Py33l10i6BmSFUMU7jM7sTZQTWRADuVu8ENGLCCKH0bnQyjDrO 9GmISPOJGu+5pOndY3+J3Ze9WZx3uelb1fJ5QCWuhrnhiJrCMXLsRFYyeT0IYIqzXq2V P3h9/5t9X2IUjwvKoQTJh9OPZRzgG0Me0ftvSjC3mogagp6uSitjZWI9+RNLtRGKkYcy DKxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=rrvyorTHV6v6+PtRzmTOeg356t0ykgpkB/xcqOQzAGY=; b=PcfxlFHh0fDHLfPcotodmEopXuXdVmYsw4pWDLZJWr13Cof7ZwmQuT8YrZRgHZYAy4 OsvCTNVn7NyYny+rJM9lw2SzHCDhnMwTyXTWyvk/PBDXLPf4C684LqUj8T24OxJcPtFF 1WhtFoiIxNHujr9G/rPFNuN62qasmiQTW5YlOSun1uemn12A5f52Q48I168iqCwdIkm6 YX5aG8adCkwCaMj214DygNrId25KLY2Ov7BhWxRBs+Luzj3/WY2tzDIsX/8z5t6aBPVz 4aNxr2SgmzqolFNOYWo32PbCz8YpmSjrgNRln2x8nm/ZJi4tnPt76eSVimrJZCX8gCd5 x5Tw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bi6si1176886edb.419.2021.03.05.00.14.10; Fri, 05 Mar 2021 00:14:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229500AbhCEIMA (ORCPT + 99 others); Fri, 5 Mar 2021 03:12:00 -0500 Received: from foss.arm.com ([217.140.110.172]:49198 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229464AbhCEILl (ORCPT ); Fri, 5 Mar 2021 03:11:41 -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 BCEC9D6E; Fri, 5 Mar 2021 00:11:40 -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 212A63F73B; Fri, 5 Mar 2021 00:11:37 -0800 (PST) Subject: Re: [PATCH] devfreq: Register devfreq as a cooling device To: Daniel Lezcano , cwchoi00@gmail.com, kyungmin.park@samsung.com, myungjoo.ham@samsung.com Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Chanwoo Choi , Qiang Yu , David Airlie , Daniel Vetter , Rob Clark , Sean Paul , Rob Herring , Tomeu Vizoso , Alyssa Rosenzweig , "open list:DRM DRIVERS FOR LIMA" , "moderated list:DRM DRIVERS FOR LIMA" , "open list:DRM DRIVER FOR MSM ADRENO GPU" , "open list:DRM DRIVER FOR MSM ADRENO GPU" References: <20210304125034.28404-1-daniel.lezcano@linaro.org> From: Steven Price Message-ID: <23db1b13-9418-91f5-4871-f45b983f6e3c@arm.com> Date: Fri, 5 Mar 2021 08:12:21 +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: <20210304125034.28404-1-daniel.lezcano@linaro.org> 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 04/03/2021 12:50, Daniel Lezcano wrote: > Currently the default behavior is to manually having the devfreq > backend to register themselves as a devfreq cooling device. > > There are no so many and actually it makes more sense to register the > devfreq device when adding it. > > Consequently, every devfreq becomes a cooling device like cpufreq is. > > Having a devfreq being registered as a cooling device can not mitigate > a thermal zone if it is not bound to this one. Thus, the current > configurations are not impacted by this change. > > Signed-off-by: Daniel Lezcano > --- > drivers/devfreq/devfreq.c | 8 ++++++++ > drivers/gpu/drm/lima/lima_devfreq.c | 13 ------------- > drivers/gpu/drm/lima/lima_devfreq.h | 2 -- > drivers/gpu/drm/msm/msm_gpu.c | 11 ----------- > drivers/gpu/drm/msm/msm_gpu.h | 2 -- > drivers/gpu/drm/panfrost/panfrost_devfreq.c | 13 ------------- > include/linux/devfreq.h | 3 +++ > 7 files changed, 11 insertions(+), 41 deletions(-) > [...] > diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/panfrost/panfrost_devfreq.c > index 56b3f5935703..2cb6300de1f1 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 > > @@ -90,7 +89,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 +137,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 +148,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; You've removed all references to pfdevfreq->cooling, so please also remove the member from struct panfrost_devfreq (as already done with lima and msm). Thanks, Steve