xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: xen-devel@lists.xenproject.org, tim@xen.org,
	Keir Fraser <keir@xen.org>,
	stefano.stabellini@citrix.com, patches@linaro.org
Subject: Re: [PATCH for-4.5 7/8] xen/irq: Handle multiple action per IRQ
Date: Tue, 01 Apr 2014 14:13:50 +0100	[thread overview]
Message-ID: <533ABB8E.4070004@linaro.org> (raw)
In-Reply-To: <1396355354.8667.147.camel@kazak.uk.xensource.com>

On 04/01/2014 01:29 PM, Ian Campbell wrote:
> On Mon, 2014-03-31 at 17:02 +0100, Julien Grall wrote:
>> On 03/31/2014 04:53 PM, Ian Campbell wrote:
>>> On Mon, 2014-03-31 at 16:45 +0100, Julien Grall wrote:
>>>> On 02/19/2014 11:55 AM, Ian Campbell wrote:
>>>>> On Fri, 2014-01-24 at 16:43 +0000, Julien Grall wrote:
>>>>>> On ARM, it may happen (eg ARM SMMU) to setup multiple handler for the same
>>>>>> interrupt.
>>>>>
>>>>> Mention here that you are therefore creating a linked list of actions
>>>>> for each interrupt.
>>>>>
>>>>> If you use xen/list.h for this then you get a load of helpers and
>>>>> iterators which would save you open coding them.
>>>>
>>>> I've tried to use xen/list.h. The amount of code it's basically the same
>>>> and we I have to write open code to get the first element of the list
>>>
>>> Why? Can you post your WIP patch please for comparison.
>>
>> Because:
>> 	- there is no helper to get the first element (__setup_irq)
> 
> Wrong function? I don't see any problem in __setup_irq.

__setup_irq has to check if every action has a dev_id. After thinking, I
don't need to get the first action as now we have IRQ_SHARED flags set.

> 
>> 	- I need to use 2 variables to search for an element in a list as there is
>> 	no way to know after the end of the loop if we found or not an element.
> 
> You've written that a bit weirdly IMHO.
> 
> list_for_each(...)
>    if (not the one we want)
> 	continue
>    free the one we wanted
>    break;
> 
> don't worry about warning on a non-existent IRQ, or set a simple
> boolean.

We have to worry about non-existent action otherwise Xen may segfault...

> It really doesn't look that bad to me.

Ok. I will continue on this way then.

> [...]
>> -    struct irqaction *next;
>> +#ifdef CONFIG_ARM
>> +    struct list_head next;
>> +#endif
> [...]
>> +#ifdef CONFIG_ARM
>> +    struct list_head action;    /* IRQ action list */
>> +#else
>>      struct irqaction *action;   /* IRQ action list */
>> +#endif
> 
> Now these might be a legitimate problem with this approach. At the very
> least this should be CONFIG_IRQ_HAS_IRQ_ACTION_LIST or some more
> suitable name.

Ok. I will use it.

Regards,

-- 
Julien Grall

  reply	other threads:[~2014-04-01 13:13 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-24 16:43 [PATCH for-4.5 0/8] Interrupt management reworking Julien Grall
2014-01-24 16:43 ` [PATCH for-4.5 1/8] xen/arm: irq: move gic {, un}lock in gic_set_irq_properties Julien Grall
2014-02-19 11:23   ` Ian Campbell
2014-02-19 13:38     ` Julien Grall
2014-01-24 16:43 ` [PATCH for-4.5 2/8] xen/arm: setup_dt_irq: don't enable the IRQ if the creation has failed Julien Grall
2014-02-19 11:24   ` Ian Campbell
2014-03-12 14:48     ` Ian Campbell
2014-01-24 16:43 ` [PATCH for-4.5 3/8] xen/arm: IRQ: Protect IRQ to be shared between domains and XEN Julien Grall
2014-02-19 11:35   ` Ian Campbell
2014-02-19 13:59     ` Julien Grall
2014-01-24 16:43 ` [PATCH for-4.5 4/8] xen/arm: irq: Don't need to have a specific function to route IRQ to Xen Julien Grall
2014-02-19 11:45   ` Ian Campbell
2014-02-19 14:16     ` Julien Grall
2014-01-24 16:43 ` [PATCH for-4.5 5/8] xen/arm: IRQ: rename release_irq in release_dt_irq Julien Grall
2014-02-19 11:47   ` Ian Campbell
2014-02-19 14:23     ` Julien Grall
2014-01-24 16:43 ` [PATCH for-4.5 6/8] xen/arm: IRQ: Add lock contrainst for gic_irq_{startup, shutdown} Julien Grall
2014-02-19 11:51   ` Ian Campbell
2014-02-19 14:35     ` Julien Grall
2014-02-19 14:38       ` Ian Campbell
2014-02-19 14:51         ` Julien Grall
2014-02-19 15:07           ` Jan Beulich
2014-02-19 17:26             ` Julien Grall
2014-02-20 20:48             ` Julien Grall
2014-02-21  8:55               ` Jan Beulich
2014-02-21 13:19                 ` Julien Grall
2014-01-24 16:43 ` [PATCH for-4.5 7/8] xen/irq: Handle multiple action per IRQ Julien Grall
2014-02-19 11:55   ` Ian Campbell
2014-02-19 14:41     ` Julien Grall
2014-02-20 21:29     ` Julien Grall
2014-02-24 14:08       ` Julien Grall
2014-02-24 14:12         ` Ian Campbell
2014-02-24 14:32         ` Jan Beulich
2014-02-24 14:48           ` Julien Grall
2014-03-11 15:16             ` Julien Grall
2014-03-11 16:08               ` Jan Beulich
2014-03-17 19:06                 ` Stefano Stabellini
2014-03-17 21:05                   ` Julien Grall
2014-03-18  9:33                     ` Ian Campbell
2014-03-18 12:26                       ` Julien Grall
2014-03-18 14:06                         ` Stefano Stabellini
2014-03-18 14:54                           ` Julien Grall
2014-03-18 15:01                             ` Stefano Stabellini
2014-03-18 15:21                               ` Julien Grall
2014-03-18 15:39                                 ` Stefano Stabellini
2014-03-18 15:55                                   ` Julien Grall
2014-03-18 15:02                             ` Ian Campbell
2014-03-18 15:08                               ` Julien Grall
2014-03-18 15:10                                 ` Ian Campbell
2014-03-18 15:12                                   ` Julien Grall
2014-03-18 15:26                                     ` Ian Campbell
2014-03-19 17:18                                       ` Julien Grall
2014-03-21 14:06                                         ` Ian Campbell
2014-03-31 15:45     ` Julien Grall
2014-03-31 15:53       ` Ian Campbell
2014-03-31 16:02         ` Julien Grall
2014-04-01 12:29           ` Ian Campbell
2014-04-01 13:13             ` Julien Grall [this message]
2014-04-01 13:23               ` Ian Campbell
2014-04-01 13:52                 ` Julien Grall
2014-04-01 14:31                   ` Ian Campbell
2014-04-02 14:01                     ` Julien Grall
2014-01-24 16:43 ` [PATCH for-4.5 8/8] xen/serial: remove serial_dt_irq Julien Grall
2014-02-19 11:55   ` Ian Campbell

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=533ABB8E.4070004@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=Ian.Campbell@citrix.com \
    --cc=keir@xen.org \
    --cc=patches@linaro.org \
    --cc=stefano.stabellini@citrix.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xenproject.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).