From: Chanwoo Choi <cwchoi00@gmail.com>
To: Kant Fan <kant@allwinnertech.com>,
myungjoo.ham@samsung.com, kyungmin.park@samsung.com,
cw00.choi@samsung.com, mturquette@ti.com, rjw@rjwysocki.net,
khilman@ti.com
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH v4] PM/devfreq: governor: Add a private governor_data for governor
Date: Sun, 20 Nov 2022 20:50:44 +0900 [thread overview]
Message-ID: <400b9db5-e831-1c60-f47c-905173dd1537@gmail.com> (raw)
In-Reply-To: <20221025072109.64025-1-kant@allwinnertech.com>
On 22. 10. 25. 16:21, Kant Fan wrote:
> The member void *data in the structure devfreq can be overwrite
> by governor_userspace. For example:
> 1. The device driver assigned the devfreq governor to simple_ondemand
> by the function devfreq_add_device() and init the devfreq member
> void *data to a pointer of a static structure devfreq_simple_ondemand_data
> by the function devfreq_add_device().
> 2. The user changed the devfreq governor to userspace by the command
> "echo userspace > /sys/class/devfreq/.../governor".
> 3. The governor userspace alloced a dynamic memory for the struct
> userspace_data and assigend the member void *data of devfreq to
> this memory by the function userspace_init().
> 4. The user changed the devfreq governor back to simple_ondemand
> by the command "echo simple_ondemand > /sys/class/devfreq/.../governor".
> 5. The governor userspace exited and assigned the member void *data
> in the structure devfreq to NULL by the function userspace_exit().
> 6. The governor simple_ondemand fetched the static information of
> devfreq_simple_ondemand_data in the function
> devfreq_simple_ondemand_func() but the member void *data of devfreq was
> assigned to NULL by the function userspace_exit().
> 7. The information of upthreshold and downdifferential is lost
> and the governor simple_ondemand can't work correctly.
>
> The member void *data in the structure devfreq is designed for
> a static pointer used in a governor and inited by the function
> devfreq_add_device(). This patch add an element named governor_data
> in the devfreq structure which can be used by a governor(E.g userspace)
> who want to assign a private data to do some private things.
>
> Fixes: ce26c5bb9569 ("PM / devfreq: Add basic governors")
> Cc: stable@vger.kernel.org # 5.10+
> Reviewed-by: Chanwoo Choi <cwchoi00@gmail.com>
> Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
> Signed-off-by: Kant Fan <kant@allwinnertech.com>
> ---
> drivers/devfreq/devfreq.c | 6 ++----
> drivers/devfreq/governor_userspace.c | 12 ++++++------
> include/linux/devfreq.h | 7 ++++---
> 3 files changed, 12 insertions(+), 13 deletions(-)
>
(snip)
Applied it. Thanks.
--
Best Regards,
Samsung Electronics
Chanwoo Choi
prev parent reply other threads:[~2022-11-20 11:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-25 7:21 Kant Fan
2022-11-20 11:50 ` Chanwoo Choi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=400b9db5-e831-1c60-f47c-905173dd1537@gmail.com \
--to=cwchoi00@gmail.com \
--cc=cw00.choi@samsung.com \
--cc=kant@allwinnertech.com \
--cc=khilman@ti.com \
--cc=kyungmin.park@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mturquette@ti.com \
--cc=myungjoo.ham@samsung.com \
--cc=rjw@rjwysocki.net \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®