[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <DB3PR0402MB39160BF1E6FDF0990E462708F5E90@DB3PR0402MB3916.eurprd04.prod.outlook.com>
Date: Sat, 29 Feb 2020 03:37:02 +0000
From: Anson Huang <anson.huang@....com>
To: Daniel Lezcano <daniel.lezcano@...aro.org>,
"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
Hi, Daniel
> 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 :/
Make sense😊
>
> 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.
OK, I will resend V2 patch set to remove the sleep in this driver and see if there is
real issue of such corner case, if any issue observed, I will try summit a patch to core
framework later.
Thanks,
Anson
Powered by blists - more mailing lists