linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grygorii Strashko <grygorii.strashko@ti.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Alexandre Courbot <gnurou@gmail.com>,
	Santosh Shilimkar <ssantosh@kernel.org>,
	Tony Lindgren <tony@atomide.com>,
	Linux-OMAP <linux-omap@vger.kernel.org>,
	Austin Schuh <austin@peloton-tech.com>,
	<philipp@peloton-tech.com>, <linux-rt-users@vger.kernel.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] gpio: omap: convert to use generic irq handler
Date: Fri, 2 Oct 2015 17:40:12 -0500	[thread overview]
Message-ID: <560F07CC.9050205@ti.com> (raw)
In-Reply-To: <CACRpkdYDrcwa+h2Lxd65RBMc-1n9CCyVDz1qjc2U1MEU2GP7hA@mail.gmail.com>

On 10/02/2015 03:17 PM, Linus Walleij wrote:
> On Fri, Sep 25, 2015 at 12:28 PM, Grygorii Strashko
> <grygorii.strashko@ti.com> wrote:
>
>> This patch converts TI OMAP GPIO driver to use generic irq handler
>> instead of chained IRQ handler. This way OMAP GPIO driver will be
>> compatible with RT kernel where it will be forced thread IRQ handler
>> while in non-RT kernel it still will be executed in HW IRQ context.
>> As part of this change the IRQ wakeup configuration is applied to
>> GPIO Bank IRQ as it now will be under control of IRQ PM Core during
>> suspend.
>>
>> There are also additional benefits:
>>   - on-RT kernel there will be no complains any more about PM runtime usage
>>     in atomic context  "BUG: sleeping function called from invalid context";
>>   - GPIO bank IRQs will appear in /proc/interrupts and its usage statistic
>>      will be  visible;
>>   - GPIO bank IRQs could be configured through IRQ proc_fs interface and,
>>     as result, could be a part of IRQ balancing process if needed;
>>   - GPIO bank IRQs will be under control of IRQ PM Core during
>>     suspend to RAM.
>>
>> Disadvantage:
>>   - additional runtime overhed as call chain till
>>     omap_gpio_irq_handler() will be longer now
>>   - necessity to use wa_lock in omap_gpio_irq_handler() to W/A warning
>>     in handle_irq_event_percpu()
>>     WARNING: CPU: 1 PID: 35 at kernel/irq/handle.c:149 handle_irq_event_percpu+0x51c/0x638()
>>
>> This patch doesn't fully follows recommendations provided by Sebastian
>> Andrzej Siewior [1], because It's required to go through and check all
>> GPIO IRQ pin states as fast as possible and pass control to handle_level_irq
>> or handle_edge_irq. handle_level_irq or handle_edge_irq will perform actions
>> specific for IRQ triggering type and wakeup corresponding registered
>> threaded IRQ handler (at least it's expected to be threaded).
>> IRQs can be lost if handle_nested_irq() will be used, because excecution
>> time of some pin specific GPIO IRQ handler can be very significant and
>> require accessing ext. devices (I2C).
>>
>> Idea of such kind reworking was also discussed in [2].
>>
>> [1] http://www.spinics.net/lists/linux-omap/msg120665.html
>> [2] http://www.spinics.net/lists/linux-omap/msg119516.html
>>
>> Tested-by: Tony Lindgren <tony@atomide.com>
>> Tested-by: Austin Schuh <austin@peloton-tech.com>
>> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
>
> Patch applied.
>

Thanks.

> I'm thinking that we need some recommendations on how to write
> IRQ handlers in order to be RT-compatible. Can you help me lining
> up the requirements in Documentation/gpio/driver.txt?
>
> I will write an RFC patch and let you write some additional text
> to it in response then we can iterate it a bit.

Sure. I'll try to help.


-- 
regards,
-grygorii

  reply	other threads:[~2015-10-02 22:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-25 19:28 [PATCH 0/2] convert to use generic irq handler Grygorii Strashko
2015-09-25 19:28 ` [PATCH 1/2] gpio: omap: move pm runtime in irq_chip.irq_bus_lock/sync_unlock Grygorii Strashko
2015-10-02 12:22   ` Linus Walleij
2015-09-25 19:28 ` [PATCH 2/2] gpio: omap: convert to use generic irq handler Grygorii Strashko
2015-10-02 20:17   ` Linus Walleij
2015-10-02 22:40     ` Grygorii Strashko [this message]
2015-10-12  7:52       ` Thomas Gleixner
2015-10-13 18:25         ` Grygorii Strashko
2015-10-13 18:33           ` Thomas Gleixner
2015-10-15 16:33             ` Grygorii Strashko
2015-12-11 16:57               ` Sebastian Andrzej Siewior
2015-12-12  8:30                 ` Grygorii Strashko
2015-12-22 15:27                   ` Sebastian Andrzej Siewior
2015-09-25 20:36 ` [PATCH 0/2] " santosh.shilimkar

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=560F07CC.9050205@ti.com \
    --to=grygorii.strashko@ti.com \
    --cc=austin@peloton-tech.com \
    --cc=gnurou@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=philipp@peloton-tech.com \
    --cc=ssantosh@kernel.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;
as well as URLs for NNTP newsgroup(s).