From: Yue Hu <zbestahu@gmail.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: rafael.j.wysocki@intel.com,
Daniel Lezcano <daniel.lezcano@linaro.org>,
rui.zhang@intel.com, amit.kucheria@verdurent.com,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
huyue2@yulong.com, zbestahu@163.com
Subject: Re: [PATCH] thermal: sysfs: fall back to vzalloc for cooling device's statistics
Date: Thu, 27 Aug 2020 14:40:13 +0800 [thread overview]
Message-ID: <20200827144013.00004e01.zbestahu@gmail.com> (raw)
In-Reply-To: <20200827062646.adruzyyqq5uzlteq@vireshk-i7>
On Thu, 27 Aug 2020 11:56:46 +0530
Viresh Kumar <viresh.kumar@linaro.org> wrote:
> On 27-08-20, 14:20, Yue Hu wrote:
> > Currenly, drivers/video/backlight does not call thermal_of_cooling_device_register()
> > to register thermal cooling device. The issue happened in msm-4.19 kernel for
> > QCOM/Android platform. Backlight in msm-4.19 kernel will register thermal cooling
> > device as below:
> >
> > +static int bd_cdev_get_max_brightness(struct thermal_cooling_device *cdev,
> > + unsigned long *state)
> > +{
> > + struct backlight_device *bd = (struct backlight_device *)cdev->devdata;
> > +
> > + *state = bd->props.max_brightness;
> > +
> > + return 0;
> > +}
> >
> >
> > +static struct thermal_cooling_device_ops bd_cdev_ops = {
> > + .get_max_state = bd_cdev_get_max_brightness,
> >
> > +static void backlight_cdev_register(struct device *parent,
> > + struct backlight_device *bd)
> > +{
> > + if (of_find_property(parent->of_node, "#cooling-cells", NULL)) {
> > + bd->cdev = thermal_of_cooling_device_register(parent->of_node,
> > + (char *)dev_name(&bd->dev), bd, &bd_cdev_ops);
> >
> > And the bd->props.max_brightness is getting from video/backlight/qcom-wled.c. Maybe
> > the driver should not assign 1024 to states/max_brightness. I'm not sure about it.
> > So i consider to change memory allocation methord. That's the origin of the patch.
>
> Thanks for the details. So this is not about upstream tree, as a rule
> we aren't going to make changes here for any downstream tree.
I at first thought it's a possible issue in upstream tree.
>
> Now coming back to the downstream driver, I also don't see a point in
> returning bd->props.max_brightness as the max number of states there.
> Maybe have 10 states, each occupying bd->props.max_brightness/10
> brightness and so you will end up with 10 states only. But yeah,
> whatever downstream decides on that.
>
Got it.
Thx.
prev parent reply other threads:[~2020-08-27 6:40 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-18 6:30 [PATCH] thermal: sysfs: fall back to vzalloc for cooling device's statistics Yue Hu
2020-08-19 11:05 ` Amit Kucheria
2020-08-19 11:17 ` Amit Kucheria
2020-08-20 2:57 ` Yue Hu
2020-08-24 10:40 ` Daniel Lezcano
2020-08-26 2:13 ` Yue Hu
2020-08-26 9:19 ` Daniel Lezcano
2020-08-27 4:03 ` Yue Hu
2020-08-27 5:14 ` Viresh Kumar
2020-08-27 6:20 ` Yue Hu
2020-08-27 6:26 ` Viresh Kumar
2020-08-27 6:40 ` Yue Hu [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=20200827144013.00004e01.zbestahu@gmail.com \
--to=zbestahu@gmail.com \
--cc=amit.kucheria@verdurent.com \
--cc=daniel.lezcano@linaro.org \
--cc=huyue2@yulong.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael.j.wysocki@intel.com \
--cc=rui.zhang@intel.com \
--cc=viresh.kumar@linaro.org \
--cc=zbestahu@163.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.