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,
	stefano.stabellini@citrix.com
Subject: Re: [PATCH v6 1/6] xen/arm: IRQ: Store IRQ type in arch_irq_desc
Date: Thu, 15 May 2014 18:03:36 +0100	[thread overview]
Message-ID: <5374F368.8040008@linaro.org> (raw)
In-Reply-To: <1400168737.19926.37.camel@kazak.uk.xensource.com>

On 05/15/2014 04:45 PM, Ian Campbell wrote:
>> +int irq_set_type(unsigned int spi, unsigned int type)
>> +{
>> +    unsigned long flags;
>> +    struct irq_desc *desc = irq_to_desc(spi);
>> +    int ret = -EBUSY;
>> +
>> +    /* This function should not be used for other than SPIs */
> 
> Perhaps name the function irq_set_spi_type or something then?
> 
>> +    for_each_cpu( cpu, &cpu_online_map )
>> +    {
>> +        desc = &per_cpu(local_irq_desc, cpu)[irq];
>> +        spin_lock_irqsave(&desc->lock, flags);
>> +        desc->arch.type = type;
> 
> Don't you need to write ICFGR on each CPU?

This function will bail out if local_irqs_type[irq] == DT_IRQ_TYPE_INVALID.

This value means, the IRQ has not been configured and set up (see ASSERT
in configure which prevent it).

The ICFGR will be configure when Xen set up an handler to this IRQ (see
setup_irq).

> 
>> diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
>> index 5542958..e677da9 100644
>> --- a/xen/include/xen/device_tree.h
>> +++ b/xen/include/xen/device_tree.h
>> @@ -131,6 +131,7 @@ struct dt_phandle_args {
>>   * DT_IRQ_TYPE_LEVEL_LOW       - low level triggered
>>   * DT_IRQ_TYPE_LEVEL_MASK      - Mask to filter out the level bits
>>   * DT_IRQ_TYPE_SENSE_MASK      - Mask for all the above bits
>> + * DT_IRQ_TYPE_INVALID         - Use to initialize the type
>>   */
>>  #define DT_IRQ_TYPE_NONE           0x00000000
>>  #define DT_IRQ_TYPE_EDGE_RISING    0x00000001
>> @@ -143,6 +144,8 @@ struct dt_phandle_args {
>>      (DT_IRQ_TYPE_LEVEL_LOW | DT_IRQ_TYPE_LEVEL_HIGH)
>>  #define DT_IRQ_TYPE_SENSE_MASK     0x0000000f
>>  
>> +#define DT_IRQ_TYPE_INVALID        0x00000010
> 
> 0xffffffff perhaps?

The value 0x010 will always return false for edge and level. This is not
the case for 0xffffffff because edge/level use different bit.

Regards,

-- 
Julien Grall

  reply	other threads:[~2014-05-15 17:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-12 17:57 [PATCH v6 0/6] xen/arm: Interrupt management reworking Julien Grall
2014-05-12 17:57 ` [PATCH v6 1/6] xen/arm: IRQ: Store IRQ type in arch_irq_desc Julien Grall
2014-05-15 15:45   ` Ian Campbell
2014-05-15 17:03     ` Julien Grall [this message]
2014-05-16 10:16       ` Ian Campbell
2014-05-16 10:43         ` Julien Grall
2014-05-12 17:57 ` [PATCH v6 2/6] xen/arm: IRQ: Replace {request, setup}_dt_irq by {request, setup}_irq Julien Grall
2014-05-12 17:57 ` [PATCH v6 3/6] xen/arm: Replace route_guest_dt_irq by route_guest_irq Julien Grall
2014-05-15 15:46   ` Ian Campbell
2014-05-12 17:57 ` [PATCH v6 4/6] xen: IRQ: Add dev_id parameter to release_irq Julien Grall
2014-05-12 17:57 ` [PATCH v6 5/6] xen/arm: IRQ: extend {request, setup}_irq to take an irqflags in parameter Julien Grall
2014-05-12 17:59   ` Julien Grall
2014-05-12 17:57 ` [PATCH v6 6/6] xen/arm: IRQ: Handle multiple action per IRQ Julien Grall

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=5374F368.8040008@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=Ian.Campbell@citrix.com \
    --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).