[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <152936452512.16708.5405608343995548468@swboyd.mtv.corp.google.com>
Date: Mon, 18 Jun 2018 16:28:45 -0700
From: Stephen Boyd <swboyd@...omium.org>
To: Doug Anderson <dianders@...omium.org>
Cc: Linus Walleij <linus.walleij@...aro.org>,
LKML <linux-kernel@...r.kernel.org>, linux-gpio@...r.kernel.org,
linux-arm-msm@...r.kernel.org,
Bjorn Andersson <bjorn.andersson@...aro.org>
Subject: Re: [PATCH 1/3] pinctrl: msm: Really mask level interrupts to prevent
latching
Quoting Doug Anderson (2018-06-18 15:43:06)
>
> On Mon, Jun 18, 2018 at 1:52 PM, Stephen Boyd <swboyd@...omium.org> wrote:
>
> > + */
> > + if (irqd_get_trigger_type(d) & IRQ_TYPE_LEVEL_MASK) {
> > + val &= ~BIT(g->intr_raw_status_bit);
> > + writel(val, pctrl->regs + g->intr_cfg_reg);
>
> Do you know if it's important to do a 2nd write here, or could this be
> combined with the next writel()?
I haven't tried combining the writes. It felt safer to keep them split
up so that both bits don't toggle at the same time, but I don't know if
it actually matters.
>
> > + }
> > +
> > val &= ~BIT(g->intr_enable_bit);
> > writel(val, pctrl->regs + g->intr_cfg_reg);
> >
> > @@ -647,6 +660,10 @@ static void msm_gpio_irq_unmask(struct irq_data *d)
> > raw_spin_lock_irqsave(&pctrl->lock, flags);
> >
> > val = readl(pctrl->regs + g->intr_cfg_reg);
> > + if (irqd_get_trigger_type(d) & IRQ_TYPE_LEVEL_MASK) {
> > + val |= BIT(g->intr_raw_status_bit);
> > + writel(val, pctrl->regs + g->intr_cfg_reg);
>
> Same question about whether this could be combined with the next
> writel(). ...although I could imagine that the answer might be
> different for mask and unmask.
We probably need someone from qcom side to determine if these can be
combined. I can give it a try and see if anything goes wrong but my
confidence level will only be anecdotal. It's worth a shot.
>
> ...if it can be combined, you can totally get rid of the "if" test and
> always "OR" in the bit, right?
Yes.
Powered by blists - more mailing lists