Linux GPIO subsystem development
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: "Heiko Stübner" <heiko@sntech.de>
Cc: "Brian Norris" <briannorris@chromium.org>,
	"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 18:35:11 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.20.1706271621530.1798@nanos> (raw)
In-Reply-To: <1674651.7QIPUCEQPh@diego>

[-- Attachment #1: Type: text/plain, Size: 1453 bytes --]

On Tue, 27 Jun 2017, Heiko Stübner wrote:
> Am Dienstag, 27. Juni 2017, 15:01:32 CEST schrieb Thomas Gleixner:
> > 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 is a safeguard against the pinmux not being set as "gpio" but some other 
> function, if the irq is requested directly without going through the gpio API. 
> 
> But looking at struct irq_chip and also other pinctrl drivers again, it seems
> the new [0] irq_request_resources might be the way saner place for this.
> Especially as it also prevents the mux-setting from being called more than 
> once.

That'll fail on RT as well because irq_request_resources() is called with
irq_desc->lock held and interrupts disabled.

irq_request_resources() can probably be called without holding desc->lock,
though we need some form of protection against concurrent irq
requests/free. I'll have look into that.

Thanks,

	tglx

  reply	other threads:[~2017-06-27 16:35 UTC|newest]

Thread overview: 18+ 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
2017-06-27 18:07               ` Thomas Gleixner
2017-06-27 13:26           ` Heiko Stübner
2017-06-27 16:35             ` Thomas Gleixner [this message]
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=alpine.DEB.2.20.1706271621530.1798@nanos \
    --to=tglx@linutronix.de \
    --cc=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=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox