linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anson Huang <anson.huang@nxp.com>
To: Daniel Lezcano <daniel.lezcano@linaro.org>,
	"rui.zhang@intel.com" <rui.zhang@intel.com>,
	"amit.kucheria@verdurent.com" <amit.kucheria@verdurent.com>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"mark.rutland@arm.com" <mark.rutland@arm.com>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	"festevam@gmail.com" <festevam@gmail.com>,
	"catalin.marinas@arm.com" <catalin.marinas@arm.com>,
	"will@kernel.org" <will@kernel.org>,
	Leonard Crestez <leonard.crestez@nxp.com>,
	Daniel Baluta <daniel.baluta@nxp.com>,
	"S.j. Wang" <shengjiu.wang@nxp.com>, Peng Fan <peng.fan@nxp.com>,
	Jacky Bai <ping.bai@nxp.com>, Jun Li <jun.li@nxp.com>,
	"bjorn.andersson@linaro.org" <bjorn.andersson@linaro.org>,
	"olof@lixom.net" <olof@lixom.net>,
	"vkoul@kernel.org" <vkoul@kernel.org>,
	"dinguyen@kernel.org" <dinguyen@kernel.org>,
	"marcin.juszkiewicz@linaro.org" <marcin.juszkiewicz@linaro.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: dl-linux-imx <linux-imx@nxp.com>
Subject: RE: [PATCH RESEND 2/4] thermal: imx8mm: Add support for i.MX8MM thermal monitoring unit
Date: Sat, 29 Feb 2020 03:37:02 +0000	[thread overview]
Message-ID: <DB3PR0402MB39160BF1E6FDF0990E462708F5E90@DB3PR0402MB3916.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <07994b0e-9735-2f3e-e5c3-a57e2344dbc0@linaro.org>

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


  reply	other threads:[~2020-02-29  3:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-20  8:17 [PATCH RESEND 1/4] dt-bindings: thermal: imx8mm-thermal: Add binding doc for i.MX8MM Anson Huang
2020-02-20  8:17 ` [PATCH RESEND 2/4] thermal: imx8mm: Add support for i.MX8MM thermal monitoring unit Anson Huang
2020-02-27 11:07   ` Daniel Lezcano
2020-02-28  1:12     ` Anson Huang
2020-02-28  9:31       ` Daniel Lezcano
2020-02-29  3:37         ` Anson Huang [this message]
2020-02-20  8:17 ` [PATCH RESEND 3/4] arm64: defconfig: Enable CONFIG_IMX8MM_THERMAL as module Anson Huang
2020-02-20  8:17 ` [PATCH RESEND 4/4] arm64: dts: imx8mm: Add thermal zone support Anson Huang
  -- strict thread matches above, loose matches on Subject: below --
2019-10-28  6:03 [PATCH RESEND 1/4] dt-bindings: thermal: imx8mm-thermal: Add binding doc for i.MX8MM Anson Huang
2019-10-28  6:03 ` [PATCH RESEND 2/4] thermal: imx8mm: Add support for i.MX8MM thermal monitoring unit Anson Huang
2019-10-29 10:26   ` Fabio Estevam

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=DB3PR0402MB39160BF1E6FDF0990E462708F5E90@DB3PR0402MB3916.eurprd04.prod.outlook.com \
    --to=anson.huang@nxp.com \
    --cc=amit.kucheria@verdurent.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=catalin.marinas@arm.com \
    --cc=daniel.baluta@nxp.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dinguyen@kernel.org \
    --cc=festevam@gmail.com \
    --cc=jun.li@nxp.com \
    --cc=kernel@pengutronix.de \
    --cc=leonard.crestez@nxp.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=marcin.juszkiewicz@linaro.org \
    --cc=mark.rutland@arm.com \
    --cc=olof@lixom.net \
    --cc=peng.fan@nxp.com \
    --cc=ping.bai@nxp.com \
    --cc=robh+dt@kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=shengjiu.wang@nxp.com \
    --cc=vkoul@kernel.org \
    --cc=will@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).