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: <07994b0e-9735-2f3e-e5c3-a57e2344dbc0@linaro.org>
Date:   Fri, 28 Feb 2020 10:31:26 +0100
From:   Daniel Lezcano <daniel.lezcano@...aro.org>
To:     Anson Huang <anson.huang@....com>,
        "rui.zhang@...el.com" <rui.zhang@...el.com>,
        "amit.kucheria@...durent.com" <amit.kucheria@...durent.com>,
        "robh+dt@...nel.org" <robh+dt@...nel.org>,
        "mark.rutland@....com" <mark.rutland@....com>,
        "shawnguo@...nel.org" <shawnguo@...nel.org>,
        "s.hauer@...gutronix.de" <s.hauer@...gutronix.de>,
        "kernel@...gutronix.de" <kernel@...gutronix.de>,
        "festevam@...il.com" <festevam@...il.com>,
        "catalin.marinas@....com" <catalin.marinas@....com>,
        "will@...nel.org" <will@...nel.org>,
        Leonard Crestez <leonard.crestez@....com>,
        Daniel Baluta <daniel.baluta@....com>,
        "S.j. Wang" <shengjiu.wang@....com>, Peng Fan <peng.fan@....com>,
        Jacky Bai <ping.bai@....com>, Jun Li <jun.li@....com>,
        "bjorn.andersson@...aro.org" <bjorn.andersson@...aro.org>,
        "olof@...om.net" <olof@...om.net>,
        "vkoul@...nel.org" <vkoul@...nel.org>,
        "dinguyen@...nel.org" <dinguyen@...nel.org>,
        "marcin.juszkiewicz@...aro.org" <marcin.juszkiewicz@...aro.org>,
        "linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Cc:     dl-linux-imx <linux-imx@....com>
Subject: Re: [PATCH RESEND 2/4] thermal: imx8mm: Add support for i.MX8MM
 thermal monitoring unit

On 28/02/2020 02:12, Anson Huang wrote:
> Hi, Daniel

[ ... ]

>>> +static int tmu_get_temp(void *data, int *temp) {
>>> +	struct imx8mm_tmu *tmu = data;
>>> +	u32 val;
>>> +
>>> +	/* the temp sensor need about 1ms to finish the measurement */
>>> +	usleep_range(1000, 2000);
>>
>> Why do yo need to force a delay here? If the sensor can not be read more
>> than one time every 1ms, then specify that in the DT switching the polling to
>> the right value, no?
> 
> The polling time(2 seconds) is OK for this case, adding this sleep is to prevent user from reading
> temperature from sysfs interface very frequently like less than 1ms, does it make sense? 

Not really, well except if the user is able to press the keys in less
than 1ms :)

If the userspace writes a polling script reading the temperature in a
busy loop, there is nothing we can do against silly programming :/

However, it could interesting to add a <min polling interval> in the
thermal structure and handle that from the core framework by caching the
last value and return it in case get_temp is called too fast.

-- 
 <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