lkml.org 
[lkml]   [2020]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH RESEND 2/4] thermal: imx8mm: Add support for i.MX8MM thermal monitoring unit
Date
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

\
 
 \ /
  Last update: 2020-02-29 04:38    [W:0.075 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site