[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0a7450bf-f7a7-f3d3-adfa-d8e151391c67@caviumnetworks.com>
Date: Mon, 30 Jan 2017 09:55:17 -0800
From: David Daney <ddaney@...iumnetworks.com>
To: Thomas Gleixner <tglx@...utronix.de>
CC: Marc Zyngier <marc.zyngier@....com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linus Walleij <linus.walleij@...aro.org>
Subject: Re: irq domain hierarchy vs. chaining w/ PCI MSI-X...
On 01/30/2017 05:32 AM, Thomas Gleixner wrote:
> On Fri, 13 Jan 2017, David Daney wrote:
>> At the point where the handle_*_irq() functions call handle_irq_event(), we
>> need to 9optionally) do something both immediately before and after the call
>> to handle_irq_event().
>>
>> In irq_chip add a function:
>>
>> void (*irq_handle)(struct irq_data *data, struct irq_desc *desc);
>>
>> Really this is the per irq_chip flow handler.
>>
>> Then in handle_fasteoi_irq() and probably the other flow handlers as well:
>>
>> .
>> .
>> .
>> if (chip->irq_handle)
>> chip->irq_handle(&desc->irq_data, desc);
>> else
>> handle_irq_event(desc);
>> .
>> .
>> .
>>
>> Those 4 lines of code could be factored out into a helper function in chip.c
>
>
> And why don't you just write a flow handler function which does exactly
> what you need instead of adding more conditionals into all hotpath
> functions?
I came to the same conclusion myself and have already started to
implement it that way.
In my particular use case, we already know for certain which flow
handler the parent irqdomain is using, so it is easy to copy it and add
the extra handling needed by the child irq_chip.
In the general case, a driver cannot know which flow handler the parent
irqdomain is using, so it is impossible to know how to write a new flow
handler that implements the desired semantics of the irq_chip hierarchy.
David Daney
Powered by blists - more mailing lists