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: <20200827142003.000071c1.zbestahu@gmail.com>
Date:   Thu, 27 Aug 2020 14:20:03 +0800
From:   Yue Hu <zbestahu@...il.com>
To:     Viresh Kumar <viresh.kumar@...aro.org>
Cc:     rafael.j.wysocki@...el.com,
        Daniel Lezcano <daniel.lezcano@...aro.org>,
        rui.zhang@...el.com, amit.kucheria@...durent.com,
        linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
        huyue2@...ong.com, zbestahu@....com
Subject: Re: [PATCH] thermal: sysfs: fall back to vzalloc for cooling
 device's statistics

On Thu, 27 Aug 2020 10:44:01 +0530
Viresh Kumar <viresh.kumar@...aro.org> wrote:

> On 27-08-20, 12:03, Yue Hu wrote:
> > Hi Daniel,
> > 
> > Now, i'm just focus on removing the kernel warning based on current code logic.
> > Commit 8ea229511e06 (thermal: Add cooling device's statistics in sysfs) added
> > the thermal statistics by viresh and viresh gived the patch an acknowledgement
> > in anther mail thread. 
> > 
> > Hi viresh,
> > 
> > Could you review the patch again about the question above?  
> 
> Yeah, I Acked it but the questions raised by Daniel are very valid and must be
> answered.

Yes, sure.

> 
> I understand that you only cared about fixing the warning, but maybe we need to
> fix the driver and the warning will go away by itself. If you don't want to do
> it, then someone who is responsible for the driver should do it.

Yes, maybe the patch is not totally correct. maybe the driver has issue. Let's
check the driver firstly.

> 
> Was it the acpi_video.c driver that you got the warning from ? I have added
> Rafael to the email in case that driver needs getting fixed.
> 

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.

Thank you.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ