linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: marc.zyngier@arm.com (Marc Zyngier)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 1/3] genirq: add support for per-cpu dev_id interrupts
Date: Fri, 16 Sep 2011 09:20:24 +0100	[thread overview]
Message-ID: <4E7306C8.4050809@arm.com> (raw)
In-Reply-To: <CAHXqBFKOQNOePc00yuzfotrYP6wT0ue_CJfv7rKdC+gEkomunA@mail.gmail.com>

Hi Micha?,

On 15/09/11 22:36, Micha? Miros?aw wrote:
> 2011/9/15 Marc Zyngier <marc.zyngier@arm.com>:
> [...]
>> diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
>> index a103732..f9b7fa3 100644
>> --- a/include/linux/interrupt.h
>> +++ b/include/linux/interrupt.h
>> @@ -95,6 +95,7 @@ typedef irqreturn_t (*irq_handler_t)(int, void *);
>>  * @flags:     flags (see IRQF_* above)
>>  * @name:      name of the device
>>  * @dev_id:    cookie to identify the device
>> + * @percpu_dev_id:     cookie to identify the device
>>  * @next:      pointer to the next irqaction for shared interrupts
>>  * @irq:       interrupt number
>>  * @dir:       pointer to the proc/irq/NN/name entry
>> @@ -104,17 +105,20 @@ typedef irqreturn_t (*irq_handler_t)(int, void *);
>>  * @thread_mask:       bitmask for keeping track of @thread activity
>>  */
>>  struct irqaction {
> [...]
>> +       void                    *dev_id;
>> +#ifdef CONFIG_IRQ_PERCPU_DEVID
>> +       void __percpu           *percpu_dev_id;
>> +#endif
> 
> Those two can share the memory (in a anonymous union), if I read the
> idea correctly.

That was the initial implementation, and everything was fine until I
tried gcc 4.4.1. Having an anonymous union breaks static initialization
of the structure.

Try the following:
$ cat x.c
struct foo {
	int a;
	union {
		int b1;
		void * b2;
	};
	int c;
};

struct foo bar = {
	.a  = 1,
	.b1 = 0,
	.c  = 2,
};

$ gcc -c -Wall x.c
x.c:13: error: unknown field ?b1? specified in initializer
x.c:13: warning: missing braces around initializer
x.c:13: warning: (near initialization for ?bar.<anonymous>?)

GCC 4.6 seem fine though. Haven't tried anything in between.

A possible solution would be to name the union and fix all the accesses
to .dev_id. Ugly at best...

Cheers,

	M.
-- 
Jazz is not dead. It just smells funny...

  reply	other threads:[~2011-09-16  8:20 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-15 16:52 [RFC PATCH 0/3] genirq: handling GIC per-cpu interrupts Marc Zyngier
2011-09-15 16:52 ` [RFC PATCH 1/3] genirq: add support for per-cpu dev_id interrupts Marc Zyngier
2011-09-15 21:36   ` Michał Mirosław
2011-09-16  8:20     ` Marc Zyngier [this message]
2011-09-16  9:37       ` Thomas Gleixner
2011-09-15 22:49   ` Thomas Gleixner
2011-09-15 23:29     ` Russell King - ARM Linux
2011-09-15 23:41       ` Thomas Gleixner
2011-09-16  9:37     ` Marc Zyngier
2011-09-16  9:41       ` Thomas Gleixner
2011-09-18 23:20   ` Abhijeet Dharmapurikar
2011-09-19  9:28     ` Marc Zyngier
2011-09-19 15:00       ` Marc Zyngier
2011-09-19 15:05         ` Russell King - ARM Linux
2011-09-19 15:24           ` Marc Zyngier
2011-09-26  1:31       ` Abhijeet Dharmapurikar
2011-09-26  1:58         ` Abhijeet Dharmapurikar
2011-09-15 16:52 ` [RFC PATCH 2/3] ARM: gic: consolidate PPI handling Marc Zyngier
2011-09-15 16:52 ` [RFC PATCH 3/3] ARM: gic, local timers: use the request_percpu_irq() interface Marc Zyngier

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=4E7306C8.4050809@arm.com \
    --to=marc.zyngier@arm.com \
    --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).