lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <91afb936-71d7-057d-4d66-4a2e41b52332@linaro.org>
Date:   Thu, 4 Mar 2021 17:54:26 +0100
From:   Daniel Lezcano <daniel.lezcano@...aro.org>
To:     Chanwoo Choi <cwchoi00@...il.com>, kyungmin.park@...sung.com,
        myungjoo.ham@...sung.com
Cc:     linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
        Chanwoo Choi <cw00.choi@...sung.com>,
        Qiang Yu <yuq825@...il.com>, David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>,
        Rob Clark <robdclark@...il.com>, Sean Paul <sean@...rly.run>,
        Rob Herring <robh@...nel.org>,
        Tomeu Vizoso <tomeu.vizoso@...labora.com>,
        Steven Price <steven.price@....com>,
        Alyssa Rosenzweig <alyssa.rosenzweig@...labora.com>,
        "open list:DRM DRIVERS FOR LIMA" <dri-devel@...ts.freedesktop.org>,
        "moderated list:DRM DRIVERS FOR LIMA" <lima@...ts.freedesktop.org>,
        "open list:DRM DRIVER FOR MSM ADRENO GPU" 
        <linux-arm-msm@...r.kernel.org>,
        "open list:DRM DRIVER FOR MSM ADRENO GPU" 
        <freedreno@...ts.freedesktop.org>
Subject: Re: [PATCH] devfreq: Register devfreq as a cooling device

On 04/03/2021 16:06, Chanwoo Choi wrote:
> Hi Daniel,
> 
> As Lukasz's comment, actually some devfreq devices like memory bus
> might not affect the thermal critically. In the mainline,
> there are four types devfreq as following:
> 1. GPU
> 2. UFS Storage
> 3. DMC (Memory Controller)
> 4. Memory bus like AMBA AXI
> 
> I think that you can specify this devfreq device will be used
> for cooling device by editing the devfreq_dev_profile structure.

Thanks for the suggestion, it makes sense.

I will do the change following your example below.

  -- Daniel

> diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
> index bf3047896e41..77966a17d03f 100644
> --- a/drivers/devfreq/devfreq.c
> +++ b/drivers/devfreq/devfreq.c
> @@ -935,6 +935,13 @@ struct devfreq *devfreq_add_device(struct device *dev,
> 
>         mutex_unlock(&devfreq_list_lock);
> 
> +       if (devfreq->profile->is_cooling_device) {
> +               devfreq->cdev = devfreq_cooling_em_register(devfreq, NULL);
> +               if (IS_ERR(devfreq->cdev))
> +                       dev_info(dev,
> +                               "Failed to register devfreq cooling
> device\n");
> +       }
> +
>         return devfreq;
> 
>  err_init:
> diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h
> index 26ea0850be9b..26dc69f1047b 100644
> --- a/include/linux/devfreq.h
> +++ b/include/linux/devfreq.h
> @@ -103,6 +103,7 @@ struct devfreq_dev_profile {
>         unsigned long initial_freq;
>         unsigned int polling_ms;
>         enum devfreq_timer timer;
> +       bool is_cooling_device;
> 
>         int (*target)(struct device *dev, unsigned long *freq, u32 flags);
>         int (*get_dev_status)(struct device *dev,
> 



-- 
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ