linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linus.walleij@linaro.org (Linus Walleij)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/6] ARM: nmk: update GPIO chained IRQ handler to entry/exit functions
Date: Mon, 18 Apr 2011 20:26:02 +0200	[thread overview]
Message-ID: <BANLkTikNANiZm+K3-9SdDb9MOWGxgpEGNg@mail.gmail.com> (raw)
In-Reply-To: <1302633340-4795-6-git-send-email-will.deacon@arm.com>

2011/4/12 Will Deacon <will.deacon@arm.com>:

> This patch updates the Nomadik gpio chained IRQ handler to use the
> chained IRQ enter/exit functions in order to function correctly on
> primary controllers with different methods of flow control.
>
> Cc: Rabin Vincent <rabin@rab.in>
> Signed-off-by: Will Deacon <will.deacon@arm.com>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

BUT I want it to go through Grants gpio tree. The reason is that
I plan to consolidate this driver into drivers/gpio/* and I don't want
collisions in merges.

And wait:

> +#include <asm/mach/irq.h>

> - ? ? ? if (host_chip->irq_mask_ack)
> - ? ? ? ? ? ? ? host_chip->irq_mask_ack(&desc->irq_data);
> - ? ? ? else {
> - ? ? ? ? ? ? ? host_chip->irq_mask(&desc->irq_data);
> - ? ? ? ? ? ? ? if (host_chip->irq_ack)
> - ? ? ? ? ? ? ? ? ? ? ? host_chip->irq_ack(&desc->irq_data);
> - ? ? ? }
> + ? ? ? chained_irq_enter(host_chip, desc);

(...)

> - ? ? ? host_chip->irq_unmask(&desc->irq_data);
> + ? ? ? chained_irq_exit(host_chip, desc);

This looks an awful lot like this from drivers/gpio/pl061.c:

desc->irq_data.chip->irq_ack(&desc->irq_data);
(...)
desc->irq_data.chip->irq_unmask(&desc->irq_data);

It gets me wondering what the proper way is to do this.
Isn't the proper place for chained_irq_[enter|exit]* in
include/linux/irq.h rather? It does not really look machine
or arch specific, is it, really?

I.e. this:

#ifndef __ASSEMBLY__
/*
 * Entry/exit functions for chained handlers where the primary IRQ chip
 * may implement either fasteoi or level-trigger flow control.
 */
static inline void chained_irq_enter(struct irq_chip *chip,
                                     struct irq_desc *desc)
{
        /* FastEOI controllers require no action on entry. */
        if (chip->irq_eoi)
                return;

        if (chip->irq_mask_ack) {
                chip->irq_mask_ack(&desc->irq_data);
        } else {
                chip->irq_mask(&desc->irq_data);
                if (chip->irq_ack)
                        chip->irq_ack(&desc->irq_data);
        }
}

static inline void chained_irq_exit(struct irq_chip *chip,
                                    struct irq_desc *desc)
{
        if (chip->irq_eoi)
                chip->irq_eoi(&desc->irq_data);
        else
                chip->irq_unmask(&desc->irq_data);
}
#endif

Excuse me if this was discussed before...

Yours,
Linus Walleij

  reply	other threads:[~2011-04-18 18:26 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-12 18:35 [PATCH v2 0/6] Use chained handler entry/exit functions in platform code Will Deacon
2011-04-12 18:35 ` [PATCH 1/6] ARM: omap: update GPIO chained IRQ handler to use entry/exit functions Will Deacon
2011-04-12 18:35 ` [PATCH 2/6] ARM: tegra: " Will Deacon
2011-05-01  7:26   ` Colin Cross
2011-05-01 12:42     ` Will Deacon
2011-04-12 18:35 ` [PATCH 3/6] ARM: s5pv310: update IRQ combiner to use chained " Will Deacon
2011-04-12 18:35 ` [PATCH 4/6] ARM: msm: update GPIO chained IRQ handler to use " Will Deacon
2011-04-15 18:27   ` David Brown
2011-04-18 17:57     ` Will Deacon
2011-04-16  1:51   ` Abhijeet Dharmapurikar
2011-04-18 17:56     ` Will Deacon
2011-04-12 18:35 ` [PATCH 5/6] ARM: nmk: update GPIO chained IRQ handler to " Will Deacon
2011-04-18 18:26   ` Linus Walleij [this message]
2011-04-18 19:04     ` Will Deacon
2011-04-18 23:46       ` Linus Walleij
2011-04-19 19:52         ` Grant Likely
2011-04-12 18:35 ` [PATCH 6/6] ARM: gic: use handle_fasteoi_irq for SPIs Will Deacon
2011-04-16  1:52   ` Abhijeet Dharmapurikar
2011-04-19 11:20   ` Santosh Shilimkar
2011-04-19 15:16     ` Will Deacon
2011-04-20  4:20       ` Santosh Shilimkar
2011-04-30  2:38   ` Colin Cross
2011-04-30  9:54     ` Thomas Gleixner
2011-04-30 16:42       ` Colin Cross
  -- strict thread matches above, loose matches on Subject: below --
2011-04-01 14:50 [PATCH 0/6] Use chained handler entry/exit functions in platform code Will Deacon
2011-04-01 14:50 ` [PATCH 5/6] ARM: nmk: update GPIO chained IRQ handler to entry/exit functions Will Deacon

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=BANLkTikNANiZm+K3-9SdDb9MOWGxgpEGNg@mail.gmail.com \
    --to=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.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 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).