[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAP245DWkd4RvH1y1E17sCEndNY=xs+69EJ-41ecRL_EE0Vnkug@mail.gmail.com>
Date: Tue, 10 Sep 2019 21:31:38 +0530
From: Amit Kucheria <amit.kucheria@...aro.org>
To: Thara Gopinath <thara.gopinath@...aro.org>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-arm-msm <linux-arm-msm@...r.kernel.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
Eduardo Valentin <edubezval@...il.com>,
Andy Gross <agross@...nel.org>,
Stephen Boyd <sboyd@...nel.org>,
Brian Masney <masneyb@...tation.org>,
Marc Gonzalez <marc.w.gonzalez@...e.fr>,
Daniel Lezcano <daniel.lezcano@...aro.org>,
Mark Rutland <mark.rutland@....com>,
Rob Herring <robh+dt@...nel.org>,
Zhang Rui <rui.zhang@...el.com>,
Linux PM list <linux-pm@...r.kernel.org>
Subject: Re: [PATCH v2 15/15] drivers: thermal: tsens: Add interrupt support
Hi Thara,
Thanks for the review. Please find replies below.
On Thu, Aug 29, 2019 at 9:23 AM Thara Gopinath
<thara.gopinath@...aro.org> wrote:
>
> Hi Amit,
>
> On 08/27/2019 08:14 AM, Amit Kucheria wrote:
> > Depending on the IP version, TSENS supports upper, lower, max, min and
> > critical threshold interrupts. We only add support for upper and lower
> > threshold interrupts for now.
> >
> > TSENSv2 has an irq [status|clear|mask] bit tuple for each sensor while
> > earlier versions only have a single bit per sensor to denote status and
> > clear. At each interrupt, we reprogram the new upper and lower threshold
> > in the .set_trip callback.
> >
> > Signed-off-by: Amit Kucheria <amit.kucheria@...aro.org>
> > ---
> > drivers/thermal/qcom/tsens-common.c | 377 ++++++++++++++++++++++++++--
> > drivers/thermal/qcom/tsens-v0_1.c | 11 +
> > drivers/thermal/qcom/tsens-v1.c | 29 +++
> > drivers/thermal/qcom/tsens-v2.c | 13 +
> > drivers/thermal/qcom/tsens.c | 32 ++-
> > drivers/thermal/qcom/tsens.h | 270 ++++++++++++++++----
> > 6 files changed, 669 insertions(+), 63 deletions(-)
> >
> > diff --git a/drivers/thermal/qcom/tsens-common.c b/drivers/thermal/qcom/tsens-common.c
> > index 06b44cfd5eab9..c549f8e1488ba 100644
> > --- a/drivers/thermal/qcom/tsens-common.c
> > +++ b/drivers/thermal/qcom/tsens-common.c
<snip>
Please snip liberally when only replying to a small part of the patch. :-)
> > +
> > + spin_unlock_irqrestore(&priv->ul_lock, flags);
> > +
> > + if (trigger) {
> > + dev_dbg(priv->dev, "[%u] %s: TZ update trigger (%d mC)\n",
> > + hw_id, __func__, temp);
> > + thermal_zone_device_update(priv->sensor[i].tzd,
> > + THERMAL_EVENT_UNSPECIFIED);
> Why not use thermal_notify_framework? Or do you want to loop over all
> registered trips ?
Mainly so we get a driver call-back to set_trips where we might want
to change behaviour once we cross certain thresholds.
> Another comment I have is regarding support for multiple thermal zone.
> It might not be needed now, but presence of the same sensor can serve
> multiple zones (one for cooling and one for warming) . I am not sure if
> you want to put some infrastructure in place for that as well for
> interrupt handling.
It is premature to add such infrastructure to the driver until we
decide how we're going to implement support for this, IMO.
<snip>
Powered by blists - more mailing lists