All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Norris <briannorris@chromium.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: "Heiko Stuebner" <heiko@sntech.de>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	linux-rockchip@lists.infradead.org,
	"Julia Cartwright" <julia@ni.com>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-gpio@vger.kernel.org, "John Keeping" <john@metanate.com>,
	linux-pm@vger.kernel.org, "Doug Anderson" <dianders@chromium.org>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Tony Lindgren" <tony@atomide.com>,
	"David.Wu" <david.wu@rock-chips.com>,
	'黄涛' <huangtao@rock-chips.com>
Subject: Re: [PATCH for 4.12] Revert "pinctrl: rockchip: avoid hardirq-unsafe functions in irq_chip"
Date: Tue, 27 Jun 2017 10:23:09 -0700	[thread overview]
Message-ID: <20170627172306.GA91202@google.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1706271504521.1798@nanos>

Hi Linus,

I'm not sure I follow all of Thomas's suggestions on what should be done
in the future yet, but I agree that can be done in parallel:

On Tue, Jun 27, 2017 at 03:06:26PM +0200, Thomas Gleixner wrote:
> On Tue, 27 Jun 2017, Thomas Gleixner wrote:
> > That aside, looking at the commit which caused this discussion:
> > 
> > 88bb94216f59e pinctrl: rockchip: avoid hardirq-unsafe functions in irq_chip
> > 
> > I assume (the changelog lacks details) that the patch want's to avoid a
> > might sleep splat from the irq callbacks caused by the regmap spinlock,
> > which gets converted into a sleeping lock on RT. It does this by abusing
> > the irq_bus_lock() mechanism, which is wrong to begin with.
> > 
> > The only irq chip function which uses the regmap magic is the
> > irq_set_type() callback. Now, I have a hard time to understand (though I'm
> > no regmap/pinctrl expert) why that regmap stuff needs to be called in the
> > first place. The level and the polarity are programmed via:
> > 
> >         writel_relaxed(level, gc->reg_base + GPIO_INTTYPE_LEVEL);
> >         writel_relaxed(polarity, gc->reg_base + GPIO_INT_POLARITY);
> > 
> > Why needs the regmap machinery to be invoked there? The GPIO is already
> > muxed and configured as interrupt, otherwise none of the irq functions
> > could be invoked. Hmm?
> 
> That said, the commit should be reverted and the issue needs to analyzed
> proper. We still need the RCU -> SCRU conversion, but that's a different
> problem.

Can we consider this an "ack" for the $subject then? Heiko also gave his
approval. How can this get merged? It's running a bit late for 4.12,
though it really shouldn't be risky (at least for non-RT stuff that was
working warning-free already in 4.11), but a 4.13-rc1 with -stable tag
could work as well.

I suppose I didn't put a proper 'Fixes' tag (though it should be obvious
from the commit message), so here goes:

Fixes: 88bb94216f59 ("pinctrl: rockchip: avoid hardirq-unsafe functions in irq_chip")

Regards,
Brian

WARNING: multiple messages have this Message-ID (diff)
From: Brian Norris <briannorris@chromium.org>
To: Thomas Gleixner <tglx@linutronix.de>,
	Linus Walleij <linus.walleij@linaro.org>
Cc: "Heiko Stuebner" <heiko@sntech.de>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	linux-rockchip@lists.infradead.org,
	"Julia Cartwright" <julia@ni.com>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-gpio@vger.kernel.org, "John Keeping" <john@metanate.com>,
	linux-pm@vger.kernel.org, "Doug Anderson" <dianders@chromium.org>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Tony Lindgren" <tony@atomide.com>,
	"David.Wu" <david.wu@rock-chips.com>,
	'黄涛' <huangtao@rock-chips.com>
Subject: Re: [PATCH for 4.12] Revert "pinctrl: rockchip: avoid hardirq-unsafe functions in irq_chip"
Date: Tue, 27 Jun 2017 10:23:09 -0700	[thread overview]
Message-ID: <20170627172306.GA91202@google.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1706271504521.1798@nanos>

Hi Linus,

I'm not sure I follow all of Thomas's suggestions on what should be done
in the future yet, but I agree that can be done in parallel:

On Tue, Jun 27, 2017 at 03:06:26PM +0200, Thomas Gleixner wrote:
> On Tue, 27 Jun 2017, Thomas Gleixner wrote:
> > That aside, looking at the commit which caused this discussion:
> > 
> > 88bb94216f59e pinctrl: rockchip: avoid hardirq-unsafe functions in irq_chip
> > 
> > I assume (the changelog lacks details) that the patch want's to avoid a
> > might sleep splat from the irq callbacks caused by the regmap spinlock,
> > which gets converted into a sleeping lock on RT. It does this by abusing
> > the irq_bus_lock() mechanism, which is wrong to begin with.
> > 
> > The only irq chip function which uses the regmap magic is the
> > irq_set_type() callback. Now, I have a hard time to understand (though I'm
> > no regmap/pinctrl expert) why that regmap stuff needs to be called in the
> > first place. The level and the polarity are programmed via:
> > 
> >         writel_relaxed(level, gc->reg_base + GPIO_INTTYPE_LEVEL);
> >         writel_relaxed(polarity, gc->reg_base + GPIO_INT_POLARITY);
> > 
> > Why needs the regmap machinery to be invoked there? The GPIO is already
> > muxed and configured as interrupt, otherwise none of the irq functions
> > could be invoked. Hmm?
> 
> That said, the commit should be reverted and the issue needs to analyzed
> proper. We still need the RCU -> SCRU conversion, but that's a different
> problem.

Can we consider this an "ack" for the $subject then? Heiko also gave his
approval. How can this get merged? It's running a bit late for 4.12,
though it really shouldn't be risky (at least for non-RT stuff that was
working warning-free already in 4.11), but a 4.13-rc1 with -stable tag
could work as well.

I suppose I didn't put a proper 'Fixes' tag (though it should be obvious
from the commit message), so here goes:

Fixes: 88bb94216f59 ("pinctrl: rockchip: avoid hardirq-unsafe functions in irq_chip")

Regards,
Brian

  reply	other threads:[~2017-06-27 17:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-17 22:56 [4.12 REGRESSION] pinctrl: rockchip: sleeping function called from atomic context Brian Norris
2017-05-27  2:19 ` Brian Norris
2017-06-23 20:59   ` [PATCH for 4.12] Revert "pinctrl: rockchip: avoid hardirq-unsafe functions in irq_chip" Brian Norris
2017-06-23 21:10     ` Heiko Stuebner
2017-06-23 22:12     ` Thomas Gleixner
2017-06-23 22:40       ` Paul E. McKenney
2017-06-24  9:21         ` Thomas Gleixner
2017-06-27  0:06       ` Brian Norris
2017-06-27  6:24         ` Tony Lindgren
2017-06-27  7:07           ` Brian Norris
2017-06-27  7:32             ` Tony Lindgren
2017-06-27 13:01         ` Thomas Gleixner
2017-06-27 13:06           ` Thomas Gleixner
2017-06-27 17:23             ` Brian Norris [this message]
2017-06-27 17:23               ` Brian Norris
2017-06-27 18:07               ` Thomas Gleixner
2017-06-27 13:26           ` Heiko Stübner
2017-06-27 16:35             ` Thomas Gleixner
2017-06-29 13:05     ` Linus Walleij

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=20170627172306.GA91202@google.com \
    --to=briannorris@chromium.org \
    --cc=david.wu@rock-chips.com \
    --cc=dianders@chromium.org \
    --cc=heiko@sntech.de \
    --cc=huangtao@rock-chips.com \
    --cc=john@metanate.com \
    --cc=julia@ni.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=tony@atomide.com \
    /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.