[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHLCerPb+TDhgAYmjoO7-r9G+PvqEyfmj_QktaVP5HbkS_wvNw@mail.gmail.com>
Date: Tue, 18 Feb 2020 23:38:00 +0530
From: Amit Kucheria <amit.kucheria@...aro.org>
To: Bjorn Andersson <bjorn.andersson@...aro.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
linux-arm-msm <linux-arm-msm@...r.kernel.org>,
Stephen Boyd <swboyd@...omium.org>, sivaa@...eaurora.org,
Andy Gross <agross@...nel.org>,
Linux PM list <linux-pm@...r.kernel.org>
Subject: Re: [PATCH v4 5/7] drivers: thermal: tsens: Add watchdog support
On Tue, Feb 4, 2020 at 12:12 AM Bjorn Andersson
<bjorn.andersson@...aro.org> wrote:
>
> On Thu 30 Jan 05:27 PST 2020, Amit Kucheria wrote:
>
> > TSENS IP v2.3 onwards adds support for a watchdog to detect if the TSENS
> > HW FSM is stuck. Add support to detect and restart the FSM in the
> > driver. The watchdog is configured by the bootloader, we just enable the
> > watchdog bark as a debug feature in the kernel.
> >
> > Signed-off-by: Amit Kucheria <amit.kucheria@...aro.org>
> > ---
> > drivers/thermal/qcom/tsens-common.c | 43 +++++++++++++++++++++++++++++
> > drivers/thermal/qcom/tsens-v2.c | 10 +++++++
> > drivers/thermal/qcom/tsens.h | 14 ++++++++++
> > 3 files changed, 67 insertions(+)
> >
> > diff --git a/drivers/thermal/qcom/tsens-common.c b/drivers/thermal/qcom/tsens-common.c
> > index 9d1594d2f1ed..ee2414f33606 100644
> > --- a/drivers/thermal/qcom/tsens-common.c
> > +++ b/drivers/thermal/qcom/tsens-common.c
> > @@ -377,6 +377,26 @@ irqreturn_t tsens_critical_irq_thread(int irq, void *data)
> > struct tsens_irq_data d;
> > unsigned long flags;
> > int temp, ret, i;
> > + u32 wdog_status, wdog_count;
> > +
> > + if (priv->feat->has_watchdog) {
> > + ret = regmap_field_read(priv->rf[WDOG_BARK_STATUS], &wdog_status);
> > + if (ret)
> > + return ret;
> > +
> > + if (wdog_status) {
> > + /* Clear WDOG interrupt */
> > + regmap_field_write(priv->rf[WDOG_BARK_CLEAR], 1);
> > + regmap_field_write(priv->rf[WDOG_BARK_CLEAR], 0);
> > + ret = regmap_field_read(priv->rf[WDOG_BARK_COUNT], &wdog_count);
> > + if (ret)
> > + return ret;
> > + if (wdog_count)
> > + dev_dbg(priv->dev, "%s: watchdog count: %d\n", __func__, wdog_count);
> > +
> > + return IRQ_HANDLED;
>
> Patch looks good, but would is make sense to fall through and handle
> critical interrupts as well (both in positive and error cases of this
> hunk)?
Yes, it makes sense. I'll remove the return IRQ_HANDLED and add a
comment instead.
> Reviewed-by: Bjorn Andersson <bjorn.andersson@...aro.org>
>
> Regards,
> Bjorn
Powered by blists - more mailing lists