All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Boyd <swboyd@chromium.org>
To: Doug Anderson <dianders@chromium.org>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-gpio@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	Bjorn Andersson <bjorn.andersson@linaro.org>
Subject: Re: [PATCH 1/3] pinctrl: msm: Really mask level interrupts to prevent latching
Date: Tue, 19 Jun 2018 14:14:37 -0700	[thread overview]
Message-ID: <152944287756.16708.13539547406156946230@swboyd.mtv.corp.google.com> (raw)
In-Reply-To: <CAD=FV=UhfffG__41+5yeiDEdN1DYeTkXEoqasc23fb1YKg9F9Q@mail.gmail.com>

Quoting Doug Anderson (2018-06-18 16:38:27)
> Hi,
> 
> On Mon, Jun 18, 2018 at 4:28 PM, Stephen Boyd <swboyd@chromium.org> wrote:
> > Quoting Doug Anderson (2018-06-18 15:43:06)
> >>
> >> On Mon, Jun 18, 2018 at 1:52 PM, Stephen Boyd <swboyd@chromium.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.
> 
> Maybe I'm a glutton for punishment, but I'd say go for it, unless
> someone from Qualcomm says "no way".
> 
> In the very least in the "unmask" case it seems pretty safe.  IMHO if
> re-enabling the "raw" status caused a glitch we'd already be hitting
> problems.  Specifically the glitch would end up getting latched
> (whee!) and then we'd unmask and see the glitch anyway.
> 
> ...and actually for the "mask" case it seems like you've written it
> the less-safe way anyway.  We know that masking can't cause some sort
> of glitch (since that's the old code), but I guess we don't know
> whether disabling the "raw" status could cause a glitch.  To be the
> absolutely safest you'd do the new disable of the "raw" status _after_
> the old masking.  ...but as per above I'd just go whole hog and
> combine them.  :-P
> 
> As with everything I write, feel free to tell me I'm being stupid and
> I'll try to shut up.  ;-)
> 

I've tested it and it seems to work by combining the writes in mask and
unmask. I will resend it with the combination tomorrow or the next day
in case anyone else has comments on this series.

  reply	other threads:[~2018-06-19 21:14 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-18 20:52 [PATCH 0/3] pinctrl: msm interrupt and muxing fixes Stephen Boyd
2018-06-18 20:52 ` [PATCH 1/3] pinctrl: msm: Really mask level interrupts to prevent latching Stephen Boyd
2018-06-18 22:43   ` Doug Anderson
2018-06-18 23:28     ` Stephen Boyd
2018-06-18 23:38       ` Doug Anderson
2018-06-19 21:14         ` Stephen Boyd [this message]
2018-06-20  6:45   ` Bjorn Andersson
2018-06-20 15:52     ` Doug Anderson
2018-06-21 15:14     ` Stephen Boyd
2018-06-22 17:56       ` Bjorn Andersson
2018-06-18 20:52 ` [PATCH 2/3] pinctrl: msm: Mux out gpio function with gpio_request() Stephen Boyd
2018-06-18 23:54   ` Doug Anderson
2018-06-19 21:18     ` Stephen Boyd
2018-06-19 21:38       ` Doug Anderson
2018-06-20  5:53         ` Stephen Boyd
2018-06-22 17:58   ` Bjorn Andersson
2018-06-22 18:31     ` Bjorn Andersson
2018-06-28 14:25       ` Linus Walleij
2018-06-28 17:14         ` Stephen Boyd
2018-06-28 18:45           ` Doug Anderson
2018-07-02 17:56             ` Stephen Boyd
2018-07-09 13:54               ` Linus Walleij
2018-07-09 15:37                 ` Stephen Boyd
2018-07-13  6:59                   ` Linus Walleij
2018-07-02 19:09           ` Bjorn Andersson
2018-07-06 17:23             ` Stephen Boyd
2018-06-18 20:52 ` [PATCH 3/3] pinctrl: msm: Configure interrupts as input and gpio mode Stephen Boyd
2018-06-19 15:48   ` Doug Anderson

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=152944287756.16708.13539547406156946230@swboyd.mtv.corp.google.com \
    --to=swboyd@chromium.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=dianders@chromium.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.