linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: lars@metafoo.de (Lars-Peter Clausen)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC patch 00/20] Interrupt chip consolidation
Date: Tue, 19 Apr 2011 12:10:20 +0200	[thread overview]
Message-ID: <4DAD5F8C.1060101@metafoo.de> (raw)
In-Reply-To: <alpine.LFD.2.00.1104191130050.2744@localhost6.localdomain6>

On 04/19/2011 11:41 AM, Thomas Gleixner wrote:
> On Tue, 19 Apr 2011, Lars-Peter Clausen wrote:
>> On 04/16/2011 11:14 PM, Thomas Gleixner wrote:
>>> [...]
>  
>> I've also noticed that all my chained demuxer handlers follow a similar scheme
>> and a quick grep for generic_handle_irq revealed that quite a few other
>> implementations also follow a similar scheme as well.
>>
>> Something along the lines of ...
>>
>> void irq_gc_chained_demux_handler(unsigned int irq, struct irq_desc *desc)
>> {
>> 	struct irq_chip_generic *gc = irq_desc_get_handler_data(desc);
>> 	struct irq_chip_type *ct = gc = irq_chip_generic_current_chip_type(gc);
>> 	unsigned long pending = irq_reg_readl(ct->regs.pending);
>>
>> 	pending = irq_reg_readl(ct->regs.pending) & gc->mask_cache;
>>
>> 	for_each_set_bit (irq, &pending, gc->irq_cnt)
>> 		generic_handle_irq(gc->irq_base + irq);
>> }
>>
>> ... could be used to replace those custom handlers in an irq_chip_generic based
>> implementation.
>>
>> With this the diffstat for JZ4740 looks even better:
>>  4 files changed, 91 insertions(+), 232 deletions(-)
>>
>> Unfortunately it doesn't completely fit into the current irq_chip_generic
>> implementation. For one there is no irq_chip_generic_current_chip_type, but I
>> guess that could be implementing by adding a field to irq_chip_generic pointing
>> to the current chip type. On the other hand I'm not sure if it is necessary to
> 
> No, you can get the current chip from irq_data.chip which always has a
> pointer to the current active one. container_of will give you the
> generic chip.

Yes, but the chained demux handler is of course installed on the parent irq chip.
I guess we could do something like cur_regs(irq_get_irq_data(gc->irq_base))
though, but that is a lot of indirection.

> 
>> have different pending registers for different chip types of the same
>> irq_chip_generic.
>>
>> Another issue is that while the gpio unit on the JZ4740 supports different
>> trigger modes it only supports either rising or falling edge at one time. So
>> since it doesn't makes sense to implement switching between those two in a
>> driver triggering in both edges is emulated by the irq chip.
> 
> That's what about 5 dozen other irq chips do as well.

Yes, I've noticed as well. That is why I was asking if you see the possibility
to handle this in the core somehow.

- Lars

  reply	other threads:[~2011-04-19 10:10 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-16 21:14 [RFC patch 00/20] Interrupt chip consolidation Thomas Gleixner
2011-04-16 21:14 ` genirq: Implement a generic interrupt chip Thomas Gleixner
2011-04-18 17:20   ` H Hartley Sweeten
2011-04-18 19:32     ` Thomas Gleixner
2011-04-18 19:43       ` Thomas Gleixner
2011-04-18 20:32         ` H Hartley Sweeten
2011-04-19  7:57   ` Tony Lindgren
2011-04-19 10:01     ` Tony Lindgren
2011-04-20  8:20   ` Abhijeet Dharmapurikar
2011-04-20  9:34     ` Thomas Gleixner
2011-04-16 21:14 ` genirq: Add chip suspend and resume callbacks Thomas Gleixner
2011-04-16 21:14 ` arm: vic: Use generic interrupt chip Thomas Gleixner
2011-04-18 17:34   ` H Hartley Sweeten
2011-04-16 21:14 ` arm: vic: Implement irq_suspend/resume callbacks Thomas Gleixner
2011-04-16 21:14 ` arm: orion: Use generic irq chip Thomas Gleixner
2011-04-20  8:21   ` Abhijeet Dharmapurikar
2011-04-20  8:35     ` Thomas Gleixner
2011-04-16 21:14 ` arm: bcmring: Use generic irq chip implementation Thomas Gleixner
2011-04-16 21:14 ` arm: davinci: Use generic irq chip Thomas Gleixner
2011-04-20  0:01   ` Kevin Hilman
2011-04-25  6:50   ` Nori, Sekhar
2011-04-16 21:14 ` arm: samsung: Convert irq-vic-timer to " Thomas Gleixner
2011-04-17 21:52   ` Kukjin Kim
2011-04-19  9:59   ` [PATCH] arm: omap2/3: Use " Tony Lindgren
2011-04-16 21:14 ` arm: samsung: Convert irq_uart to " Thomas Gleixner
2011-04-17 21:53   ` Kukjin Kim
2011-04-16 21:14 ` arm: samsung: s5p: Convert irq-gpioint " Thomas Gleixner
2011-04-17 21:51   ` Kukjin Kim
2011-04-16 21:14 ` arm: tcc8k: Convert " Thomas Gleixner
2011-04-16 21:14 ` arm: sa1111: " Thomas Gleixner
2011-04-16 21:14 ` arm: msm: Convert sirc " Thomas Gleixner
2011-04-21 15:13   ` Abhijeet Dharmapurikar
2011-04-16 21:14 ` arm: msm: Convert irq.c chip " Thomas Gleixner
2011-04-16 21:14 ` arm: msm: Convert irq-vic " Thomas Gleixner
2011-04-21 16:53   ` Abhijeet Dharmapurikar
2011-04-21 17:28     ` Thomas Gleixner
2011-04-25  6:11       ` Abhijeet Dharmapurikar
2011-04-25 10:13         ` Linus Walleij
2011-04-16 21:14 ` arm: msm: Cleanup the irq.c code some more Thomas Gleixner
2011-04-16 21:14 ` arm: msm: Use irq-vic for all vic instances Thomas Gleixner
2011-04-16 21:14 ` arm: pxa: Convert SC and GPIO-l to generic irq chips Thomas Gleixner
2011-04-16 21:14 ` arm: msm: Consolidate more Thomas Gleixner
2011-04-19  8:22 ` [RFC patch 00/20] Interrupt chip consolidation Lars-Peter Clausen
2011-04-19  9:41   ` Thomas Gleixner
2011-04-19 10:10     ` Lars-Peter Clausen [this message]
2011-04-19 10:26       ` Thomas Gleixner

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=4DAD5F8C.1060101@metafoo.de \
    --to=lars@metafoo.de \
    --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).