irq related: make function to take irq_desc pointer instead of irq
Subsystems (52)
cover irq related: make function to take irq_desc pointer instead of irq
so could stop calling irq_to_desc ...
Thanks
Yinghai
PATCH 1/12 x86: fix out of order of gsi - full
Iranna D Ankad reported that IBM x3950 systems have boot problems after this commit:
| | commit b9c61b70075c87a8612624736faf4a2de5b1ed30 | | x86/pci: update pirq_enable_irq() to setup io apic routing |
ACPI: IOAPIC (id[0x10] address[0xfecff000] gsi_base[0]) IOAPIC[0]: apic_id 16, version 0, address 0xfecff000, GSI 0-2
ACPI: IOAPIC (id[0x0f] address[0xfec00000] gsi_base[3]) IOAPIC[1]: apic_id 15, version 0, address 0xfec00000, GSI 3-38
ACPI: IOAPIC (id[0x0e] address[0xfec01000] gsi_base[39]) IOAPIC[2]: apic_id 14, version 0, address 0xfec01000, GSI 39-74
As explained in the previous patch ("x86: Fix out of order gsi)
need to remap those gsis
This patch adds boot_ioapic_idx and gsi_to_irq/irq_to_gsi So we could make sure for those kind of system will have
irq: 0 - 15 for legacy irq
irq: 16 after will be gsi + 16
-v13: move gsi_to_irq/irq_to_gsi to acpi/boot.c
--- arch/x86/include/asm/io_apic.h | 2 +- arch/x86/include/asm/mpspec.h | 12 +++++++ arch/x86/kernel/acpi/boot.c | 64 ++++++++++++++++++++++++++++++------ arch/x86/kernel/apic/io_apic.c | 70 +++++++++++++++++++++++++++++----------- drivers/pnp/pnpacpi/rsparser.c | 4 ++ 5 files changed, 121 insertions(+), 31 deletions(-)
arch/x86/include/asm/io_apic.h +1 -1
@@ -158,7 +158,7 @@ extern int io_apic_get_redir_entries(int ioapic);struct io_apic_irq_attr ;extern int io_apic_set_pci_routing (struct device *dev,int irq,struct io_apic_irq_attr *irq_attr); -void setup_IO_APIC_irq_extra (u32 gsi); +void setup_IO_APIC_irq_extra (u32 gsi,unsigned int *irq);extern int (*ioapic_renumber_irq)(int ioapic,int irq);extern void ioapic_init_mappings (void );extern void ioapic_insert_resources (void );
arch/x86/include/asm/mpspec.h +12 -0
@@ -97,6 +97,7 @@ static inline void early_reserve_e820_mpc_new(void) { }#endif void __cpuinit generic_processor_info (int apicid,int version); +extern int gsi_delta;#ifdef CONFIG_ACPI extern void mp_register_ioapic (int id,u32 address,u32 gsi_base); extern void mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger,
@@ -106,6 +107,8 @@ struct device;extern int mp_register_gsi (struct device *dev,u32 gsi,int edge_level,int active_high_low);extern int acpi_probe_gsi (void ); +int gsi_to_irq (unsigned int gsi); +unsigned int irq_to_gsi (int irq);#ifdef CONFIG_X86_IO_APIC extern int mp_find_ioapic (int gsi);extern int mp_find_ioapic_pin (int ioapic,int gsi);
@@ -115,6 +118,15 @@ static inline int acpi_probe_gsi(void) {return 0 ; } +static inline int gsi_to_irq (unsigned int gsi) +{ +return gsi; +} +static inline unsigned int irq_to_gsi (int irq) +{ +return irq; +} +#endif /* CONFIG_ACPI */ #define PHYSID_ARRAY_SIZE BITS_TO_LONGS(MAX_APICS)
arch/x86/kernel/acpi/boot.c +53 -11
138 lines not on this page · raw message
arch/x86/kernel/apic/io_apic.c +51 -19
148 lines not on this page · raw message
drivers/pnp/pnpacpi/rsparser.c +4 -0
@@ -123,6 +123,10 @@ static void pnpacpi_parse_allocated_irqresource(struct pnp_dev *dev, } flags =irq_flags (triggering, polarity, shareable); +#ifdef CONFIG_X86 +/* bus_irq or gsi ? */ + gsi =irq_to_gsi (gsi); +#endif irq =acpi_register_gsi (&dev->dev, gsi, triggering, polarity);if (irq >=0 )pcibios_penalize_isa_irq (irq,1 );
Signature · 1 line
1.6.4.2
PATCH 2/12 x86: set nr_irqs_gsi only in probe_nr_irqs_gsi
In reply to Yinghai Ludon't clear that in arch_early_irq_init
probe_nr_irqs_gsi is always called when ioapic is selected in config.
so even for mrst, print out from probe_nr_irqs_gsi is report correct nr_irqs_gsi
-v2: remove io_apic_irqs assignement, setup_IO_APIC will do that.
--- arch/x86/kernel/apic/io_apic.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-)
arch/x86/kernel/apic/io_apic.c +2 -5
@@ -153,11 +153,6 @@ int __init arch_early_irq_init(void)int node;int i; -if (!legacy_pic->nr_legacy_irqs) { - nr_irqs_gsi =0 ; - io_apic_irqs = ~0UL ; - } - cfg = irq_cfgx; count =ARRAY_SIZE (irq_cfgx); node=cpu_to_node (boot_cpu_id);
@@ -3887,6 +3882,8 @@ void __init probe_nr_irqs_gsi(void) {int nr =0 ; + nr_irqs_gsi = legacy_pic->nr_legacy_irqs; + nr =acpi_probe_gsi ();if (nr > nr_irqs_gsi) { nr_irqs_gsi = nr;
Signature · 1 line
1.6.4.2
PATCH 3/12 x86: kill smpboot_hooks.h
In reply to Yinghai Luonly one user, move it back to smpboot.c
remove smpboot_clear_io_apic, and only keep smpboot_clear_io_apic_irqs.
and check nr_legacy_irqs before clear it.
--- arch/x86/include/asm/smpboot_hooks.h | 61 ---------------------------------- arch/x86/kernel/smpboot.c | 57 ++++++++++++++++++++++++++++++-- 2 files changed, 54 insertions(+), 64 deletions(-) delete mode 100644 arch/x86/include/asm/smpboot_hooks.h
arch/x86/include/asm/smpboot_hooks.h deleted +0 -61
@@ -1,61 +0,0 @@ -/* two abstractions specific to kernel/smpboot.c, mainly to cater to visws -* which needs to alter them. */ - -static inline void smpboot_clear_io_apic_irqs (void ) -{ -#ifdef CONFIG_X86_IO_APIC - io_apic_irqs =0 ; -#endif -} - -static inline void smpboot_setup_warm_reset_vector (unsigned long start_eip) -{ -CMOS_WRITE (0xa ,0xf ); -local_flush_tlb (); -pr_debug ("1.\n" ); - *((volatile unsigned short *)phys_to_virt (apic->trampoline_phys_high)) = - start_eip >>4 ; -pr_debug ("2.\n" ); - *((volatile unsigned short *)phys_to_virt (apic->trampoline_phys_low)) = - start_eip &0xf ; -pr_debug ("3.\n" ); -} - -static inline void smpboot_restore_warm_reset_vector (void ) -{ -/* -* Install writable page 0 entry to set BIOS data area. -*/ -local_flush_tlb (); - -/* -* Paranoid: Set warm reset code and vector here back -* to default values. -*/ -CMOS_WRITE (0 ,0xf ); - - *((volatile long *)phys_to_virt (apic->trampoline_phys_low)) =0 ; -} - -static inline void __init smpboot_setup_io_apic (void ) -{ -#ifdef CONFIG_X86_IO_APIC -/* -* Here we can be sure that there is an IO-APIC in the system. Let's -* go and set it up: -*/ -if (!skip_ioapic_setup && nr_ioapics) -setup_IO_APIC (); -else { - nr_ioapics =0 ; -localise_nmi_watchdog (); - } -#endif -} - -static inline void smpboot_clear_io_apic (void ) -{ -#ifdef CONFIG_X86_IO_APIC - nr_ioapics =0 ; -#endif -}
arch/x86/kernel/smpboot.c +54 -3
93 lines not on this page · raw message
Signature · 1 line
1.6.4.2
PATCH 4/12 x86: use vector_desc instead of vector_irq
In reply to Yinghai LuEric pointed out that radix tree version of irq_to_desc will magnify delay on the path of handle_irq.
use vector_desc to reduce the calling of irq_to_desc.
next step: need to change all ack, mask, umask, eoi for all irq_chip to take irq_desc
-v2: irq should be unsigned in 32bit handle_irq according to Eric
also reset vector_desc for lguest in setup_irq
-v3: keep irq in x+execute_on_irq_stack() ...
-v4: update after legacy_pic
--- arch/x86/include/asm/desc.h | 2 +- arch/x86/include/asm/hw_irq.h | 10 +++--- arch/x86/include/asm/irq.h | 3 +- arch/x86/kernel/apic/io_apic.c | 75 ++++++++++++++++++++------------------- arch/x86/kernel/irq.c | 15 ++++---- arch/x86/kernel/irq_32.c | 10 +++--- arch/x86/kernel/irq_64.c | 7 +--- arch/x86/kernel/irqinit.c | 8 ++--- arch/x86/kernel/smpboot.c | 2 +- arch/x86/kernel/vmiclock_32.c | 2 +- arch/x86/lguest/boot.c | 7 +++- 11 files changed, 71 insertions(+), 70 deletions(-)
arch/x86/include/asm/desc.h +1 -1
@@ -334,7 +334,7 @@ static inline void set_intr_gate(unsigned int n, void *addr) }extern int first_system_vector; -/* used_vectors is BITMAP for irq is not managed by percpu vector_irq */ +/* used_vectors is BITMAP for irq is not managed by percpu vector_desc */ extern unsigned long used_vectors[];static inline void alloc_system_vector (int vector)
arch/x86/include/asm/hw_irq.h +5 -5
@@ -92,7 +92,7 @@ struct irq_cfg { };extern struct irq_cfg *irq_cfg (unsigned int ); -extern int assign_irq_vector (int ,struct irq_cfg *,const struct cpumask *); +extern int assign_irq_vector (struct irq_desc *,struct irq_cfg *,const struct cpumask *);extern void send_cleanup_vector (struct irq_cfg *);struct irq_desc ;
@@ -131,17 +131,17 @@ extern asmlinkage void smp_invalidate_interrupt(struct pt_regs *);extern void (*__initconst interrupt[NR_VECTORS -FIRST_EXTERNAL_VECTOR ])(void ); -typedef int vector_irq_t [NR_VECTORS ]; -DECLARE_PER_CPU (vector_irq_t, vector_irq); +typedef struct irq_desc *vector_desc_t [NR_VECTORS ]; +DECLARE_PER_CPU (vector_desc_t, vector_desc);#ifdef CONFIG_X86_IO_APIC extern void lock_vector_lock (void );extern void unlock_vector_lock (void ); -extern void __setup_vector_irq (int cpu); +extern void __setup_vector_desc (int cpu);#else static inline void lock_vector_lock (void ) {}static inline void unlock_vector_lock (void ) {} -static inline void __setup_vector_irq (int cpu) {} +static inline void __setup_vector_desc (int cpu) {}#endif #endif /* !ASSEMBLY_ */
arch/x86/include/asm/irq.h +2 -1
@@ -39,7 +39,8 @@ extern void irq_force_complete_move(int);extern void (*x86_platform_ipi_callback)(void );extern void native_init_IRQ (void ); -extern bool handle_irq (unsigned irq,struct pt_regs *regs); +struct irq_desc ; +extern bool handle_irq (struct irq_desc *desc,struct pt_regs *regs);extern unsigned int do_IRQ (struct pt_regs *regs);
arch/x86/kernel/apic/io_apic.c +38 -37
235 lines not on this page · raw message
arch/x86/kernel/irq.c +7 -8
@@ -229,19 +229,19 @@ unsigned int __irq_entry do_IRQ(struct pt_regs *regs)/* high bit used in ret_from_ code */ unsigned vector = ~regs->orig_ax; -unsigned irq; +struct irq_desc *desc;exit_idle ();irq_enter (); - irq =__get_cpu_var (vector_irq)[vector]; + desc =__get_cpu_var (vector_desc)[vector]; -if (!handle_irq (irq, regs)) { +if (!handle_irq (desc, regs)) {ack_APIC_irq ();if (printk_ratelimit ()) -pr_emerg ("%s: %d.%d No irq handler for vector (irq %d)\n" , - __func__,smp_processor_id (), vector, irq); +pr_emerg ("%s: %d.%d No irq handler for vector\n" , + __func__,smp_processor_id (), vector); }irq_exit ();
@@ -348,14 +348,13 @@ void fixup_irqs(void)for (vector =FIRST_EXTERNAL_VECTOR ; vector <NR_VECTORS ; vector++) {unsigned int irr; -if (__get_cpu_var (vector_irq)[vector] <0 ) +if (__get_cpu_var (vector_desc)[vector] ==NULL )continue ; irr =apic_read (APIC_IRR + (vector /32 *0x10 ));if (irr & (1 << (vector %32 ))) { - irq =__get_cpu_var (vector_irq)[vector]; + desc =__get_cpu_var (vector_desc)[vector]; - desc =irq_to_desc (irq);raw_spin_lock (&desc->lock);if (desc->chip->retrigger) desc->chip->retrigger (irq);
arch/x86/kernel/irq_32.c +5 -5
@@ -76,7 +76,7 @@ static void call_on_stack(void *func, void *stack) }static inline int -execute_on_irq_stack (int overflow,struct irq_desc *desc,int irq) +execute_on_irq_stack (int overflow,struct irq_desc *desc,unsigned int irq) {union irq_ctx *curctx, *irqctx;u32 *isp, arg1, arg2;
@@ -189,20 +189,20 @@ asmlinkage void do_softirq(void)#else static inline int -execute_on_irq_stack (int overflow,struct irq_desc *desc,int irq) {return 0 ; } +execute_on_irq_stack (int overflow,struct irq_desc *desc,unsigned int irq) {return 0 ; }#endif -bool handle_irq (unsigned irq,struct pt_regs *regs) +bool handle_irq (struct irq_desc *desc,struct pt_regs *regs) { -struct irq_desc *desc;int overflow; +unsigned int irq; overflow =check_stack_overflow (); - desc =irq_to_desc (irq);if (unlikely (!desc))return false; + irq = desc->irq;if (!execute_on_irq_stack (overflow, desc, irq)) {if (unlikely (overflow))print_stack_overflow ();
arch/x86/kernel/irq_64.c +2 -5
@@ -48,17 +48,14 @@ static inline void stack_overflow_check(struct pt_regs *regs)#endif } -bool handle_irq (unsigned irq,struct pt_regs *regs) +bool handle_irq (struct irq_desc *desc,struct pt_regs *regs) { -struct irq_desc *desc; -stack_overflow_check (regs); - desc =irq_to_desc (irq);if (unlikely (!desc))return false; -generic_handle_irq_desc (irq, desc); +generic_handle_irq_desc (desc->irq, desc);return true; }
arch/x86/kernel/irqinit.c +3 -5
@@ -83,16 +83,14 @@ static struct irqaction irq2 = { .name = "cascade", }; -DEFINE_PER_CPU(vector_irq_t, vector_irq) = { - [0 ... NR_VECTORS - 1] = -1, -}; +DEFINE_PER_CPU (vector_desc_t, vector_desc);int vector_used_by_percpu_irq (unsigned int vector) {int cpu;for_each_online_cpu (cpu) { -if (per_cpu (vector_irq, cpu)[vector] !=-1 ) +if (per_cpu (vector_desc, cpu)[vector] !=NULL )return 1 ; }
@@ -136,7 +134,7 @@ void __init init_IRQ(void)* irq's migrate etc. */ for (i =0 ; i < legacy_pic->nr_legacy_irqs; i++) -per_cpu (vector_irq,0 )[IRQ0_VECTOR + i] = i; +per_cpu (vector_desc,0 )[IRQ0_VECTOR + i] =irq_to_desc (i); x86_init.irqs.intr_init (); }
arch/x86/kernel/smpboot.c +1 -1
@@ -246,7 +246,7 @@ static void __cpuinit smp_callin(void)/* * Need to setup vector mappings before we enable interrupts. */ -__setup_vector_irq (smp_processor_id ()); +__setup_vector_desc (smp_processor_id ());/* * Get our bogomips. *
arch/x86/kernel/vmiclock_32.c +1 -1
@@ -236,7 +236,7 @@ void __init vmi_time_init(void)vmi_time_init_clockevent ();setup_irq (0 , &vmi_clock_action);for_each_possible_cpu (cpu) -per_cpu (vector_irq, cpu)[vmi_get_timer_vector ()] =0 ; +per_cpu (vector_desc, cpu)[vmi_get_timer_vector ()] =irq_to_desc (0 ); }#ifdef CONFIG_X86_LOCAL_APIC
arch/x86/lguest/boot.c +6 -1
@@ -819,7 +819,7 @@ static void __init lguest_init_IRQ(void)for (i =FIRST_EXTERNAL_VECTOR ; i <NR_VECTORS ; i++) {/* Some systems map "vectors" to interrupts weirdly. Not us! */ -__get_cpu_var (vector_irq)[i] = i -FIRST_EXTERNAL_VECTOR ; +__get_cpu_var (vector_desc)[i] =irq_to_desc (i -FIRST_EXTERNAL_VECTOR );if (i !=SYSCALL_VECTOR )set_intr_gate (i, interrupt[i -FIRST_EXTERNAL_VECTOR ]); }
@@ -842,6 +842,11 @@ static void __init lguest_init_IRQ(void)void lguest_setup_irq (unsigned int irq) {irq_to_desc_alloc_node (irq,0 ); +/* +* for sparseirq, we could get new desc other than legacy irq, +* so set vector_desc again for that irq +*/ +__get_cpu_var (vector_desc)[irq +FIRST_EXTERNAL_VECTOR ] =irq_to_desc (irq);set_irq_chip_and_handler_name (irq, &lguest_irq_controller, handle_level_irq,"level" ); }
Signature · 1 line
1.6.4.2
PATCH 5/12 genericirq: make irq_chip to have member with irq_desc pointer
In reply to Yinghai Luwill have
void (*desc_ack)(struct irq_desc *desc); void (*desc_mask)(struct irq_desc *desc); void (*desc_mask_ack)(struct irq_desc *desc); void (*desc_unmask)(struct irq_desc *desc); void (*desc_eoi)(struct irq_desc *desc);
so for sparseirq with raidix tree, we don't call extra irq_to_desc, and could use desc directly
-v2: change all member of irq_chip to use desc only.
-v3: update after legacy_pic
according to Thomas, use other copy for new member with *desc, so could make the transition more smooth
--- include/linux/irq.h | 129 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 129 insertions(+), 0 deletions(-)
include/linux/irq.h +129 -0
@@ -110,6 +110,7 @@ struct msi_desc;*/ struct irq_chip {const char *name; +unsigned int (*startup)(unsigned int irq);void (*shutdown)(unsigned int irq);void (*enable)(unsigned int irq);
@@ -135,6 +136,34 @@ struct irq_chip {#ifdef CONFIG_IRQ_RELEASE_METHOD void (*release)(unsigned int irq,void *dev_id);#endif + +unsigned int (*desc_startup)(struct irq_desc *desc); +void (*desc_shutdown)(struct irq_desc *desc); +void (*desc_enable)(struct irq_desc *desc); +void (*desc_disable)(struct irq_desc *desc); + +void (*desc_ack)(struct irq_desc *desc); +void (*desc_mask)(struct irq_desc *desc); +void (*desc_mask_ack)(struct irq_desc *desc); +void (*desc_unmask)(struct irq_desc *desc); +void (*desc_eoi)(struct irq_desc *desc); + +void (*desc_end)(struct irq_desc *desc); +int (*desc_set_affinity)(struct irq_desc *desc, +const struct cpumask *dest); +int (*desc_retrigger)(struct irq_desc *desc); + +int (*desc_set_type)(struct irq_desc *desc,unsigned int flow_type); +int (*desc_set_wake)(struct irq_desc *desc,unsigned int on); + +void (*desc_bus_lock)(struct irq_desc *desc); +void (*desc_bus_sync_unlock)(struct irq_desc *desc); + +/* Currently used only by UML, might disappear one day.*/ +#ifdef CONFIG_IRQ_RELEASE_METHOD +void (*desc_release)(struct irq_desc *desc,void *dev_id); +#endif +/* * For compatibility, ->typename is copied into ->name. * Will disappear.
@@ -227,6 +256,106 @@ static inline struct irq_desc *move_irq_desc(struct irq_desc *desc, int node)extern struct irq_desc *irq_to_desc_alloc_node (unsigned int irq,int node); +static inline unsigned int +desc_chip_startup (struct irq_chip *chip,unsigned int irq,struct irq_desc *desc) +{ +if (chip->desc_startup) +return chip->desc_startup (desc); +else if (chip->startup) +return chip->startup (irq); +return 0 ; +} +static inline void +desc_chip_shutdown (struct irq_chip *chip,unsigned int irq,struct irq_desc *desc) +{ +if (chip->desc_shutdown) + chip->desc_shutdown (desc); +else if (chip->shutdown) + chip->shutdown (irq); +} +static inline void +desc_chip_enable (struct irq_chip *chip,unsigned int irq,struct irq_desc *desc) +{ +if (chip->desc_enable) + chip->desc_enable (desc); +else if (chip->enable) + chip->enable (irq); +} +static inline void +desc_chip_disable (struct irq_chip *chip,unsigned int irq,struct irq_desc *desc) +{ +if (chip->desc_disable) + chip->desc_disable (desc); +else if (chip->disable) + chip->disable (irq); +} +static inline void +desc_chip_ack (struct irq_chip *chip,unsigned int irq,struct irq_desc *desc) +{ +if (chip->desc_ack) + chip->desc_ack (desc); +else if (chip->ack) + chip->ack (irq); +} +static inline void +desc_chip_mask (struct irq_chip *chip,unsigned int irq,struct irq_desc *desc) +{ +if (chip->desc_mask) + chip->desc_mask (desc); +else if (chip->mask) + chip->mask (irq); +} +static inline void +desc_chip_mask_ack (struct irq_chip *chip,unsigned int irq,struct irq_desc *desc) +{ +if (chip->desc_mask_ack) + chip->desc_mask_ack (desc); +else if (chip->mask_ack) + chip->mask_ack (irq); +} +static inline void +desc_chip_unmask (struct irq_chip *chip,unsigned int irq,struct irq_desc *desc) +{ +if (chip->desc_unmask) + chip->desc_unmask (desc); +else if (chip->unmask) + chip->unmask (irq); +} +static inline void +desc_chip_eoi (struct irq_chip *chip,unsigned int irq,struct irq_desc *desc) +{ +if (chip->desc_eoi) + chip->desc_eoi (desc); +else if (chip->eoi) + chip->eoi (irq); +} +static inline void +desc_chip_end (struct irq_chip *chip,unsigned int irq,struct irq_desc *desc) +{ +if (chip->desc_end) + chip->desc_end (desc); +else if (chip->end) + chip->end (irq); +} +static inline int +desc_chip_set_affinity (struct irq_chip *chip,unsigned int irq,struct irq_desc *desc,const struct cpumask *dest) +{ +if (chip->desc_set_affinity) +return chip->desc_set_affinity (desc, dest); +else if (chip->set_affinity) +return chip->set_affinity (irq, dest); +return 0 ; +} +static inline int +desc_chip_retrigger (struct irq_chip *chip,unsigned int irq,struct irq_desc *desc) +{ +if (chip->desc_retrigger) +return chip->desc_retrigger (desc); +else if (chip->startup) +return chip->retrigger (irq); +return 0 ; +} +/* * Pick up the arch-dependent methods: */
Signature · 1 line
1.6.4.2
PATCH 6/12 genericirq: make irq_chip related function to take desc
In reply to Yinghai Lugeneric code change....
--- include/linux/irq.h | 19 ++++------ include/linux/msi.h | 2 + kernel/irq/autoprobe.c | 13 +++---- kernel/irq/chip.c | 90 +++++++++++++++++++++++++++++++++-------------- kernel/irq/handle.c | 41 ++++++++++++++++++---- kernel/irq/internals.h | 38 ++++++++++++++++---- kernel/irq/manage.c | 67 +++++++++++++++++------------------ kernel/irq/migration.c | 25 ++++++++----- kernel/irq/pm.c | 4 +- kernel/irq/resend.c | 8 ++-- kernel/irq/spurious.c | 4 +- 11 files changed, 200 insertions(+), 111 deletions(-)
include/linux/irq.h +8 -11
@@ -372,20 +372,17 @@ extern void remove_irq(unsigned int irq, struct irqaction *act);void move_native_irq (int irq);void move_masked_irq (int irq); +void move_native_irq_desc (struct irq_desc *desc); +void move_masked_irq_desc (struct irq_desc *desc);#else /* CONFIG_GENERIC_PENDING_IRQ */ -static inline void move_irq (int irq) -{ -} +static inline void move_irq (int irq) { } -static inline void move_native_irq (int irq) -{ -} - -static inline void move_masked_irq (int irq) -{ -} +static inline void move_native_irq (int irq) { } +static inline void move_masked_irq (int irq) { } +static inline void move_native_irq_desc (struct irq_desc *desc) { } +static inline void move_masked_irq_desc (struct irq_desc *desc) { }#endif /* CONFIG_GENERIC_PENDING_IRQ */
@@ -456,7 +453,7 @@ extern void note_interrupt(unsigned int irq, struct irq_desc *desc, irqreturn_t action_ret);/* Resending of interrupts :*/ -void check_irq_resend (struct irq_desc *desc,unsigned int irq); +void check_irq_resend (struct irq_desc *desc);/* Enable/disable irq debugging output: */ extern int noirqdebug_setup (char *str);
include/linux/msi.h +2 -0
@@ -13,6 +13,8 @@ struct msi_msg {struct irq_desc ;extern void mask_msi_irq (unsigned int irq);extern void unmask_msi_irq (unsigned int irq); +void mask_msi_irq_desc (struct irq_desc *); +void unmask_msi_irq_desc (struct irq_desc *);extern void read_msi_msg_desc (struct irq_desc *desc,struct msi_msg *msg);extern void write_msi_msg_desc (struct irq_desc *desc,struct msi_msg *msg);extern void read_msi_msg (unsigned int irq,struct msi_msg *msg);
kernel/irq/autoprobe.c +6 -7
@@ -57,9 +57,8 @@ unsigned long probe_irq_on(void)* Some chips need to know about probing in * progress: */ -if (desc->chip->set_type) - desc->chip->set_type (i,IRQ_TYPE_PROBE ); - desc->chip->startup (i); +desc_chip_set_type (desc->chip, i, desc,IRQ_TYPE_PROBE ); +desc_chip_startup (desc->chip, i, desc); }raw_spin_unlock_irq (&desc->lock); }
@@ -76,7 +75,7 @@ unsigned long probe_irq_on(void)raw_spin_lock_irq (&desc->lock);if (!desc->action && !(desc->status &IRQ_NOPROBE )) { desc->status |=IRQ_AUTODETECT |IRQ_WAITING ; -if (desc->chip->startup (i)) +if (desc_chip_startup (desc->chip, i, desc)) desc->status |=IRQ_PENDING ; }raw_spin_unlock_irq (&desc->lock);
@@ -98,7 +97,7 @@ unsigned long probe_irq_on(void)/* It triggered already - consider it spurious. */ if (!(status &IRQ_WAITING )) { desc->status = status & ~IRQ_AUTODETECT ; - desc->chip->shutdown (i); +desc_chip_shutdown (desc->chip, i, desc); }else if (i <32 ) mask |=1 << i;
@@ -137,7 +136,7 @@ unsigned int probe_irq_mask(unsigned long val) mask |=1 << i; desc->status = status & ~IRQ_AUTODETECT ; - desc->chip->shutdown (i); +desc_chip_shutdown (desc->chip, i, desc); }raw_spin_unlock_irq (&desc->lock); }
@@ -181,7 +180,7 @@ int probe_irq_off(unsigned long val) nr_of_irqs++; } desc->status = status & ~IRQ_AUTODETECT ; - desc->chip->shutdown (i); +desc_chip_shutdown (desc->chip, i, desc); }raw_spin_unlock_irq (&desc->lock); }
kernel/irq/chip.c +63 -27
209 lines not on this page · raw message
kernel/irq/handle.c +34 -7
100 lines not on this page · raw message
kernel/irq/internals.h +30 -8
@@ -12,8 +12,8 @@ extern void compat_irq_chip_set_default_handler(struct irq_desc *desc);extern int __irq_set_trigger (struct irq_desc *desc,unsigned int irq,unsigned long flags); -extern void __disable_irq (struct irq_desc *desc,unsigned int irq,bool susp); -extern void __enable_irq (struct irq_desc *desc,unsigned int irq,bool resume); +extern void __disable_irq (struct irq_desc *desc,bool susp); +extern void __enable_irq (struct irq_desc *desc,bool resume);extern struct lock_class_key irq_desc_lock_class;extern void init_kstat_irqs (struct irq_desc *desc,int node,int nr);
@@ -40,17 +40,39 @@ extern int irq_select_affinity_usr(unsigned int irq);extern void irq_set_thread_affinity (struct irq_desc *desc); +static inline int +desc_chip_set_type (struct irq_chip *chip,unsigned int irq,struct irq_desc *desc,unsigned int flow_type) +{ +if (chip->desc_set_type) +return chip->desc_set_type (desc, flow_type); +else if (chip->set_type) +return chip->set_type (irq, flow_type); +return 0 ; +} +static inline int +desc_chip_set_wake (struct irq_chip *chip,unsigned int irq,struct irq_desc *desc,unsigned int on) +{ +if (chip->desc_set_wake) +return chip->desc_set_wake (desc, on); +else if (chip->set_wake) +return chip->set_wake (irq, on); +return 0 ; +}/* Inline functions for support of irq chips on slow busses */ -static inline void chip_bus_lock (unsigned int irq,struct irq_desc *desc) +static inline void chip_bus_lock (struct irq_desc *desc) { +if (unlikely (desc->chip->desc_bus_lock)) + desc->chip->desc_bus_lock (desc);if (unlikely (desc->chip->bus_lock)) - desc->chip->bus_lock (irq); + desc->chip->bus_lock (desc->irq); } -static inline void chip_bus_sync_unlock (unsigned int irq,struct irq_desc *desc) +static inline void chip_bus_sync_unlock (struct irq_desc *desc) { +if (unlikely (desc->chip->desc_bus_sync_unlock)) + desc->chip->desc_bus_sync_unlock (desc);if (unlikely (desc->chip->bus_sync_unlock)) - desc->chip->bus_sync_unlock (irq); + desc->chip->bus_sync_unlock (desc->irq); }/*
@@ -61,10 +83,10 @@ static inline void chip_bus_sync_unlock(unsigned int irq, struct irq_desc *desc)#define P (f) if (desc->status & f) printk("%14s set\n", #f) -static inline void print_irq_desc (unsigned int irq,struct irq_desc *desc) +static inline void print_irq_desc (struct irq_desc *desc) {printk ("irq %d, desc: %p, depth: %d, count: %d, unhandled: %d\n" , - irq, desc, desc->depth, desc->irq_count, desc->irqs_unhandled); + desc->irq, desc, desc->depth, desc->irq_count, desc->irqs_unhandled);printk ("->handle_irq(): %p, " , desc->handle_irq);print_symbol ("%s\n" , (unsigned long )desc->handle_irq);printk ("->chip(): %p, " , desc->chip);
kernel/irq/manage.c +33 -34
213 lines not on this page · raw message
kernel/irq/migration.c +16 -9
@@ -4,10 +4,8 @@#include "internals.h" -void move_masked_irq (int irq) +void move_masked_irq_desc (struct irq_desc *desc) { -struct irq_desc *desc =irq_to_desc (irq); -if (likely (!(desc->status &IRQ_MOVE_PENDING )))return ;
@@ -43,26 +41,35 @@ void move_masked_irq(int irq)*/ if (likely (cpumask_any_and (desc->pending_mask, cpu_online_mask) < nr_cpu_ids)) -if (!desc->chip->set_affinity (irq, desc->pending_mask)) { +if (!desc_chip_set_affinity (desc->chip, desc->irq, desc, desc->pending_mask)) {cpumask_copy (desc->affinity, desc->pending_mask);irq_set_thread_affinity (desc); }cpumask_clear (desc->pending_mask); } - -void move_native_irq (int irq) +void move_masked_irq (int irq) {struct irq_desc *desc =irq_to_desc (irq); +move_masked_irq_desc (desc); +} + +void move_native_irq_desc (struct irq_desc *desc) +{if (likely (!(desc->status &IRQ_MOVE_PENDING )))return ;if (unlikely (desc->status &IRQ_DISABLED ))return ; - desc->chip->mask (irq); -move_masked_irq (irq); - desc->chip->unmask (irq); +desc_chip_mask (desc->chip, desc->irq, desc); +move_masked_irq_desc (desc); +desc_chip_unmask (desc->chip, desc->irq, desc); } +void move_native_irq (int irq) +{ +struct irq_desc *desc =irq_to_desc (irq); +move_native_irq_desc (desc); +}
kernel/irq/pm.c +2 -2
@@ -29,7 +29,7 @@ void suspend_device_irqs(void)unsigned long flags;raw_spin_lock_irqsave (&desc->lock, flags); -__disable_irq (desc, irq, true); +__disable_irq (desc, true);raw_spin_unlock_irqrestore (&desc->lock, flags); }
@@ -57,7 +57,7 @@ void resume_device_irqs(void)continue ;raw_spin_lock_irqsave (&desc->lock, flags); -__enable_irq (desc, irq, true); +__enable_irq (desc, true);raw_spin_unlock_irqrestore (&desc->lock, flags); } }
kernel/irq/resend.c +4 -4
@@ -53,14 +53,14 @@ static DECLARE_TASKLET(resend_tasklet, resend_irqs, 0);* * Is called with interrupts disabled and desc->lock held. */ -void check_irq_resend (struct irq_desc *desc,unsigned int irq) +void check_irq_resend (struct irq_desc *desc) {unsigned int status = desc->status;/* * Make sure the interrupt is enabled, before resending it: */ - desc->chip->enable (irq); +desc_chip_enable (desc->chip, desc->irq, desc);/* * We do not resend level type interrupts. Level type
@@ -70,10 +70,10 @@ void check_irq_resend(struct irq_desc *desc, unsigned int irq)if ((status & (IRQ_LEVEL |IRQ_PENDING |IRQ_REPLAY )) ==IRQ_PENDING ) { desc->status = (status & ~IRQ_PENDING ) |IRQ_REPLAY ; -if (!desc->chip->retrigger || !desc->chip->retrigger (irq)) { +if (!desc_chip_retrigger (desc->chip, desc->irq, desc)) {#ifdef CONFIG_HARDIRQS_SW_RESEND /* Set it pending and activate the softirq: */ -set_bit (irq, irqs_resend); +set_bit (desc->irq, irqs_resend);tasklet_schedule (&resend_tasklet);#endif }
kernel/irq/spurious.c +2 -2
@@ -79,7 +79,7 @@ static int try_one_irq(int irq, struct irq_desc *desc)* IRQ controller clean up too */ if (work && desc->chip && desc->chip->end) - desc->chip->end (irq); +desc_chip_end (desc->chip, irq, desc);raw_spin_unlock (&desc->lock);return ok;
@@ -254,7 +254,7 @@ void note_interrupt(unsigned int irq, struct irq_desc *desc,printk (KERN_EMERG "Disabling IRQ #%d\n" , irq); desc->status |=IRQ_DISABLED |IRQ_SPURIOUS_DISABLED ; desc->depth++; - desc->chip->disable (irq); +desc_chip_disable (desc->chip, irq, desc);mod_timer (&poll_spurious_irq_timer, jiffies +POLL_SPURIOUS_IRQ_INTERVAL );
Signature · 1 line
1.6.4.2
Re: [PATCH 06/12] genericirq: make irq_chip related function to take desc
kernel/irq/chip.c static void default_shutdown(unsigned int irq) · line 355
Quoted 11 lines · Yinghai Lu
/*
* Fixup enable/disable function pointers */
voidirq_chip_set_defaults(struct irq_chip *chip){kernel/irq/chip.c +6
-0+if (!chip->desc_enable) + chip->desc_enable = default_enable_desc; +if (!chip->desc_disable) + chip->desc_disable = default_disable_desc; +if (!chip->desc_startup) + chip->desc_startup = default_startup_desc;
This will break all irq_chips which implement enable, disable or startup. so the check needs to be:
if (!chip->enable && !chip->desc_enable)
kernel/irq/chip.c static void default_shutdown(unsigned int irq) · line 366
Quoted 11 lines
kernel/irq/chip.c +11
-0+/* +* We use chip->disable, when the user provided its own. When +* we have default_disable set for chip->disable, then we need +* to use default_shutdown, otherwise the irq line is not +* disabled on free_irq(): +*/ +if (!chip->desc_shutdown) + chip->desc_shutdown = chip->desc_disable != default_disable_desc ? + chip->desc_disable : default_shutdown_desc; +if (!chip->desc_end) + chip->desc_end = dummy_irq_chip.desc_end;
Same here.
kernel/irq/handle.c void clear_kstat_irqs(struct irq_desc *desc) · line 295
Quoted 2 lines
kernel/irq/handle.c +0
-0@@ -295,10 +295,14 @@ void clear_kstat_irqs(struct irq_desc *desc)static void ack_bad (unsigned int irq)
Why do we keep that function around ?
Quoted 12 lines
kernel/irq/handle.c +1
-2{struct irq_desc *desc =irq_to_desc (irq); - -print_irq_desc (irq, desc); +print_irq_desc (desc);ack_bad_irq (irq); }/* * Generic no controller implementation
kernel/irq/handle.c struct irq_chip no_irq_chip = { · line 336
Quoted 3 lines
kernel/irq/handle.c +0
-0@@ -323,6 +334,13 @@ struct irq_chip no_irq_chip = { .disable = noop, .ack = ack_bad, .end = noop,
We can remove the old ones right away, can't we ?
kernel/irq/resend.c
Quoted 1 line
kernel/irq/resend.c +0
-0
Yinghai, thanks for doing that. It's halfways reviewable now, but if we go that way it needs to be split further, really.
But to be honest I have to say that the code churn of that patch scares me. I expected it to be less horrible.
So I started twisting my brain around a fully automated method of solving this conversion problem with almost zero risk. It just occured to me that Julia might be able to help and whip up semantic patch rules for doing the conversion automagically on a flag day. That would be one rule and one resulting patch for each of the chip->functions.
So the task would be:
In include/linux/irq.h
struct irq_chip {
const char *name;- unsigned int startup(unsigned int irq);
+ unsigned int startup(struct irq_desc *desc);
Then finding all irq_chip implementations which set that function pointer and fix up the function e.g.:
arch/x86/kernel/apic/io_apic.c:
static struct irq_chip ioapic_chip __read_mostly = {
.name = "IO-APIC",
.startup = startup_ioapic_irq,
-->
-static unsigned int startup_ioapic_irq(unsigned int irq) +static unsigned int startup_ioapic_irq(struct irq_desc *desc)
{
+ unsigned int irq = desc->irq;
int was_pending = 0;
unsigned long flags;
struct irq_cfg *cfg;
raw_spin_lock_irqsave(&ioapic_lock, flags);...
To make it simple, we just can put that right after the opening bracket of the function.
The code which uses the chip functions needs to be changed:
- desc->chip->fun(irq);
+ desc->chip->fun(desc);
That's mostly in kernel/irq/* but there are some users in arch/* lowlevel irq handling code as well.
I have not yet checked whether some place set's the function pointers in the code rather than doing it in the struct definition statically, but the vast majority should be static initializers.
Julia, can this be done with the semantic patcher magic or are you already running away screaming ?
Thanks,
tglx
Re: [PATCH 06/12] genericirq: make irq_chip related function to take desc
Quoted 17 lines · Thomas Gleixner
Review
Quoted 11 lines · Yinghai Lu
/*
* Fixup enable/disable function pointers */
voidirq_chip_set_defaults(struct irq_chip *chip){(quoted diff) +6
-0+ if (!chip->desc_enable) + chip->desc_enable = default_enable_desc; + if (!chip->desc_disable) + chip->desc_disable = default_disable_desc; + if (!chip->desc_startup) + chip->desc_startup = default_startup_desc;This will break all
irq_chipswhich implement enable, disable or startup. so the check needs to be:
Quoted 1 line
if (!chip->enable && !chip->desc_enable)
yes.
Quoted 15 lines
Review
Quoted 12 lines
(quoted diff) +11
-0+ /* + * We use chip->disable, when the user provided its own. When + * we have default_disable set for chip->disable, then we need + * to use default_shutdown, otherwise the irq line is not + * disabled on free_irq(): + */ + if (!chip->desc_shutdown) + chip->desc_shutdown = chip->desc_disable != default_disable_desc ? + chip->desc_disable : default_shutdown_desc; + if (!chip->desc_end) + chip->desc_end = dummy_irq_chip.desc_end;Same here.
Quoted 4 lines
Review void clear_kstat_irqs(struct irq_desc *desc) · line 295
Quoted 2 lines
(quoted diff) +0
-0@@ -295,10 +295,14 @@ void clear_kstat_irqs(struct irq_desc *desc) static void ack_bad(unsigned int irq)Why do we keep that function around ?
that is for other arch...
/*
* Generic no controller implementation
*/
struct irq_chip no_irq_chip = {
.name = "none",
.startup = noop_ret,
.shutdown = noop,
.enable = noop,
.disable = noop,
.ack = ack_bad,
.end = noop, .desc_startup = noop_ret_desc,
.desc_shutdown = noop_desc,
.desc_enable = noop_desc,
.desc_disable = noop_desc,
.desc_ack = ack_bad_desc,
.desc_end = noop_desc,};
Quoted 72 lines
Quoted 13 lines
(quoted diff) +1
-2{ struct irq_desc *desc = irq_to_desc(irq); - - print_irq_desc(irq, desc); + print_irq_desc(desc); ack_bad_irq(irq); } /* * Generic no controller implementationReview struct irq_chip no_irq_chip = { · line 336
Quoted 3 lines
(quoted diff) +0
-0@@ -323,6 +334,13 @@ struct irq_chip no_irq_chip = { .disable = noop, .ack = ack_bad, .end = noop,We can remove the old ones right away, can't we ?
kernel/irq/resend.c
Quoted 1 line
kernel/irq/resend.c +0
-0Yinghai, thanks for doing that. It's halfways reviewable now, but if we go that way it needs to be split further, really.
But to be honest I have to say that the code churn of that patch scares me. I expected it to be less horrible.
So I started twisting my brain around a fully automated method of solving this conversion problem with almost zero risk. It just occured to me that Julia might be able to help and whip up semantic patch rules for doing the conversion automagically on a flag day. That would be one rule and one resulting patch for each of the
chip->functions.So the task would be:
In
include/linux/irq.hstruct irq_chip { const char *name;(quoted diff) +1
-1- unsigned int startup(unsigned int irq); + unsigned int startup(struct irq_desc *desc);Then finding all
irq_chipimplementations which set that function pointer and fix up the function e.g.:
arch/x86/kernel/apic/io_apic.c:static struct
irq_chipioapic_chip__read_mostly= {
.name = "IO-APIC",
.startup =startup_ioapic_irq,-->
(quoted diff) +2
-1-static unsigned int startup_ioapic_irq(unsigned int irq) +static unsigned int startup_ioapic_irq(struct irq_desc *desc) { + unsigned int irq = desc->irq; int was_pending = 0; unsigned long flags; struct irq_cfg *cfg; raw_spin_lock_irqsave(&ioapic_lock, flags);To make it simple, we just can put that right after the opening bracket of the function.
The code which uses the chip functions needs to be changed:
(quoted diff) +1
-1- desc->chip->fun(irq); + desc->chip->fun(desc);
Quoted 2 lines
That's mostly in
kernel/irq/*but there are some users inarch/*lowlevel irq handling code as well.
that is our -v2 version.
YH
Subject: [PATCH -v2.1 2/2] genericirq: change ack/mask in irq_chip to take irq_desc instead of irq
will have
void (*ack)(struct irq_desc *desc); void (*mask)(struct irq_desc *desc); void (*mask_ack)(struct irq_desc *desc); void (*unmask)(struct irq_desc *desc); void (*eoi)(struct irq_desc *desc);
so for sparseirq with raidix tree, we don't call extra irq_to_desc, and could use desc directly
-v2: change all member of irq_chip to use desc only. -v2.1: update after legacy_pic
--- Documentation/DocBook/genericirq.tmpl | 24 ++-- arch/alpha/include/asm/hardirq.h | 3 arch/alpha/kernel/irq.c | 11 +- arch/alpha/kernel/irq_alpha.c | 4 arch/alpha/kernel/irq_i8259.c | 22 ++-- arch/alpha/kernel/irq_impl.h | 10 - arch/alpha/kernel/irq_pyxis.c | 21 ++- arch/alpha/kernel/irq_srm.c | 18 +-- arch/alpha/kernel/sys_alcor.c | 28 ++--- arch/alpha/kernel/sys_cabriolet.c | 18 ++- arch/alpha/kernel/sys_dp264.c | 44 ++++---- arch/alpha/kernel/sys_eb64p.c | 18 ++- arch/alpha/kernel/sys_eiger.c | 18 ++- arch/alpha/kernel/sys_jensen.c | 40 +++---- arch/alpha/kernel/sys_marvel.c | 26 ++-- arch/alpha/kernel/sys_mikasa.c | 18 +-- arch/alpha/kernel/sys_noritake.c | 18 ++- arch/alpha/kernel/sys_rawhide.c | 19 ++- arch/alpha/kernel/sys_rx164.c | 18 +-- arch/alpha/kernel/sys_sable.c | 26 ++-- arch/alpha/kernel/sys_takara.c | 18 ++- arch/alpha/kernel/sys_titan.c | 22 ++-- arch/alpha/kernel/sys_wildfire.c | 32 +++-- arch/arm/common/gic.c | 20 ++- arch/arm/common/it8152.c | 8 + arch/arm/common/locomo.c | 103 ++++++++++++------ arch/arm/common/sa1111.c | 56 ++++++---- arch/arm/common/vic.c | 21 ++- arch/arm/include/asm/hw_irq.h | 3 arch/arm/kernel/ecard.c | 12 +- arch/arm/kernel/irq.c | 4 arch/arm/kernel/smp_twd.c | 6 - arch/arm/mach-aaec2000/core.c | 6 - arch/arm/mach-at91/gpio.c | 17 +-- arch/arm/mach-at91/irq.c | 15 ++ arch/arm/mach-bcmring/irq.c | 24 +++- arch/arm/mach-clps711x/irq.c | 18 ++- arch/arm/mach-davinci/cp_intc.c | 14 +- arch/arm/mach-davinci/gpio.c | 32 ++--- arch/arm/mach-davinci/irq.c | 9 + arch/arm/mach-dove/irq.c | 9 + arch/arm/mach-ebsa110/core.c | 6 - arch/arm/mach-ep93xx/gpio.c | 20 ++- arch/arm/mach-footbridge/common.c | 6 - arch/arm/mach-footbridge/isa-irq.c | 18 ++- arch/arm/mach-gemini/gpio.c | 12 +- arch/arm/mach-gemini/irq.c | 9 + arch/arm/mach-h720x/common.c | 15 +- arch/arm/mach-h720x/cpu-h7202.c | 8 - arch/arm/mach-integrator/integrator_ap.c | 6 - arch/arm/mach-integrator/integrator_cp.c | 18 ++- arch/arm/mach-iop13xx/irq.c | 24 ++-- arch/arm/mach-iop13xx/msi.c | 2 arch/arm/mach-iop32x/irq.c | 6 - arch/arm/mach-ixp2000/core.c | 30 +++-- arch/arm/mach-ixp2000/ixdp2x00.c | 10 + arch/arm/mach-ixp2000/ixdp2x01.c | 10 + arch/arm/mach-ixp23xx/core.c | 25 ++-- arch/arm/mach-ixp23xx/ixdp2351.c | 20 ++- arch/arm/mach-ixp4xx/common.c | 14 +- arch/arm/mach-ks8695/irq.c | 31 +++-- arch/arm/mach-l7200/core.c | 6 - arch/arm/mach-lh7a40x/arch-kev7a400.c | 9 + arch/arm/mach-lh7a40x/arch-lpd7a40x.c | 13 +- arch/arm/mach-lh7a40x/irq-lh7a400.c | 9 + arch/arm/mach-lh7a40x/irq-lh7a404.c | 18 ++- arch/arm/mach-lh7a40x/irq-lpd7a40x.c | 12 +- arch/arm/mach-mmp/irq.c | 8 - arch/arm/mach-mx3/mx31ads.c | 9 + arch/arm/mach-mx3/mx31pdk.c | 11 +- arch/arm/mach-netx/generic.c | 12 +- arch/arm/mach-nomadik/gpio.c | 26 ++-- arch/arm/mach-ns9xxx/board-a9m9750dev.c | 15 +- arch/arm/mach-ns9xxx/irq.c | 15 +- arch/arm/mach-omap1/fpga.c | 14 +- arch/arm/mach-omap1/irq.c | 24 ++-- arch/arm/mach-omap2/irq.c | 14 +- arch/arm/mach-pnx4008/irq.c | 22 ++-- arch/arm/mach-pxa/balloon3.c | 8 - arch/arm/mach-pxa/generic.h | 3 arch/arm/mach-pxa/irq.c | 18 ++- arch/arm/mach-pxa/lpd270.c | 6 - arch/arm/mach-pxa/lubbock.c | 6 - arch/arm/mach-pxa/mainstone.c | 6 - arch/arm/mach-pxa/pcm990-baseboard.c | 6 - arch/arm/mach-pxa/pxa25x.c | 4 arch/arm/mach-pxa/pxa27x.c | 4 arch/arm/mach-pxa/pxa3xx.c | 9 + arch/arm/mach-pxa/viper.c | 9 + arch/arm/mach-pxa/zeus.c | 12 +- arch/arm/mach-rpc/irq.c | 27 +++- arch/arm/mach-s3c2410/bast-irq.c | 24 ++-- arch/arm/mach-s3c2412/irq.c | 39 ++++--- arch/arm/mach-s3c2440/irq.c | 15 +- arch/arm/mach-s3c2443/irq.c | 75 ++++++++----- arch/arm/mach-sa1100/irq.c | 36 ++++-- arch/arm/mach-sa1100/neponset.c | 8 - arch/arm/mach-shark/irq.c | 10 + arch/arm/mach-stmp378x/stmp378x.c | 9 + arch/arm/mach-stmp37xx/stmp37xx.c | 9 + arch/arm/mach-versatile/core.c | 6 - arch/arm/mach-w90x900/irq.c | 8 - arch/arm/oprofile/op_model_mpcore.c | 4 arch/arm/plat-mxc/gpio.c | 12 +- arch/arm/plat-mxc/irq.c | 6 - arch/arm/plat-omap/gpio.c | 37 ++++-- arch/arm/plat-orion/gpio.c | 21 ++- arch/arm/plat-orion/irq.c | 10 + arch/arm/plat-pxa/gpio.c | 12 +- arch/arm/plat-pxa/include/plat/gpio.h | 3 arch/arm/plat-s3c24xx/include/plat/irq.h | 4 arch/arm/plat-s3c24xx/irq-pm.c | 3 arch/arm/plat-s3c24xx/irq.c | 116 ++++++++++++--------- arch/arm/plat-s3c24xx/s3c244x-irq.c | 15 +- arch/arm/plat-s3c64xx/irq-eint.c | 18 ++- arch/arm/plat-s3c64xx/irq.c | 21 ++- arch/arm/plat-s5pc1xx/irq-eint.c | 41 ++++--- arch/arm/plat-s5pc1xx/irq-gpio.c | 18 ++- arch/arm/plat-s5pc1xx/irq.c | 21 ++- arch/arm/plat-stmp3xxx/irq.c | 2 arch/arm/plat-stmp3xxx/pinmux.c | 14 +- arch/avr32/mach-at32ap/extint.c | 26 ++-- arch/avr32/mach-at32ap/pio.c | 9 + arch/blackfin/include/asm/hardirq.h | 3 arch/blackfin/include/asm/ipipe.h | 4 arch/blackfin/kernel/irqchip.c | 4 arch/blackfin/mach-common/ints-priority.c | 59 ++++++---- arch/blackfin/mach-common/smp.c | 2 arch/cris/arch-v10/kernel/irq.c | 16 +- arch/frv/include/asm/hardirq.h | 3 arch/frv/kernel/irq-mb93091.c | 12 +- arch/frv/kernel/irq-mb93093.c | 12 +- arch/frv/kernel/irq-mb93493.c | 8 - arch/frv/kernel/irq.c | 27 ++-- arch/h8300/kernel/irq.c | 14 +- arch/ia64/hp/sim/hpsim_irq.c | 6 - arch/ia64/include/asm/hardirq.h | 2 arch/ia64/kernel/iosapic.c | 41 ++++--- arch/ia64/kernel/irq.c | 10 - arch/ia64/kernel/irq_lsapic.c | 8 - arch/ia64/kernel/msi_ia64.c | 21 ++- arch/ia64/kernel/smpboot.c | 6 - arch/ia64/sn/kernel/irq.c | 25 ++-- arch/ia64/sn/kernel/msi_sn.c | 12 +- arch/m32r/platforms/m32104ut/setup.c | 19 ++- arch/m32r/platforms/m32700ut/setup.c | 92 +++++++++------- arch/m32r/platforms/mappi/setup.c | 23 ++-- arch/m32r/platforms/mappi2/setup.c | 21 ++- arch/m32r/platforms/mappi3/setup.c | 21 ++- arch/m32r/platforms/oaks32r/setup.c | 21 ++- arch/m32r/platforms/opsput/setup.c | 88 +++++++++------- arch/m32r/platforms/usrv/setup.c | 42 ++++--- arch/m68knommu/platform/5249/intc2.c | 9 + arch/m68knommu/platform/5272/intc.c | 11 +- arch/m68knommu/platform/68328/ints.c | 6 - arch/m68knommu/platform/68360/ints.c | 9 + arch/m68knommu/platform/coldfire/intc-2.c | 6 - arch/m68knommu/platform/coldfire/intc-simr.c | 9 + arch/m68knommu/platform/coldfire/intc.c | 8 - arch/microblaze/kernel/intc.c | 15 +- arch/mips/alchemy/common/irq.c | 48 +++++--- arch/mips/ar7/irq.c | 18 ++- arch/mips/bcm63xx/irq.c | 33 +++--- arch/mips/cavium-octeon/octeon-irq.c | 99 ++++++++++-------- arch/mips/dec/ioasic-irq.c | 21 ++- arch/mips/dec/kn02-irq.c | 10 + arch/mips/emma/markeins/irq.c | 24 ++-- arch/mips/include/asm/hardirq.h | 3 arch/mips/jazz/irq.c | 6 - arch/mips/kernel/i8259.c | 15 +- arch/mips/kernel/irq-gic.c | 17 ++- arch/mips/kernel/irq-gt641xx.c | 12 +- arch/mips/kernel/irq-msc01.c | 22 ++-- arch/mips/kernel/irq-rm7000.c | 6 - arch/mips/kernel/irq-rm9000.c | 24 ++-- arch/mips/kernel/irq.c | 3 arch/mips/kernel/irq_cpu.c | 16 +- arch/mips/kernel/irq_txx9.c | 14 +- arch/mips/lasat/interrupt.c | 14 +- arch/mips/loongson/common/bonito-irq.c | 6 - arch/mips/nxp/pnx833x/common/interrupts.c | 33 +++--- arch/mips/nxp/pnx8550/common/int.c | 8 - arch/mips/pmc-sierra/msp71xx/msp_irq_cic.c | 12 +- arch/mips/pmc-sierra/msp71xx/msp_irq_slp.c | 9 + arch/mips/powertv/asic/irq_asic.c | 6 - arch/mips/rb532/irq.c | 28 ++--- arch/mips/sgi-ip22/ip22-int.c | 24 ++-- arch/mips/sgi-ip27/ip27-irq.c | 12 +- arch/mips/sgi-ip27/ip27-timer.c | 4 arch/mips/sgi-ip32/ip32-irq.c | 68 +++++++----- arch/mips/sibyte/bcm1480/irq.c | 28 ++--- arch/mips/sibyte/sb1250/irq.c | 28 ++--- arch/mips/sni/a20r.c | 12 +- arch/mips/sni/pcimt.c | 12 +- arch/mips/sni/pcit.c | 12 +- arch/mips/sni/rm200.c | 21 ++- arch/mips/txx9/generic/irq_tx4939.c | 14 +- arch/mips/txx9/jmr3927/irq.c | 6 - arch/mips/txx9/rbtx4927/irq.c | 10 + arch/mips/txx9/rbtx4938/irq.c | 10 + arch/mips/txx9/rbtx4939/irq.c | 6 - arch/mips/vr41xx/common/icu.c | 12 +- arch/mips/vr41xx/common/irq.c | 8 - arch/mn10300/include/asm/hardirq.h | 2 arch/mn10300/kernel/irq.c | 23 ++-- arch/mn10300/kernel/mn10300-serial.c | 5 arch/parisc/include/asm/irq.h | 11 +- arch/parisc/kernel/irq.c | 43 ++++--- arch/powerpc/include/asm/hardirq.h | 4 arch/powerpc/include/asm/mpic.h | 6 - arch/powerpc/include/asm/qe_ic.h | 6 - arch/powerpc/kernel/crash.c | 4 arch/powerpc/kernel/irq.c | 2 arch/powerpc/platforms/512x/mpc5121_ads_cpld.c | 6 - arch/powerpc/platforms/52xx/media5200.c | 16 +- arch/powerpc/platforms/52xx/mpc52xx_pic.c | 35 ++++-- arch/powerpc/platforms/82xx/pq2ads-pci-pic.c | 6 - arch/powerpc/platforms/85xx/ksi8560.c | 2 arch/powerpc/platforms/85xx/mpc85xx_ads.c | 2 arch/powerpc/platforms/85xx/mpc85xx_ds.c | 2 arch/powerpc/platforms/85xx/sbc8560.c | 2 arch/powerpc/platforms/85xx/socrates_fpga_pic.c | 20 ++- arch/powerpc/platforms/85xx/stx_gp3.c | 2 arch/powerpc/platforms/85xx/tqm85xx.c | 2 arch/powerpc/platforms/86xx/gef_pic.c | 11 +- arch/powerpc/platforms/86xx/pic.c | 2 arch/powerpc/platforms/8xx/m8xx_setup.c | 4 arch/powerpc/platforms/cell/axon_msi.c | 2 arch/powerpc/platforms/cell/beat_interrupt.c | 12 +- arch/powerpc/platforms/cell/interrupt.c | 12 +- arch/powerpc/platforms/cell/setup.c | 2 arch/powerpc/platforms/cell/spider-pic.c | 15 +- arch/powerpc/platforms/chrp/setup.c | 2 arch/powerpc/platforms/embedded6xx/flipper-pic.c | 12 +- arch/powerpc/platforms/embedded6xx/hlwd-pic.c | 26 ++-- arch/powerpc/platforms/iseries/irq.c | 19 ++- arch/powerpc/platforms/powermac/pic.c | 22 ++-- arch/powerpc/platforms/ps3/interrupt.c | 15 +- arch/powerpc/platforms/pseries/setup.c | 2 arch/powerpc/platforms/pseries/xics.c | 27 ++-- arch/powerpc/sysdev/cpm1.c | 9 + arch/powerpc/sysdev/cpm2_pic.c | 18 +-- arch/powerpc/sysdev/fsl_msi.c | 12 +- arch/powerpc/sysdev/i8259.c | 11 +- arch/powerpc/sysdev/ipic.c | 15 +- arch/powerpc/sysdev/mpc8xx_pic.c | 16 +- arch/powerpc/sysdev/mpic.c | 50 +++++---- arch/powerpc/sysdev/mpic.h | 4 arch/powerpc/sysdev/mpic_pasemi_msi.c | 14 +- arch/powerpc/sysdev/mpic_u3msi.c | 12 +- arch/powerpc/sysdev/mv64x60_pic.c | 21 ++- arch/powerpc/sysdev/qe_lib/qe_ic.c | 6 - arch/powerpc/sysdev/tsi108_pci.c | 14 +- arch/powerpc/sysdev/uic.c | 36 +++--- arch/powerpc/sysdev/xilinx_intc.c | 26 ++-- arch/score/kernel/irq.c | 10 + arch/sh/boards/mach-cayman/irq.c | 10 + arch/sh/boards/mach-dreamcast/irq.c | 9 + arch/sh/boards/mach-landisk/irq.c | 6 - arch/sh/boards/mach-microdev/irq.c | 19 ++- arch/sh/boards/mach-se/7206/irq.c | 9 + arch/sh/boards/mach-se/7343/irq.c | 8 - arch/sh/boards/mach-se/7722/irq.c | 8 - arch/sh/boards/mach-se/7724/irq.c | 6 - arch/sh/boards/mach-systemh/irq.c | 16 +- arch/sh/cchips/hd6446x/hd64461.c | 11 +- arch/sh/include/asm/hardirq.h | 3 arch/sh/kernel/cpu/irq/imask.c | 6 - arch/sh/kernel/cpu/irq/intc-sh5.c | 34 +++--- arch/sh/kernel/irq.c | 4 arch/sparc/include/asm/hardirq_64.h | 3 arch/sparc/kernel/irq_64.c | 79 +++++++------- arch/um/kernel/irq.c | 2 arch/x86/include/asm/hardirq.h | 2 arch/x86/include/asm/hpet.h | 8 - arch/x86/include/asm/i8259.h | 2 arch/x86/kernel/apic/io_apic.c | 125 +++++++++-------------- arch/x86/kernel/hpet.c | 16 +- arch/x86/kernel/i8259.c | 31 +++-- arch/x86/kernel/irq.c | 12 +- arch/x86/kernel/uv_irq.c | 12 +- arch/x86/kernel/visws_quirks.c | 29 ++--- arch/x86/kernel/vmiclock_32.c | 8 - arch/x86/lguest/boot.c | 8 - arch/xtensa/include/asm/hardirq.h | 3 arch/xtensa/kernel/irq.c | 26 ++-- arch/xtensa/variants/s6000/gpio.c | 18 ++- drivers/dma/ipu/ipu_irq.c | 18 +-- drivers/gpio/langwell_gpio.c | 11 +- drivers/gpio/pl061.c | 19 ++- drivers/gpio/timbgpio.c | 17 +-- drivers/gpio/vr41xx_giu.c | 32 ++--- drivers/infiniband/hw/ipath/ipath_iba6110.c | 2 drivers/mfd/asic3.c | 27 ++-- drivers/mfd/ezx-pcap.c | 12 +- drivers/mfd/htc-egpio.c | 12 +- drivers/mfd/t7l66xb.c | 8 - drivers/mfd/tc6393xb.c | 14 +- drivers/mfd/twl4030-irq.c | 16 +- drivers/mfd/wm831x-irq.c | 18 +-- drivers/misc/sgi-gru/grufile.c | 2 drivers/parisc/dino.c | 12 +- drivers/parisc/eisa.c | 10 + drivers/parisc/gsc.c | 12 +- drivers/parisc/iosapic.c | 16 +- drivers/parisc/superio.c | 10 + drivers/pci/dmar.c | 16 +- drivers/pci/htirq.c | 22 ++-- drivers/pci/msi.c | 13 +- drivers/vlynq/vlynq.c | 23 ++-- drivers/xen/events.c | 22 ++-- include/asm-generic/hardirq.h | 4 include/linux/dmar.h | 8 - include/linux/htirq.h | 11 +- include/linux/irq.h | 47 ++++---- include/linux/msi.h | 4 kernel/irq/autoprobe.c | 12 +- kernel/irq/chip.c | 60 ++++------- kernel/irq/handle.c | 24 ++-- kernel/irq/internals.h | 16 +- kernel/irq/manage.c | 65 +++++------ kernel/irq/migration.c | 16 +- kernel/irq/pm.c | 4 kernel/irq/resend.c | 8 - kernel/irq/spurious.c | 4 325 files changed, 3194 insertions(+), 2285 deletions(-)
Documentation/DocBook/genericirq.tmpl +12 -12
@@ -233,33 +233,33 @@ are used by the default flow implementations. The following helper functions are implemented (simplified excerpt): <programlisting> -default_enable(irq) +default_enable(desc) { - desc->chip->unmask(irq); + desc->chip->unmask(desc); } -default_disable(irq) +default_disable(desc) { - if (!delay_disable(irq)) - desc->chip->mask(irq); + if (!delay_disable(desc->irq)) + desc->chip->mask(desc); } -default_ack(irq) +default_ack(desc) { - chip->ack(irq); + chip->ack(desc); } -default_mask_ack(irq) +default_mask_ack(desc) { if (chip->mask_ack) { - chip->mask_ack(irq); + chip->mask_ack(desc); } else { - chip->mask(irq); - chip->ack(irq); + chip->mask(desc); + chip->ack(desc); } } -noop(irq) +noop(desc) { }
arch/alpha/kernel/irq.c +6 -5
@@ -33,10 +33,10 @@volatile unsigned long irq_err_count; -void ack_bad_irq (unsigned int irq) +void ack_bad_irq (struct irq_desc *desc) { irq_err_count++; -printk (KERN_CRIT "Unexpected IRQ trap at vector %u\n" , irq); +printk (KERN_CRIT "Unexpected IRQ trap at vector %u\n" , desc->irq); }#ifdef CONFIG_SMP
@@ -46,8 +46,9 @@ int irq_select_affinity(unsigned int irq {static int last_cpu;int cpu = last_cpu +1 ; +struct irq_desc *desc =irq_to_desc (irq); -if (!irq_desc[irq].chip->set_affinity || irq_user_affinity[irq]) +if (!desc->chip->set_affinity || irq_user_affinity[irq])return 1 ; while (!cpu_possible(cpu) ||
@@ -55,8 +56,8 @@ int irq_select_affinity(unsigned int irq cpu = (cpu < (NR_CPUS -1 ) ? cpu +1 :0 ); last_cpu = cpu; -cpumask_copy (irq_desc[irq].affinity,cpumask_of (cpu)); - irq_desc[irq].chip->set_affinity (irq,cpumask_of (cpu)); +cpumask_copy (desc->affinity,cpumask_of (cpu)); + desc->chip->set_affinity (desc,cpumask_of (cpu)); return 0; }#endif /* CONFIG_SMP */
arch/alpha/kernel/irq_alpha.c +2 -2
@@ -218,8 +218,8 @@ process_mcheck_info(unsigned long vector* processed by PALcode, and comes in via entInt vector 1. */ -static void rtc_enable_disable (unsigned int irq) { } -static unsigned int rtc_startup (unsigned int irq) {return 0 ; } +static void rtc_enable_disable (struct irq_desc *desc) { } +static unsigned int rtc_startup (struct irq_desc *desc) {return 0 ; }struct irqaction timer_irqaction = { .handler = timer_interrupt,
arch/alpha/kernel/irq_i8259.c +13 -9
@@ -33,8 +33,10 @@ i8259_update_irq_hw(unsigned int irq, un }inline void -i8259a_enable_irq (unsigned int irq) +i8259a_enable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq; +spin_lock (&i8259_irq_lock);i8259_update_irq_hw (irq, cached_irq_mask &= ~(1 << irq));spin_unlock (&i8259_irq_lock);
@@ -47,16 +49,18 @@ __i8259a_disable_irq(unsigned int irq) }void -i8259a_disable_irq (unsigned int irq) +i8259a_disable_irq (struct irq_desc *desc) {spin_lock (&i8259_irq_lock); -__i8259a_disable_irq (irq); +__i8259a_disable_irq (desc->irq);spin_unlock (&i8259_irq_lock); }void -i8259a_mask_and_ack_irq (unsigned int irq) +i8259a_mask_and_ack_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq; +spin_lock (&i8259_irq_lock);__i8259a_disable_irq (irq);
@@ -70,17 +74,17 @@ i8259a_mask_and_ack_irq(unsigned int irq }unsigned int -i8259a_startup_irq (unsigned int irq) +i8259a_startup_irq (struct irq_desc *desc) { -i8259a_enable_irq (irq); +i8259a_enable_irq (desc);return 0 ;/* never anything pending */ }void -i8259a_end_irq (unsigned int irq) +i8259a_end_irq (struct irq_desc *desc) { -if (!(irq_desc[irq].status & (IRQ_DISABLED |IRQ_INPROGRESS ))) -i8259a_enable_irq (irq); +if (!(desc->status & (IRQ_DISABLED |IRQ_INPROGRESS ))) +i8259a_enable_irq (desc); }struct irq_chip i8259a_irq_type = {
arch/alpha/kernel/irq_pyxis.c +11 -10
@@ -29,34 +29,35 @@ pyxis_update_irq_hw(unsigned long mask) }static inline void -pyxis_enable_irq (unsigned int irq) +pyxis_enable_irq (struct irq_desc *desc) { -pyxis_update_irq_hw (cached_irq_mask |=1UL << (irq -16 )); +pyxis_update_irq_hw (cached_irq_mask |=1UL << (desc->irq -16 )); }static void -pyxis_disable_irq (unsigned int irq) +pyxis_disable_irq (struct irq_desc *desc) { -pyxis_update_irq_hw (cached_irq_mask &= ~(1UL << (irq -16 ))); +pyxis_update_irq_hw (cached_irq_mask &= ~(1UL << (desc->irq -16 ))); }static unsigned int -pyxis_startup_irq (unsigned int irq) +pyxis_startup_irq (struct irq_desc *desc) { -pyxis_enable_irq (irq); +pyxis_enable_irq (desc);return 0 ; }static void -pyxis_end_irq (unsigned int irq) +pyxis_end_irq (struct irq_desc *desc) { -if (!(irq_desc[irq].status & (IRQ_DISABLED |IRQ_INPROGRESS ))) -pyxis_enable_irq (irq); +if (!(desc->status & (IRQ_DISABLED |IRQ_INPROGRESS ))) +pyxis_enable_irq (desc); }static void -pyxis_mask_and_ack_irq (unsigned int irq) +pyxis_mask_and_ack_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned long bit =1UL << (irq -16 );unsigned long mask = cached_irq_mask &= ~bit;
arch/alpha/kernel/irq_srm.c +9 -9
@@ -18,33 +18,33 @@DEFINE_SPINLOCK (srm_irq_lock);static inline void -srm_enable_irq (unsigned int irq) +srm_enable_irq (struct irq_desc *desc) {spin_lock (&srm_irq_lock); -cserve_ena (irq -16 ); +cserve_ena (desc->irq -16 );spin_unlock (&srm_irq_lock); }static void -srm_disable_irq (unsigned int irq) +srm_disable_irq (struct irq_desc *desc) {spin_lock (&srm_irq_lock); -cserve_dis (irq -16 ); +cserve_dis (desc->irq -16 );spin_unlock (&srm_irq_lock); }static unsigned int -srm_startup_irq (unsigned int irq) +srm_startup_irq (struct irq_desc *desc) { -srm_enable_irq (irq); +srm_enable_irq (desc);return 0 ; }static void -srm_end_irq (unsigned int irq) +srm_end_irq (struct irq_desc *desc) { -if (!(irq_desc[irq].status & (IRQ_DISABLED |IRQ_INPROGRESS ))) -srm_enable_irq (irq); +if (!(desc->status & (IRQ_DISABLED |IRQ_INPROGRESS ))) +srm_enable_irq (desc); }/* Handle interrupts from the SRM, assuming no additional weirdness. */
arch/alpha/kernel/sys_alcor.c +14 -14
@@ -44,38 +44,38 @@ alcor_update_irq_hw(unsigned long mask) }static inline void -alcor_enable_irq (unsigned int irq) +alcor_enable_irq (struct irq_desc *desc) { -alcor_update_irq_hw (cached_irq_mask |=1UL << (irq -16 )); +alcor_update_irq_hw (cached_irq_mask |=1UL << (desc->irq -16 )); }static void -alcor_disable_irq (unsigned int irq) +alcor_disable_irq (struct irq_desc *desc) { -alcor_update_irq_hw (cached_irq_mask &= ~(1UL << (irq -16 ))); +alcor_update_irq_hw (cached_irq_mask &= ~(1UL << (desc->irq -16 ))); }static void -alcor_mask_and_ack_irq (unsigned int irq) +alcor_mask_and_ack_irq (struct irq_desc *desc) { -alcor_disable_irq (irq); +alcor_disable_irq (desc);/* On ALCOR/XLT, need to dismiss interrupt via GRU. */ - *(vuip )GRU_INT_CLEAR =1 << (irq -16 );mb (); + *(vuip )GRU_INT_CLEAR =1 << (desc->irq -16 );mb (); *(vuip )GRU_INT_CLEAR =0 ;mb (); }static unsigned int -alcor_startup_irq (unsigned int irq) +alcor_startup_irq (struct irq_desc *desc) { -alcor_enable_irq (irq); +alcor_enable_irq (desc);return 0 ; }static void -alcor_isa_mask_and_ack_irq (unsigned int irq) +alcor_isa_mask_and_ack_irq (struct irq_desc *desc) { -i8259a_mask_and_ack_irq (irq); +i8259a_mask_and_ack_irq (desc);/* On ALCOR/XLT, need to dismiss interrupt via GRU. */ *(vuip )GRU_INT_CLEAR =0x80000000 ;mb ();
@@ -83,10 +83,10 @@ alcor_isa_mask_and_ack_irq(unsigned int }static void -alcor_end_irq (unsigned int irq) +alcor_end_irq (struct irq_desc *desc) { -if (!(irq_desc[irq].status & (IRQ_DISABLED |IRQ_INPROGRESS ))) -alcor_enable_irq (irq); +if (!(desc->status & (IRQ_DISABLED |IRQ_INPROGRESS ))) +alcor_enable_irq (desc); }static struct irq_chip alcor_irq_type = {
arch/alpha/kernel/sys_cabriolet.c +11 -7
@@ -46,29 +46,33 @@ cabriolet_update_irq_hw(unsigned int irq }static inline void -cabriolet_enable_irq (unsigned int irq) +cabriolet_enable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq; +cabriolet_update_irq_hw (irq, cached_irq_mask &= ~(1UL << irq)); }static void -cabriolet_disable_irq (unsigned int irq) +cabriolet_disable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq; +cabriolet_update_irq_hw (irq, cached_irq_mask |=1UL << irq); }static unsigned int -cabriolet_startup_irq (unsigned int irq) +cabriolet_startup_irq (struct irq_desc *desc) { -cabriolet_enable_irq (irq); +cabriolet_enable_irq (desc);return 0 ;/* never anything pending */ }static void -cabriolet_end_irq (unsigned int irq) +cabriolet_end_irq (struct irq_desc *desc) { -if (!(irq_desc[irq].status & (IRQ_DISABLED |IRQ_INPROGRESS ))) -cabriolet_enable_irq (irq); +if (!(desc->status & (IRQ_DISABLED |IRQ_INPROGRESS ))) +cabriolet_enable_irq (desc); }static struct irq_chip cabriolet_irq_type = {
arch/alpha/kernel/sys_dp264.c +22 -22
109 lines not on this page · raw message
arch/alpha/kernel/sys_eb64p.c +11 -7
@@ -44,29 +44,33 @@ eb64p_update_irq_hw(unsigned int irq, un }static inline void -eb64p_enable_irq (unsigned int irq) +eb64p_enable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq; +eb64p_update_irq_hw (irq, cached_irq_mask &= ~(1 << irq)); }static void -eb64p_disable_irq (unsigned int irq) +eb64p_disable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq; +eb64p_update_irq_hw (irq, cached_irq_mask |=1 << irq); }static unsigned int -eb64p_startup_irq (unsigned int irq) +eb64p_startup_irq (struct irq_desc *desc) { -eb64p_enable_irq (irq); +eb64p_enable_irq (desc);return 0 ;/* never anything pending */ }static void -eb64p_end_irq (unsigned int irq) +eb64p_end_irq (struct irq_desc *desc) { -if (!(irq_desc[irq].status & (IRQ_DISABLED |IRQ_INPROGRESS ))) -eb64p_enable_irq (irq); +if (!(desc->status & (IRQ_DISABLED |IRQ_INPROGRESS ))) +eb64p_enable_irq (desc); }static struct irq_chip eb64p_irq_type = {
arch/alpha/kernel/sys_eiger.c +11 -7
@@ -51,33 +51,37 @@ eiger_update_irq_hw(unsigned long irq, u }static inline void -eiger_enable_irq (unsigned int irq) +eiger_enable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned long mask; + mask = (cached_irq_mask[irq >=64 ] &= ~(1UL << (irq &63 )));eiger_update_irq_hw (irq, mask); }static void -eiger_disable_irq (unsigned int irq) +eiger_disable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned long mask; + mask = (cached_irq_mask[irq >=64 ] |=1UL << (irq &63 ));eiger_update_irq_hw (irq, mask); }static unsigned int -eiger_startup_irq (unsigned int irq) +eiger_startup_irq (struct irq_desc *desc) { -eiger_enable_irq (irq); +eiger_enable_irq (desc);return 0 ;/* never anything pending */ }static void -eiger_end_irq (unsigned int irq) +eiger_end_irq (struct irq_desc *desc) { -if (!(irq_desc[irq].status & (IRQ_DISABLED |IRQ_INPROGRESS ))) -eiger_enable_irq (irq); +if (!(irq_desc->status & (IRQ_DISABLED |IRQ_INPROGRESS ))) +eiger_enable_irq (desc); }static struct irq_chip eiger_irq_type = {
arch/alpha/kernel/sys_jensen.c +20 -20
@@ -63,59 +63,59 @@*/ static unsigned int -jensen_local_startup (unsigned int irq) +jensen_local_startup (struct irq_desc *desc) {/* the parport is really hw IRQ 1, silly Jensen. */ -if (irq ==7 ) -i8259a_startup_irq (1 ); +if (desc->irq ==7 ) +i8259a_startup_irq (irq_to_desc (1 ));else /* * For all true local interrupts, set the flag that prevents * the IPL from being dropped during handler processing. */ -if (irq_desc[irq].action) - irq_desc[irq].action->flags |=IRQF_DISABLED ; +if (desc->action) + desc->action->flags |=IRQF_DISABLED ;return 0 ; }static void -jensen_local_shutdown (unsigned int irq) +jensen_local_shutdown (struct irq_desc *desc) {/* the parport is really hw IRQ 1, silly Jensen. */ -if (irq ==7 ) -i8259a_disable_irq (1 ); +if (desc->irq ==7 ) +i8259a_disable_irq (irq_to_desc (1 )); }static void -jensen_local_enable (unsigned int irq) +jensen_local_enable (struct irq_desc *desc) {/* the parport is really hw IRQ 1, silly Jensen. */ -if (irq ==7 ) -i8259a_enable_irq (1 ); +if (desc->irq ==7 ) +i8259a_enable_irq (irq_to_desc (1 )); }static void -jensen_local_disable (unsigned int irq) +jensen_local_disable (struct irq_desc *desc) {/* the parport is really hw IRQ 1, silly Jensen. */ -if (irq ==7 ) -i8259a_disable_irq (1 ); +if (desc->irq ==7 ) +i8259a_disable_irq (irq_to_desc (1 )); }static void -jensen_local_ack (unsigned int irq) +jensen_local_ack (struct irq_desc *desc) {/* the parport is really hw IRQ 1, silly Jensen. */ -if (irq ==7 ) -i8259a_mask_and_ack_irq (1 ); +if (desc->irq ==7 ) +i8259a_mask_and_ack_irq (irq_to_desc (1 )); }static void -jensen_local_end (unsigned int irq) +jensen_local_end (struct irq_desc *desc) {/* the parport is really hw IRQ 1, silly Jensen. */ -if (irq ==7 ) -i8259a_end_irq (1 ); +if (desc->irq ==7 ) +i8259a_end_irq (irq_to_desc (1 )); }static struct irq_chip jensen_local_irq_type = {
arch/alpha/kernel/sys_marvel.c +13 -13
@@ -104,15 +104,15 @@ io7_get_irq_ctl(unsigned int irq, struct }static void -io7_enable_irq (unsigned int irq) +io7_enable_irq (struct irq_desc *desc) {volatile unsigned long *ctl;struct io7 *io7; - ctl =io7_get_irq_ctl (irq, &io7); + ctl =io7_get_irq_ctl (desc->irq, &io7);if (!ctl || !io7) {printk (KERN_ERR "%s: get_ctl failed for irq %x\n" , - __func__, irq); + __func__, desc->irq);return ; }
@@ -124,15 +124,15 @@ io7_enable_irq(unsigned int irq) }static void -io7_disable_irq (unsigned int irq) +io7_disable_irq (struct irq_desc *desc) {volatile unsigned long *ctl;struct io7 *io7; - ctl =io7_get_irq_ctl (irq, &io7); + ctl =io7_get_irq_ctl (desc->irq, &io7);if (!ctl || !io7) {printk (KERN_ERR "%s: get_ctl failed for irq %x\n" , - __func__, irq); + __func__, desc->irq);return ; }
@@ -144,27 +144,27 @@ io7_disable_irq(unsigned int irq) }static unsigned int -io7_startup_irq (unsigned int irq) +io7_startup_irq (struct irq_desc *desc) { -io7_enable_irq (irq); +io7_enable_irq (desc);return 0 ;/* never anything pending */ }static void -io7_end_irq (unsigned int irq) +io7_end_irq (struct irq_desc *desc) { -if (!(irq_desc[irq].status & (IRQ_DISABLED |IRQ_INPROGRESS ))) -io7_enable_irq (irq); +if (!(desc->status & (IRQ_DISABLED |IRQ_INPROGRESS ))) +io7_enable_irq (desc); }static void -marvel_irq_noop (unsigned int irq) +marvel_irq_noop (struct irq_desc *desc) {return ; }static unsigned int -marvel_irq_noop_return (unsigned int irq) +marvel_irq_noop_return (struct irq_desc *desc) {return 0 ; }
arch/alpha/kernel/sys_mikasa.c +9 -9
@@ -43,29 +43,29 @@ mikasa_update_irq_hw(int mask) }static inline void -mikasa_enable_irq (unsigned int irq) +mikasa_enable_irq (struct irq_desc *desc) { -mikasa_update_irq_hw (cached_irq_mask |=1 << (irq -16 )); +mikasa_update_irq_hw (cached_irq_mask |=1 << (desc->irq -16 )); }static void -mikasa_disable_irq (unsigned int irq) +mikasa_disable_irq (struct irq_desc *desc) { -mikasa_update_irq_hw (cached_irq_mask &= ~(1 << (irq -16 ))); +mikasa_update_irq_hw (cached_irq_mask &= ~(1 << (desc->irq -16 ))); }static unsigned int -mikasa_startup_irq (unsigned int irq) +mikasa_startup_irq (struct irq_desc *desc) { -mikasa_enable_irq (irq); +mikasa_enable_irq (desc);return 0 ; }static void -mikasa_end_irq (unsigned int irq) +mikasa_end_irq (struct irq_desc *desc) { -if (!(irq_desc[irq].status & (IRQ_DISABLED |IRQ_INPROGRESS ))) -mikasa_enable_irq (irq); +if (!(desc->status & (IRQ_DISABLED |IRQ_INPROGRESS ))) +mikasa_enable_irq (desc); }static struct irq_chip mikasa_irq_type = {
arch/alpha/kernel/sys_noritake.c +11 -7
@@ -48,29 +48,33 @@ noritake_update_irq_hw(int irq, int mask }static void -noritake_enable_irq (unsigned int irq) +noritake_enable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq; +noritake_update_irq_hw (irq, cached_irq_mask |=1 << (irq -16 )); }static void -noritake_disable_irq (unsigned int irq) +noritake_disable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq; +noritake_update_irq_hw (irq, cached_irq_mask &= ~(1 << (irq -16 ))); }static unsigned int -noritake_startup_irq (unsigned int irq) +noritake_startup_irq (struct irq_desc *desc) { -noritake_enable_irq (irq); +noritake_enable_irq (desc);return 0 ; }static void -noritake_end_irq (unsigned int irq) +noritake_end_irq (struct irq_desc *desc) { -if (!(irq_desc[irq].status & (IRQ_DISABLED |IRQ_INPROGRESS ))) -noritake_enable_irq (irq); +if (!(desc->status & (IRQ_DISABLED |IRQ_INPROGRESS ))) +noritake_enable_irq (desc); }static struct irq_chip noritake_irq_type = {
arch/alpha/kernel/sys_rawhide.c +11 -8
@@ -56,8 +56,9 @@ rawhide_update_irq_hw(int hose, int mask (((h) < MCPCIA_MAX_HOSES) && (cached_irq_masks[(h)] != 0))static inline void -rawhide_enable_irq (unsigned int irq) +rawhide_enable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned int mask, hose; irq -=16 ;
@@ -76,8 +77,9 @@ rawhide_enable_irq(unsigned int irq) }static void -rawhide_disable_irq (unsigned int irq) +rawhide_disable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned int mask, hose; irq -=16 ;
@@ -96,8 +98,9 @@ rawhide_disable_irq(unsigned int irq) }static void -rawhide_mask_and_ack_irq (unsigned int irq) +rawhide_mask_and_ack_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned int mask, mask1, hose; irq -=16 ;
@@ -122,17 +125,17 @@ rawhide_mask_and_ack_irq(unsigned int ir }static unsigned int -rawhide_startup_irq (unsigned int irq) +rawhide_startup_irq (struct irq_desc *desc) { -rawhide_enable_irq (irq); +rawhide_enable_irq (desc);return 0 ; }static void -rawhide_end_irq (unsigned int irq) +rawhide_end_irq (struct irq_desc *desc) { -if (!(irq_desc[irq].status & (IRQ_DISABLED |IRQ_INPROGRESS ))) -rawhide_enable_irq (irq); +if (!(desc->status & (IRQ_DISABLED |IRQ_INPROGRESS ))) +rawhide_enable_irq (desc); }static struct irq_chip rawhide_irq_type = {
arch/alpha/kernel/sys_rx164.c +9 -9
@@ -47,29 +47,29 @@ rx164_update_irq_hw(unsigned long mask) }static inline void -rx164_enable_irq (unsigned int irq) +rx164_enable_irq (struct irq_desc *desc) { -rx164_update_irq_hw (cached_irq_mask |=1UL << (irq -16 )); +rx164_update_irq_hw (cached_irq_mask |=1UL << (desc->irq -16 )); }static void -rx164_disable_irq (unsigned int irq) +rx164_disable_irq (struct irq_desc *desc) { -rx164_update_irq_hw (cached_irq_mask &= ~(1UL << (irq -16 ))); +rx164_update_irq_hw (cached_irq_mask &= ~(1UL << (desc->irq -16 ))); }static unsigned int -rx164_startup_irq (unsigned int irq) +rx164_startup_irq (struct irq_desc *desc) { -rx164_enable_irq (irq); +rx164_enable_irq (desc);return 0 ; }static void -rx164_end_irq (unsigned int irq) +rx164_end_irq (struct irq_desc *desc) { -if (!(irq_desc[irq].status & (IRQ_DISABLED |IRQ_INPROGRESS ))) -rx164_enable_irq (irq); +if (!(desc->status & (IRQ_DISABLED |IRQ_INPROGRESS ))) +rx164_enable_irq (desc); }static struct irq_chip rx164_irq_type = {
arch/alpha/kernel/sys_sable.c +13 -13
@@ -443,57 +443,57 @@ lynx_swizzle(struct pci_dev *dev, u8 *pi/* GENERIC irq routines */ static inline void -sable_lynx_enable_irq (unsigned int irq) +sable_lynx_enable_irq (struct irq_desc *desc) {unsigned long bit, mask; - bit = sable_lynx_irq_swizzle->irq_to_mask[irq]; + bit = sable_lynx_irq_swizzle->irq_to_mask[desc->irq];spin_lock (&sable_lynx_irq_lock); mask = sable_lynx_irq_swizzle->shadow_mask &= ~(1UL << bit); sable_lynx_irq_swizzle->update_irq_hw (bit, mask);spin_unlock (&sable_lynx_irq_lock);#if 0 printk ("%s: mask 0x%lx bit 0x%lx irq 0x%x\n" , - __func__, mask, bit, irq); + __func__, mask, bit, desc->irq);#endif }static void -sable_lynx_disable_irq (unsigned int irq) +sable_lynx_disable_irq (struct irq_desc *desc) {unsigned long bit, mask; - bit = sable_lynx_irq_swizzle->irq_to_mask[irq]; + bit = sable_lynx_irq_swizzle->irq_to_mask[desc->irq];spin_lock (&sable_lynx_irq_lock); mask = sable_lynx_irq_swizzle->shadow_mask |=1UL << bit; sable_lynx_irq_swizzle->update_irq_hw (bit, mask);spin_unlock (&sable_lynx_irq_lock);#if 0 printk ("%s: mask 0x%lx bit 0x%lx irq 0x%x\n" , - __func__, mask, bit, irq); + __func__, mask, bit, desc->irq);#endif }static unsigned int -sable_lynx_startup_irq (unsigned int irq) +sable_lynx_startup_irq (struct irq_desc *desc) { -sable_lynx_enable_irq (irq); +sable_lynx_enable_irq (desc);return 0 ; }static void -sable_lynx_end_irq (unsigned int irq) +sable_lynx_end_irq (struct irq_desc *desc) { -if (!(irq_desc[irq].status & (IRQ_DISABLED |IRQ_INPROGRESS ))) -sable_lynx_enable_irq (irq); +if (!(desc->status & (IRQ_DISABLED |IRQ_INPROGRESS ))) +sable_lynx_enable_irq (desc); }static void -sable_lynx_mask_and_ack_irq (unsigned int irq) +sable_lynx_mask_and_ack_irq (struct irq_desc *desc) {unsigned long bit, mask; - bit = sable_lynx_irq_swizzle->irq_to_mask[irq]; + bit = sable_lynx_irq_swizzle->irq_to_mask[desc->irq];spin_lock (&sable_lynx_irq_lock); mask = sable_lynx_irq_swizzle->shadow_mask |=1UL << bit; sable_lynx_irq_swizzle->update_irq_hw (bit, mask);
arch/alpha/kernel/sys_takara.c +11 -7
@@ -45,33 +45,37 @@ takara_update_irq_hw(unsigned long irq, }static inline void -takara_enable_irq (unsigned int irq) +takara_enable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned long mask; + mask = (cached_irq_mask[irq >=64 ] &= ~(1UL << (irq &63 )));takara_update_irq_hw (irq, mask); }static void -takara_disable_irq (unsigned int irq) +takara_disable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned long mask; + mask = (cached_irq_mask[irq >=64 ] |=1UL << (irq &63 ));takara_update_irq_hw (irq, mask); }static unsigned int -takara_startup_irq (unsigned int irq) +takara_startup_irq (struct irq_desc *desc) { -takara_enable_irq (irq); +takara_enable_irq (desc);return 0 ;/* never anything pending */ }static void -takara_end_irq (unsigned int irq) +takara_end_irq (struct irq_desc *desc) { -if (!(irq_desc[irq].status & (IRQ_DISABLED |IRQ_INPROGRESS ))) -takara_enable_irq (irq); +if (!(desc->status & (IRQ_DISABLED |IRQ_INPROGRESS ))) +takara_enable_irq (desc); }static struct irq_chip takara_irq_type = {
arch/alpha/kernel/sys_titan.c +11 -11
@@ -112,35 +112,35 @@ titan_update_irq_hw(unsigned long mask) }static inline void -titan_enable_irq (unsigned int irq) +titan_enable_irq (struct irq_desc *desc) {spin_lock (&titan_irq_lock); - titan_cached_irq_mask |=1UL << (irq -16 ); + titan_cached_irq_mask |=1UL << (desc->irq -16 );titan_update_irq_hw (titan_cached_irq_mask);spin_unlock (&titan_irq_lock); }static inline void -titan_disable_irq (unsigned int irq) +titan_disable_irq (struct irq_desc *desc) {spin_lock (&titan_irq_lock); - titan_cached_irq_mask &= ~(1UL << (irq -16 )); + titan_cached_irq_mask &= ~(1UL << (desc->irq -16 ));titan_update_irq_hw (titan_cached_irq_mask);spin_unlock (&titan_irq_lock); }static unsigned int -titan_startup_irq (unsigned int irq) +titan_startup_irq (struct irq_desc *desc) { -titan_enable_irq (irq); +titan_enable_irq (desc);return 0 ;/* never anything pending */ }static void -titan_end_irq (unsigned int irq) +titan_end_irq (struct irq_desc *desc) { -if (!(irq_desc[irq].status & (IRQ_DISABLED |IRQ_INPROGRESS ))) -titan_enable_irq (irq); +if (!(desc->status & (IRQ_DISABLED |IRQ_INPROGRESS ))) +titan_enable_irq (desc); } static void
@@ -158,10 +158,10 @@ titan_cpu_set_irq_affinity(unsigned int }static int -titan_set_irq_affinity (unsigned int irq,const struct cpumask *affinity) +titan_set_irq_affinity (struct irq_desc *desc,const struct cpumask *affinity) {spin_lock (&titan_irq_lock); -titan_cpu_set_irq_affinity (irq -16 , *affinity); +titan_cpu_set_irq_affinity (desc->irq -16 , *affinity);titan_update_irq_hw (titan_cached_irq_mask);spin_unlock (&titan_irq_lock);
arch/alpha/kernel/sys_wildfire.c +19 -13
@@ -104,10 +104,12 @@ wildfire_init_irq_hw(void) }static void -wildfire_enable_irq (unsigned int irq) +wildfire_enable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq; +if (irq <16 ) -i8259a_enable_irq (irq); +i8259a_enable_irq (desc);spin_lock (&wildfire_irq_lock);set_bit (irq, &cached_irq_mask);
@@ -116,10 +118,12 @@ wildfire_enable_irq(unsigned int irq) }static void -wildfire_disable_irq (unsigned int irq) +wildfire_disable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq; +if (irq <16 ) -i8259a_disable_irq (irq); +i8259a_disable_irq (desc);spin_lock (&wildfire_irq_lock);clear_bit (irq, &cached_irq_mask);
@@ -128,10 +132,12 @@ wildfire_disable_irq(unsigned int irq) }static void -wildfire_mask_and_ack_irq (unsigned int irq) +wildfire_mask_and_ack_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq; +if (irq <16 ) -i8259a_mask_and_ack_irq (irq); +i8259a_mask_and_ack_irq (desc);spin_lock (&wildfire_irq_lock);clear_bit (irq, &cached_irq_mask);
@@ -140,21 +146,21 @@ wildfire_mask_and_ack_irq(unsigned int i }static unsigned int -wildfire_startup_irq (unsigned int irq) +wildfire_startup_irq (struct irq_desc *desc) { -wildfire_enable_irq (irq); +wildfire_enable_irq (desc);return 0 ;/* never anything pending */ }static void -wildfire_end_irq (unsigned int irq) +wildfire_end_irq (struct irq_desc *desc) {#if 0 -if (!irq_desc[irq].action) -printk ("got irq %d\n" , irq); +if (!desc->action) +printk ("got irq %d\n" , desc->irq);#endif -if (!(irq_desc[irq].status & (IRQ_DISABLED |IRQ_INPROGRESS ))) -wildfire_enable_irq (irq); +if (!(desc->status & (IRQ_DISABLED |IRQ_INPROGRESS ))) +wildfire_enable_irq (desc); }static struct irq_chip wildfire_irq_type = {
arch/arm/common/gic.c +12 -8
@@ -80,8 +80,9 @@ static inline unsigned int gic_irq(unsig* our "acknowledge" routine disable the interrupt, then mark it as * complete. */ -static void gic_ack_irq (unsigned int irq) +static void gic_ack_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;u32 mask =1 << (irq %32 );spin_lock (&irq_controller_lock);
@@ -90,8 +91,9 @@ static void gic_ack_irq(unsigned int irqspin_unlock (&irq_controller_lock); } -static void gic_mask_irq (unsigned int irq) +static void gic_mask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;u32 mask =1 << (irq %32 );spin_lock (&irq_controller_lock);
@@ -99,8 +101,9 @@ static void gic_mask_irq(unsigned int irspin_unlock (&irq_controller_lock); } -static void gic_unmask_irq (unsigned int irq) +static void gic_unmask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;u32 mask =1 << (irq %32 );spin_lock (&irq_controller_lock);
@@ -109,8 +112,9 @@ static void gic_unmask_irq(unsigned int }#ifdef CONFIG_SMP -static int gic_set_cpu (unsigned int irq,const struct cpumask *mask_val) +static int gic_set_cpu (struct irq_desc *desc,const struct cpumask *mask_val) { +unsigned int irq = desc->irq;void __iomem *reg =gic_dist_base (irq) +GIC_DIST_TARGET + (gic_irq (irq) & ~3 );unsigned int shift = (irq %4 ) *8 ;unsigned int cpu =cpumask_first (mask_val);
@@ -129,13 +133,13 @@ static int gic_set_cpu(unsigned int irq,static void gic_handle_cascade_irq (unsigned int irq,struct irq_desc *desc) { -struct gic_chip_data *chip_data =get_irq_data (irq); -struct irq_chip *chip =get_irq_chip (irq); +struct gic_chip_data *chip_data =get_irq_desc_data (desc); +struct irq_chip *chip =get_irq_desc_chip (desc);unsigned int cascade_irq, gic_irq;unsigned long status;/* primary controller ack'ing */ - chip->ack (irq); + chip->ack (desc);spin_lock (&irq_controller_lock); status =readl (chip_data->cpu_base +GIC_CPU_INTACK );
@@ -153,7 +157,7 @@ static void gic_handle_cascade_irq(unsig out:/* primary controller unmasking */ - chip->unmask (irq); + chip->unmask (desc); }static struct irq_chip gic_chip = {
arch/arm/common/it8152.c +6 -2
@@ -32,8 +32,10 @@#define MAX_SLOTS 21 -static void it8152_mask_irq (unsigned int irq) +static void it8152_mask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq; +if (irq >=IT8152_LD_IRQ (0 )) { __raw_writel((__raw_readl(IT8152_INTC_LDCNIMR) | (1 << (irq - IT8152_LD_IRQ(0)))),
@@ -49,8 +51,10 @@ static void it8152_mask_irq(unsigned int } } -static void it8152_unmask_irq (unsigned int irq) +static void it8152_unmask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq; +if (irq >=IT8152_LD_IRQ (0 )) { __raw_writel((__raw_readl(IT8152_INTC_LDCNIMR) & ~(1 << (irq - IT8152_LD_IRQ(0)))),
arch/arm/common/locomo.c +66 -37
251 lines not on this page · raw message
arch/arm/common/sa1111.c +33 -23
146 lines not on this page · raw message
arch/arm/common/vic.c +14 -7
@@ -204,25 +204,31 @@ static void __init vic_pm_register(voidstatic inline void vic_pm_register (void __iomem *base,unsigned int irq,u32 arg1) { }#endif /* CONFIG_PM */ -static void vic_ack_irq (unsigned int irq) +static void vic_ack_irq (struct irq_desc *desc) { -void __iomem *base =get_irq_chip_data (irq); +unsigned int irq = desc->irq; +void __iomem *base =get_irq_desc_chip_data (desc); + irq &=31 ;writel (1 << irq, base +VIC_INT_ENABLE_CLEAR );/* moreover, clear the soft-triggered, in case it was the reason */ writel (1 << irq, base +VIC_INT_SOFT_CLEAR ); } -static void vic_mask_irq (unsigned int irq) +static void vic_mask_irq (struct irq_desc *desc) { -void __iomem *base =get_irq_chip_data (irq); +unsigned int irq = desc->irq; +void __iomem *base =get_irq_desc_chip_data (desc); + irq &=31 ;writel (1 << irq, base +VIC_INT_ENABLE_CLEAR ); } -static void vic_unmask_irq (unsigned int irq) +static void vic_unmask_irq (struct irq_desc *desc) { -void __iomem *base =get_irq_chip_data (irq); +unsigned int irq = desc->irq; +void __iomem *base =get_irq_desc_chip_data (desc); + irq &=31 ;writel (1 << irq, base +VIC_INT_ENABLE ); }
@@ -242,8 +248,9 @@ static struct vic_device *vic_from_irq(ureturn NULL ; } -static int vic_set_wake (unsigned int irq,unsigned int on) +static int vic_set_wake (struct irq_desc *desc,unsigned int on) { +unsigned int irq = desc->irq;struct vic_device *v =vic_from_irq (irq);unsigned int off = irq &31 ;u32 bit =1 << off;
arch/arm/kernel/ecard.c +7 -5
@@ -443,8 +443,9 @@ static expansioncard_ops_t ecard_default* * They are not meant to be called directly, but via enable/disable_irq. */ -static void ecard_irq_unmask (unsigned int irqnr) +static void ecard_irq_unmask (struct irq_desc *desc) { +unsigned int irqnr = desc->irq;ecard_t *ec =slot_to_ecard (irqnr -32 );if (ec) {
@@ -459,8 +460,9 @@ static void ecard_irq_unmask(unsigned in } } -static void ecard_irq_mask (unsigned int irqnr) +static void ecard_irq_mask (struct irq_desc *desc) { +unsigned int irqnr = desc->irq;ecard_t *ec =slot_to_ecard (irqnr -32 );if (ec) {
@@ -551,7 +553,7 @@ static void ecard_check_lockup(struct irprintk (KERN_ERR "\nInterrupt lockup detected - " "disabling all expansion card interrupts\n" ); - desc->chip->mask (IRQ_EXPANSIONCARD ); + desc->chip->mask (irq_to_desc (IRQ_EXPANSIONCARD ));ecard_dump_irq_state (); } }else
@@ -574,7 +576,7 @@ ecard_irq_handler(unsigned int irq, struecard_t *ec;int called =0 ; - desc->chip->mask (irq); + desc->chip->mask (desc);for (ec = cards; ec; ec = ec->next) {int pending;
@@ -591,7 +593,7 @@ ecard_irq_handler(unsigned int irq, stru called ++; } } - desc->chip->unmask (irq); + desc->chip->unmask (desc);if (called ==0 )ecard_check_lockup (desc);
arch/arm/kernel/irq.c +2 -2
@@ -116,7 +116,7 @@ asmlinkage void __exception asm_do_IRQ(uif (unlikely (irq >=NR_IRQS )) {if (printk_ratelimit ())printk (KERN_WARNING "Bad IRQ%u\n" , irq); -ack_bad_irq (irq); +ack_bad_irq (irq_to_desc (irq)); }else {generic_handle_irq (irq); }
@@ -167,7 +167,7 @@ static void route_irq(struct irq_desc *dpr_debug ("IRQ%u: moving from cpu%u to cpu%u\n" , irq, desc->node, cpu);raw_spin_lock_irq (&desc->lock); - desc->chip->set_affinity (irq,cpumask_of (cpu)); + desc->chip->set_affinity (desc,cpumask_of (cpu));raw_spin_unlock_irq (&desc->lock); }
arch/arm/mach-aaec2000/core.c +3 -3
@@ -67,17 +67,17 @@ void __init aaec2000_map_io(void)/* * Interrupt handling routines */ -static void aaec2000_int_ack (unsigned int irq) +static void aaec2000_int_ack (struct irq_desc *desc) {IRQ_INTSR =1 << irq; } -static void aaec2000_int_mask (unsigned int irq) +static void aaec2000_int_mask (struct irq_desc *desc) {IRQ_INTENC |= (1 << irq); } -static void aaec2000_int_unmask (unsigned int irq) +static void aaec2000_int_unmask (struct irq_desc *desc) {IRQ_INTENS |= (1 << irq); }
arch/arm/mach-at91/gpio.c +10 -7
@@ -274,8 +274,9 @@ EXPORT_SYMBOL(at91_get_gpio_value);static u32 wakeups[MAX_GPIO_BANKS ];static u32 backups[MAX_GPIO_BANKS ]; -static int gpio_irq_set_wake (unsigned pin,unsigned state) +static int gpio_irq_set_wake (struct irq_desc *desc,unsigned state) { +unsigned int pin = desc->irq;unsigned mask =pin_to_mask (pin);unsigned bank = (pin -PIN_BASE ) /32 ;
@@ -344,8 +345,9 @@ void at91_gpio_resume(void)* IRQ0..IRQ6 should be configurable, e.g. level vs edge triggering. */ -static void gpio_irq_mask (unsigned pin) +static void gpio_irq_mask (struct irq_desc *desc) { +unsigned int pin = desc->irq;void __iomem *pio =pin_to_controller (pin);unsigned mask =pin_to_mask (pin);
@@ -353,8 +355,9 @@ static void gpio_irq_mask(unsigned pin)__raw_writel (mask, pio +PIO_IDR ); } -static void gpio_irq_unmask (unsigned pin) +static void gpio_irq_unmask (struct irq_desc *desc) { +unsigned int pin = desc->irq;void __iomem *pio =pin_to_controller (pin);unsigned mask =pin_to_mask (pin);
@@ -362,7 +365,7 @@ static void gpio_irq_unmask(unsigned pin__raw_writel (mask, pio +PIO_IER ); } -static int gpio_irq_type (unsigned pin,unsigned type) +static int gpio_irq_type (struct irq_desc *desc,unsigned type) {switch (type) {case IRQ_TYPE_NONE :
@@ -393,7 +396,7 @@ static void gpio_irq_handler(unsigned ir pio = at91_gpio->regbase;/* temporarily mask (level sensitive) parent IRQ */ - desc->chip->ack (irq); + desc->chip->ack (desc);for (;;) {/* Reading ISR acks pending (edge triggered) GPIO interrupts. * When there none are pending, we're finished unless we need
@@ -419,7 +422,7 @@ static void gpio_irq_handler(unsigned ir* another IRQ must be generated before it actually gets * here to be disabled on the GPIO controller. */ -gpio_irq_mask (pin); +gpio_irq_mask (gpio); }else generic_handle_irq (pin);
@@ -429,7 +432,7 @@ static void gpio_irq_handler(unsigned ir isr >>=1 ; } } - desc->chip->unmask (irq); + desc->chip->unmask (desc);/* now it may re-trigger */ }
arch/arm/mach-at91/irq.c +11 -4
@@ -34,14 +34,18 @@#include <asm/mach/map.h> -static void at91_aic_mask_irq (unsigned int irq) +static void at91_aic_mask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq; +/* Disable interrupt on AIC */ at91_sys_write (AT91_AIC_IDCR ,1 << irq); } -static void at91_aic_unmask_irq (unsigned int irq) +static void at91_aic_unmask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq; +/* Enable interrupt on AIC */ at91_sys_write (AT91_AIC_IECR ,1 << irq); }
@@ -50,8 +54,9 @@ unsigned int at91_extern_irq;#define is_extern_irq (irq) ((1 << (irq)) & at91_extern_irq) -static int at91_aic_set_type (unsigned irq,unsigned type) +static int at91_aic_set_type (struct irq_desc *desc,unsigned type) { +unsigned int irq = desc->irq;unsigned int smr, srctype;switch (type) {
@@ -87,8 +92,10 @@ static int at91_aic_set_type(unsigned irstatic u32 wakeups;static u32 backups; -static int at91_aic_set_wake (unsigned irq,unsigned value) +static int at91_aic_set_wake (struct irq_desc *desc,unsigned value) { +unsigned int irq = desc->irq; +if (unlikely (irq >=32 ))return -EINVAL ;
arch/arm/mach-bcmring/irq.c +18 -6
@@ -30,38 +30,50 @@#include <mach/csp/intcHw_reg.h> #include <mach/csp/mm_io.h> -static void bcmring_mask_irq0 (unsigned int irq) +static void bcmring_mask_irq0 (struct irq_desc *desc) { +unsigned int irq = desc->irq; +writel (1 << (irq -IRQ_INTC0_START ),MM_IO_BASE_INTC0 +INTCHW_INTENCLEAR ); } -static void bcmring_unmask_irq0 (unsigned int irq) +static void bcmring_unmask_irq0 (struct irq_desc *desc) { +unsigned int irq = desc->irq; +writel (1 << (irq -IRQ_INTC0_START ),MM_IO_BASE_INTC0 +INTCHW_INTENABLE ); } -static void bcmring_mask_irq1 (unsigned int irq) +static void bcmring_mask_irq1 (struct irq_desc *desc) { +unsigned int irq = desc->irq; +writel (1 << (irq -IRQ_INTC1_START ),MM_IO_BASE_INTC1 +INTCHW_INTENCLEAR ); } -static void bcmring_unmask_irq1 (unsigned int irq) +static void bcmring_unmask_irq1 (struct irq_desc *desc) { +unsigned int irq = desc->irq; +writel (1 << (irq -IRQ_INTC1_START ),MM_IO_BASE_INTC1 +INTCHW_INTENABLE ); } -static void bcmring_mask_irq2 (unsigned int irq) +static void bcmring_mask_irq2 (struct irq_desc *desc) { +unsigned int irq = desc->irq; +writel (1 << (irq -IRQ_SINTC_START ),MM_IO_BASE_SINTC +INTCHW_INTENCLEAR ); } -static void bcmring_unmask_irq2 (unsigned int irq) +static void bcmring_unmask_irq2 (struct irq_desc *desc) { +unsigned int irq = desc->irq; +writel (1 << (irq -IRQ_SINTC_START ),MM_IO_BASE_SINTC +INTCHW_INTENABLE ); }
arch/arm/mach-clps711x/irq.c +12 -6
@@ -27,8 +27,9 @@#include <asm/hardware/clps7111.h> -static void int1_mask (unsigned int irq) +static void int1_mask (struct irq_desc *desc) { +unsigned int irq = desc->irq;u32 intmr1; intmr1 =clps_readl (INTMR1 );
@@ -36,8 +37,9 @@ static void int1_mask(unsigned int irq)clps_writel (intmr1,INTMR1 ); } -static void int1_ack (unsigned int irq) +static void int1_ack (struct irq_desc *desc) { +unsigned int irq = desc->irq;u32 intmr1; intmr1 =clps_readl (INTMR1 );
@@ -54,8 +56,9 @@ static void int1_ack(unsigned int irq) } } -static void int1_unmask (unsigned int irq) +static void int1_unmask (struct irq_desc *desc) { +unsigned int irq = desc->irq;u32 intmr1; intmr1 =clps_readl (INTMR1 );
@@ -69,8 +72,9 @@ static struct irq_chip int1_chip = { .unmask = int1_unmask, }; -static void int2_mask (unsigned int irq) +static void int2_mask (struct irq_desc *desc) { +unsigned int irq = desc->irq;u32 intmr2; intmr2 =clps_readl (INTMR2 );
@@ -78,8 +82,9 @@ static void int2_mask(unsigned int irq)clps_writel (intmr2,INTMR2 ); } -static void int2_ack (unsigned int irq) +static void int2_ack (struct irq_desc *desc) { +unsigned int irq = desc->irq;u32 intmr2; intmr2 =clps_readl (INTMR2 );
@@ -91,8 +96,9 @@ static void int2_ack(unsigned int irq) } } -static void int2_unmask (unsigned int irq) +static void int2_unmask (struct irq_desc *desc) { +unsigned int irq = desc->irq;u32 intmr2; intmr2 =clps_readl (INTMR2 );
arch/arm/mach-davinci/cp_intc.c +9 -5
@@ -27,14 +27,16 @@ static inline void cp_intc_write(unsigne__raw_writel (value, cp_intc_base + offset); } -static void cp_intc_ack_irq (unsigned int irq) +static void cp_intc_ack_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;cp_intc_write (irq,CP_INTC_SYS_STAT_IDX_CLR ); }/* Disable interrupt */ -static void cp_intc_mask_irq (unsigned int irq) +static void cp_intc_mask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;/* XXX don't know why we need to disable nIRQ here... */ cp_intc_write (1 ,CP_INTC_HOST_ENABLE_IDX_CLR );cp_intc_write (irq,CP_INTC_SYS_ENABLE_IDX_CLR );
@@ -42,13 +44,15 @@ static void cp_intc_mask_irq(unsigned in }/* Enable interrupt */ -static void cp_intc_unmask_irq (unsigned int irq) +static void cp_intc_unmask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;cp_intc_write (irq,CP_INTC_SYS_ENABLE_IDX_SET ); } -static int cp_intc_set_irq_type (unsigned int irq,unsigned int flow_type) +static int cp_intc_set_irq_type (struct irq_desc *desc,unsigned int flow_type) { +unsigned int irq = desc->irq;unsigned reg =BIT_WORD (irq);unsigned mask =BIT_MASK (irq);unsigned polarity =cp_intc_read (CP_INTC_SYS_POLARITY (reg));
@@ -86,7 +90,7 @@ static int cp_intc_set_irq_type(unsigned* generic drivers which call {enable|disable}_irq_wake for * wake up interrupt sources (eg RTC on DA850). */ -static int cp_intc_set_wake (unsigned int irq,unsigned int on) +static int cp_intc_set_wake (struct irq_desc *desc,unsigned int on) {return 0 ; }
arch/arm/mach-davinci/gpio.c +16 -16
@@ -159,20 +159,20 @@ pure_initcall(davinci_gpio_setup);* serve as EDMA event triggers. */ -static void gpio_irq_disable (unsigned irq) +static void gpio_irq_disable (struct irq_desc *desc) { -struct gpio_controller *__iomem g =get_irq_chip_data (irq); -u32 mask = (u32 )get_irq_data (irq); +struct gpio_controller *__iomem g =get_irq_desc_chip_data (desc); +u32 mask = (u32 )get_irq_desc_data (desc);__raw_writel (mask, &g->clr_falling);__raw_writel (mask, &g->clr_rising); } -static void gpio_irq_enable (unsigned irq) +static void gpio_irq_enable (struct irq_desc *desc) { -struct gpio_controller *__iomem g =get_irq_chip_data (irq); -u32 mask = (u32 )get_irq_data (irq); -unsigned status = irq_desc[irq].status; +struct gpio_controller *__iomem g =get_irq_desc_chip_data (desc); +u32 mask = (u32 )get_irq_desc_data (desc); +unsigned status = desc->status; status &=IRQ_TYPE_EDGE_FALLING |IRQ_TYPE_EDGE_RISING ;if (!status)
@@ -184,19 +184,19 @@ static void gpio_irq_enable(unsigned irq__raw_writel (mask, &g->set_rising); } -static int gpio_irq_type (unsigned irq,unsigned trigger) +static int gpio_irq_type (struct irq_desc *desc,unsigned trigger) { -struct gpio_controller *__iomem g =get_irq_chip_data (irq); -u32 mask = (u32 )get_irq_data (irq); +struct gpio_controller *__iomem g =get_irq_desc_chip_data (desc); +u32 mask = (u32 )get_irq_desc_data (desc);if (trigger & ~(IRQ_TYPE_EDGE_FALLING |IRQ_TYPE_EDGE_RISING ))return -EINVAL ; - irq_desc[irq].status &= ~IRQ_TYPE_SENSE_MASK ; - irq_desc[irq].status |= trigger; + desc->status &= ~IRQ_TYPE_SENSE_MASK ; + desc->status |= trigger;/* don't enable the IRQ if it's currently disabled */ -if (irq_desc[irq].depth ==0 ) { +if (desc->depth ==0 ) {__raw_writel (mask, (trigger &IRQ_TYPE_EDGE_FALLING ) ? &g->set_falling : &g->clr_falling); __raw_writel(mask, (trigger & IRQ_TYPE_EDGE_RISING)
@@ -223,8 +223,8 @@ gpio_irq_handler(unsigned irq, struct ir mask <<=16 ;/* temporarily mask (level sensitive) parent IRQ */ - desc->chip->mask (irq); - desc->chip->ack (irq); + desc->chip->mask (desc); + desc->chip->ack (desc);while (1 ) {u32 status;int n;
@@ -247,7 +247,7 @@ gpio_irq_handler(unsigned irq, struct ir status >>= res; } } - desc->chip->unmask (irq); + desc->chip->unmask (desc);/* now it may re-trigger */ }
arch/arm/mach-davinci/irq.c +6 -3
@@ -53,8 +53,9 @@ static inline void davinci_irq_writel(un }/* Disable interrupt */ -static void davinci_mask_irq (unsigned int irq) +static void davinci_mask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned int mask;u32 l;
@@ -72,8 +73,9 @@ static void davinci_mask_irq(unsigned in }/* Enable interrupt */ -static void davinci_unmask_irq (unsigned int irq) +static void davinci_unmask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned int mask;u32 l;
@@ -91,8 +93,9 @@ static void davinci_unmask_irq(unsigned }/* EOI interrupt */ -static void davinci_ack_irq (unsigned int irq) +static void davinci_ack_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned int mask; mask =1 <<IRQ_BIT (irq);
arch/arm/mach-dove/irq.c +6 -3
@@ -36,8 +36,9 @@ static void gpio_irq_handler(unsigned in } } -static void pmu_irq_mask (unsigned int irq) +static void pmu_irq_mask (struct irq_desc *desc) { +unsigned int irq = desc->irq;int pin =irq_to_pmu (irq);u32 u;
@@ -46,8 +47,9 @@ static void pmu_irq_mask(unsigned int irwritel (u,PMU_INTERRUPT_MASK ); } -static void pmu_irq_unmask (unsigned int irq) +static void pmu_irq_unmask (struct irq_desc *desc) { +unsigned int irq = desc->irq;int pin =irq_to_pmu (irq);u32 u;
@@ -56,8 +58,9 @@ static void pmu_irq_unmask(unsigned intwritel (u,PMU_INTERRUPT_MASK ); } -static void pmu_irq_ack (unsigned int irq) +static void pmu_irq_ack (struct irq_desc *desc) { +unsigned int irq = desc->irq;int pin =irq_to_pmu (irq);u32 u;
arch/arm/mach-ebsa110/core.c +4 -2
@@ -35,13 +35,15 @@#define IRQ_STAT 0xff000000/* read */ #define IRQ_MCLR 0xff000000/* write */ -static void ebsa110_mask_irq (unsigned int irq) +static void ebsa110_mask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;__raw_writeb (1 << irq,IRQ_MCLR ); } -static void ebsa110_unmask_irq (unsigned int irq) +static void ebsa110_unmask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;__raw_writeb (1 << irq,IRQ_MSET ); }
arch/arm/mach-footbridge/common.c +4 -2
@@ -75,13 +75,15 @@ static const int fb_irq_mask[] = { IRQ_MASK_PCI_PERR, /* 19 */ }; -static void fb_mask_irq (unsigned int irq) +static void fb_mask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq; *CSR_IRQ_DISABLE = fb_irq_mask[_DC21285_INR (irq)]; } -static void fb_unmask_irq (unsigned int irq) +static void fb_unmask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq; *CSR_IRQ_ENABLE = fb_irq_mask[_DC21285_INR (irq)]; }
arch/arm/mach-footbridge/isa-irq.c +12 -6
@@ -30,23 +30,26 @@#include "common.h" -static void isa_mask_pic_lo_irq (unsigned int irq) +static void isa_mask_pic_lo_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned int mask =1 << (irq &7 );outb (inb (PIC_MASK_LO ) | mask,PIC_MASK_LO ); } -static void isa_ack_pic_lo_irq (unsigned int irq) +static void isa_ack_pic_lo_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned int mask =1 << (irq &7 );outb (inb (PIC_MASK_LO ) | mask,PIC_MASK_LO );outb (0x20 ,PIC_LO ); } -static void isa_unmask_pic_lo_irq (unsigned int irq) +static void isa_unmask_pic_lo_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned int mask =1 << (irq &7 );outb (inb (PIC_MASK_LO ) & ~mask,PIC_MASK_LO );
@@ -58,15 +61,17 @@ static struct irq_chip isa_lo_chip = { .unmask = isa_unmask_pic_lo_irq, }; -static void isa_mask_pic_hi_irq (unsigned int irq) +static void isa_mask_pic_hi_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned int mask =1 << (irq &7 );outb (inb (PIC_MASK_HI ) | mask,PIC_MASK_HI ); } -static void isa_ack_pic_hi_irq (unsigned int irq) +static void isa_ack_pic_hi_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned int mask =1 << (irq &7 );outb (inb (PIC_MASK_HI ) | mask,PIC_MASK_HI );
@@ -74,8 +79,9 @@ static void isa_ack_pic_hi_irq(unsignedoutb (0x20 ,PIC_HI ); } -static void isa_unmask_pic_hi_irq (unsigned int irq) +static void isa_unmask_pic_hi_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned int mask =1 << (irq &7 );outb (inb (PIC_MASK_HI ) & ~mask,PIC_MASK_HI );
arch/arm/mach-gemini/gpio.c +8 -4
@@ -54,24 +54,27 @@ static void _set_gpio_irqenable(unsigned__raw_writel (reg, base +GPIO_INT_EN ); } -static void gpio_ack_irq (unsigned int irq) +static void gpio_ack_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned int gpio =irq_to_gpio (irq);unsigned int base =GPIO_BASE (gpio /32 );__raw_writel (1 << (gpio %32 ), base +GPIO_INT_CLR ); } -static void gpio_mask_irq (unsigned int irq) +static void gpio_mask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned int gpio =irq_to_gpio (irq);unsigned int base =GPIO_BASE (gpio /32 );_set_gpio_irqenable (base, gpio %32 ,0 ); } -static void gpio_unmask_irq (unsigned int irq) +static void gpio_unmask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned int gpio =irq_to_gpio (irq);unsigned int base =GPIO_BASE (gpio /32 );
@@ -80,6 +83,7 @@ static void gpio_unmask_irq(unsigned intstatic int gpio_set_irq_type (unsigned int irq,unsigned int type) { +unsigned int irq = desc->irq;unsigned int gpio =irq_to_gpio (irq);unsigned int gpio_mask =1 << (gpio %32 );unsigned int base =GPIO_BASE (gpio /32 );
@@ -120,7 +124,7 @@ static int gpio_set_irq_type(unsigned in__raw_writel (reg_level, base +GPIO_INT_LEVEL );__raw_writel (reg_both, base +GPIO_INT_BOTH_EDGE ); -gpio_ack_irq (irq); +gpio_ack_irq (desc);return 0 ; }
arch/arm/mach-gemini/irq.c +6 -3
@@ -32,13 +32,15 @@#define FIQ_LEVEL (base_addr) (base_addr + 0x30)#define FIQ_STATUS (base_addr) (base_addr + 0x34) -static void gemini_ack_irq (unsigned int irq) +static void gemini_ack_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;__raw_writel (1 << irq,IRQ_CLEAR (IO_ADDRESS (GEMINI_INTERRUPT_BASE ))); } -static void gemini_mask_irq (unsigned int irq) +static void gemini_mask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned int mask; mask =__raw_readl (IRQ_MASK (IO_ADDRESS (GEMINI_INTERRUPT_BASE )));
@@ -46,8 +48,9 @@ static void gemini_mask_irq(unsigned int__raw_writel (mask,IRQ_MASK (IO_ADDRESS (GEMINI_INTERRUPT_BASE ))); } -static void gemini_unmask_irq (unsigned int irq) +static void gemini_unmask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned int mask; mask =__raw_readl (IRQ_MASK (IO_ADDRESS (GEMINI_INTERRUPT_BASE )));
arch/arm/mach-h720x/common.c +10 -5
@@ -53,16 +53,18 @@ unsigned long h720x_gettimeoffset(void)/* * mask Global irq's */ -static void mask_global_irq (unsigned int irq ) +static void mask_global_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;CPU_REG (IRQC_VIRT ,IRQC_IER ) &= ~(1 << irq); }/* * unmask Global irq's */ -static void unmask_global_irq (unsigned int irq ) +static void unmask_global_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;CPU_REG (IRQC_VIRT ,IRQC_IER ) |= (1 << irq); }
@@ -71,8 +73,9 @@ static void unmask_global_irq (unsigned* ack GPIO irq's * Ack only for edge triggered int's valid */ -static void inline ack_gpio_irq (u32 irq) +static inline void ack_gpio_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;u32 reg_base =GPIO_VIRT (IRQ_TO_REGNO (irq));u32 bit =IRQ_TO_BIT (irq);if ( (CPU_REG (reg_base,GPIO_EDGE ) & bit))
@@ -82,8 +85,9 @@ static void inline ack_gpio_irq(u32 irq)/* * mask GPIO irq's */ -static void inline mask_gpio_irq (u32 irq) +static inline void mask_gpio_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;u32 reg_base =GPIO_VIRT (IRQ_TO_REGNO (irq));u32 bit =IRQ_TO_BIT (irq);CPU_REG (reg_base,GPIO_MASK ) &= ~bit;
@@ -92,8 +96,9 @@ static void inline mask_gpio_irq(u32 irq/* * unmask GPIO irq's */ -static void inline unmask_gpio_irq (u32 irq) +static inline void unmask_gpio_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;u32 reg_base =GPIO_VIRT (IRQ_TO_REGNO (irq));u32 bit =IRQ_TO_BIT (irq);CPU_REG (reg_base,GPIO_MASK ) |= bit;
arch/arm/mach-h720x/cpu-h7202.c +5 -3
@@ -141,8 +141,9 @@ h7202_timer_interrupt(int irq, void *dev/* * mask multiplexed timer IRQs */ -static void inline mask_timerx_irq (u32 irq) +static inline void mask_timerx_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned int bit; bit =2 << ((irq ==IRQ_TIMER64B ) ?4 : (irq -IRQ_TIMER1 ));CPU_REG (TIMER_VIRT ,TIMER_TOPCTRL ) &= ~bit;
@@ -151,8 +152,9 @@ static void inline mask_timerx_irq (u32/* * unmask multiplexed timer IRQs */ -static void inline unmask_timerx_irq (u32 irq) +static inline void unmask_timerx_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned int bit; bit =2 << ((irq ==IRQ_TIMER64B ) ?4 : (irq -IRQ_TIMER1 ));CPU_REG (TIMER_VIRT ,TIMER_TOPCTRL ) |= bit;
@@ -196,7 +198,7 @@ void __init h7202_init_irq (void)for (irq =IRQ_TIMER1 ; irq <IRQ_CHAINED_TIMERX (NR_TIMERX_IRQS ); irq++) { -mask_timerx_irq (irq); +mask_timerx_irq (irq_to_desc (irq));set_irq_chip (irq, &h7202_timerx_chip);set_irq_handler (irq, handle_edge_irq);set_irq_flags (irq,IRQF_VALID );
arch/arm/mach-integrator/integrator_ap.c +4 -2
@@ -151,13 +151,15 @@ static void __init ap_map_io(void)#define INTEGRATOR_SC_VALID_INT 0x003fffff -static void sc_mask_irq (unsigned int irq) +static void sc_mask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;writel (1 << irq,VA_IC_BASE +IRQ_ENABLE_CLEAR ); } -static void sc_unmask_irq (unsigned int irq) +static void sc_unmask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;writel (1 << irq,VA_IC_BASE +IRQ_ENABLE_SET ); }
arch/arm/mach-integrator/integrator_cp.c +12 -6
@@ -145,14 +145,16 @@ static void __init intcp_map_io(void)#define sic_writel __raw_writel#define sic_readl __raw_readl -static void cic_mask_irq (unsigned int irq) +static void cic_mask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq; irq -=IRQ_CIC_START ;cic_writel (1 << irq,INTCP_VA_CIC_BASE +IRQ_ENABLE_CLEAR ); } -static void cic_unmask_irq (unsigned int irq) +static void cic_unmask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq; irq -=IRQ_CIC_START ;cic_writel (1 << irq,INTCP_VA_CIC_BASE +IRQ_ENABLE_SET ); }
@@ -164,14 +166,16 @@ static struct irq_chip cic_chip = { .unmask = cic_unmask_irq, }; -static void pic_mask_irq (unsigned int irq) +static void pic_mask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq; irq -=IRQ_PIC_START ;pic_writel (1 << irq,INTCP_VA_PIC_BASE +IRQ_ENABLE_CLEAR ); } -static void pic_unmask_irq (unsigned int irq) +static void pic_unmask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq; irq -=IRQ_PIC_START ;pic_writel (1 << irq,INTCP_VA_PIC_BASE +IRQ_ENABLE_SET ); }
@@ -183,14 +187,16 @@ static struct irq_chip pic_chip = { .unmask = pic_unmask_irq, }; -static void sic_mask_irq (unsigned int irq) +static void sic_mask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq; irq -=IRQ_SIC_START ;sic_writel (1 << irq,INTCP_VA_SIC_BASE +IRQ_ENABLE_CLEAR ); } -static void sic_unmask_irq (unsigned int irq) +static void sic_unmask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq; irq -=IRQ_SIC_START ;sic_writel (1 << irq,INTCP_VA_SIC_BASE +IRQ_ENABLE_SET ); }
arch/arm/mach-iop13xx/irq.c +16 -8
@@ -123,50 +123,58 @@ static void write_intsize(u32 val)/* 0 = Interrupt Masked and 1 = Interrupt not masked */ static void -iop13xx_irq_mask0 (unsigned int irq) +iop13xx_irq_mask0 (struct irq_desc *desc) { +unsigned int irq = desc->irq;write_intctl_0 (read_intctl_0 () & ~(1 << (irq -0 ))); }static void -iop13xx_irq_mask1 (unsigned int irq) +iop13xx_irq_mask1 (struct irq_desc *desc) { +unsigned int irq = desc->irq;write_intctl_1 (read_intctl_1 () & ~(1 << (irq -32 ))); }static void -iop13xx_irq_mask2 (unsigned int irq) +iop13xx_irq_mask2 (struct irq_desc *desc) { +unsigned int irq = desc->irq;write_intctl_2 (read_intctl_2 () & ~(1 << (irq -64 ))); }static void -iop13xx_irq_mask3 (unsigned int irq) +iop13xx_irq_mask3 (struct irq_desc *desc) { +unsigned int irq = desc->irq;write_intctl_3 (read_intctl_3 () & ~(1 << (irq -96 ))); }static void -iop13xx_irq_unmask0 (unsigned int irq) +iop13xx_irq_unmask0 (struct irq_desc *desc) { +unsigned int irq = desc->irq;write_intctl_0 (read_intctl_0 () | (1 << (irq -0 ))); }static void -iop13xx_irq_unmask1 (unsigned int irq) +iop13xx_irq_unmask1 (struct irq_desc *desc) { +unsigned int irq = desc->irq;write_intctl_1 (read_intctl_1 () | (1 << (irq -32 ))); }static void -iop13xx_irq_unmask2 (unsigned int irq) +iop13xx_irq_unmask2 (struct irq_desc *desc) { +unsigned int irq = desc->irq;write_intctl_2 (read_intctl_2 () | (1 << (irq -64 ))); }static void -iop13xx_irq_unmask3 (unsigned int irq) +iop13xx_irq_unmask3 (struct irq_desc *desc) { +unsigned int irq = desc->irq;write_intctl_3 (read_intctl_3 () | (1 << (irq -96 ))); }
arch/arm/mach-iop13xx/msi.c +1 -1
@@ -156,7 +156,7 @@ void arch_teardown_msi_irq(unsigned intdestroy_irq (irq); } -static void iop13xx_msi_nop (unsigned int irq) +static void iop13xx_msi_nop (struct irq_desc *desc) {return ; }
arch/arm/mach-iop32x/irq.c +4 -2
@@ -32,15 +32,17 @@ static void intstr_write(u32 val) }static void -iop32x_irq_mask (unsigned int irq) +iop32x_irq_mask (struct irq_desc *desc) { +unsigned int irq = desc->irq; iop32x_mask &= ~(1 << irq);intctl_write (iop32x_mask); }static void -iop32x_irq_unmask (unsigned int irq) +iop32x_irq_unmask (struct irq_desc *desc) { +unsigned int irq = desc->irq; iop32x_mask |=1 << irq;intctl_write (iop32x_mask); }
arch/arm/mach-ixp2000/core.c +20 -10
@@ -309,8 +309,9 @@ static void ixp2000_GPIO_irq_handler(uns } } -static int ixp2000_GPIO_irq_type (unsigned int irq,unsigned int type) +static int ixp2000_GPIO_irq_type (struct irq_desc *desc,unsigned int type) { +unsigned int irq = desc->irq;int line = irq -IRQ_IXP2000_GPIO0 ;/*
@@ -342,8 +343,9 @@ static int ixp2000_GPIO_irq_type(unsignereturn 0 ; } -static void ixp2000_GPIO_irq_mask_ack (unsigned int irq) +static void ixp2000_GPIO_irq_mask_ack (struct irq_desc *desc) { +unsigned int irq = desc->irq;ixp2000_reg_write (IXP2000_GPIO_INCR , (1 << (irq -IRQ_IXP2000_GPIO0 )));ixp2000_reg_write (IXP2000_GPIO_EDSR , (1 << (irq -IRQ_IXP2000_GPIO0 )));
@@ -351,13 +353,15 @@ static void ixp2000_GPIO_irq_mask_ack(unixp2000_reg_wrb (IXP2000_GPIO_INST , (1 << (irq -IRQ_IXP2000_GPIO0 ))); } -static void ixp2000_GPIO_irq_mask (unsigned int irq) +static void ixp2000_GPIO_irq_mask (struct irq_desc *desc) { +unsigned int irq = desc->irq;ixp2000_reg_wrb (IXP2000_GPIO_INCR , (1 << (irq -IRQ_IXP2000_GPIO0 ))); } -static void ixp2000_GPIO_irq_unmask (unsigned int irq) +static void ixp2000_GPIO_irq_unmask (struct irq_desc *desc) { +unsigned int irq = desc->irq;ixp2000_reg_write (IXP2000_GPIO_INSR , (1 << (irq -IRQ_IXP2000_GPIO0 ))); }
@@ -368,8 +372,9 @@ static struct irq_chip ixp2000_GPIO_irq_ .set_type = ixp2000_GPIO_irq_type, }; -static void ixp2000_pci_irq_mask (unsigned int irq) +static void ixp2000_pci_irq_mask (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned long temp = *IXP2000_PCI_XSCALE_INT_ENABLE ;if (irq ==IRQ_IXP2000_PCIA )ixp2000_reg_wrb (IXP2000_PCI_XSCALE_INT_ENABLE , (temp & ~(1 <<26 )));
@@ -377,8 +382,9 @@ static void ixp2000_pci_irq_mask(unsigneixp2000_reg_wrb (IXP2000_PCI_XSCALE_INT_ENABLE , (temp & ~(1 <<27 ))); } -static void ixp2000_pci_irq_unmask (unsigned int irq) +static void ixp2000_pci_irq_unmask (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned long temp = *IXP2000_PCI_XSCALE_INT_ENABLE ;if (irq ==IRQ_IXP2000_PCIA )ixp2000_reg_write (IXP2000_PCI_XSCALE_INT_ENABLE , (temp | (1 <<26 )));
@@ -401,14 +407,16 @@ static void ixp2000_err_irq_handler(unsi } } -static void ixp2000_err_irq_mask (unsigned int irq) +static void ixp2000_err_irq_mask (struct irq_desc *desc) { +unsigned int irq = desc->irq;ixp2000_reg_write (IXP2000_IRQ_ERR_ENABLE_CLR , (1 << (irq -IRQ_IXP2000_DRAM0_MIN_ERR ))); } -static void ixp2000_err_irq_unmask (unsigned int irq) +static void ixp2000_err_irq_unmask (struct irq_desc *desc) { +unsigned int irq = desc->irq;ixp2000_reg_write (IXP2000_IRQ_ERR_ENABLE_SET , (1 << (irq -IRQ_IXP2000_DRAM0_MIN_ERR ))); }
@@ -425,13 +433,15 @@ static struct irq_chip ixp2000_pci_irq_c .unmask = ixp2000_pci_irq_unmask }; -static void ixp2000_irq_mask (unsigned int irq) +static void ixp2000_irq_mask (struct irq_desc *desc) { +unsigned int irq = desc->irq;ixp2000_reg_wrb (IXP2000_IRQ_ENABLE_CLR , (1 << irq)); } -static void ixp2000_irq_unmask (unsigned int irq) +static void ixp2000_irq_unmask (struct irq_desc *desc) { +unsigned int irq = desc->irq;ixp2000_reg_write (IXP2000_IRQ_ENABLE_SET , (1 << irq)); }
arch/arm/mach-ixp2000/ixdp2x00.c +6 -4
@@ -64,8 +64,9 @@ static struct slowport_cfg slowport_cpld };#endif -static void ixdp2x00_irq_mask (unsigned int irq) +static void ixdp2x00_irq_mask (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned long dummy;static struct slowport_cfg old_cfg;
@@ -88,8 +89,9 @@ static void ixdp2x00_irq_mask(unsigned i#endif } -static void ixdp2x00_irq_unmask (unsigned int irq) +static void ixdp2x00_irq_unmask (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned long dummy;static struct slowport_cfg old_cfg;
@@ -112,7 +114,7 @@ static void ixdp2x00_irq_handler(unsignestatic struct slowport_cfg old_cfg;int i; - desc->chip->mask (irq); + desc->chip->mask (desc);#ifdef CONFIG_ARCH_IXDP2400 if (machine_is_ixdp2400 ())
@@ -134,7 +136,7 @@ static void ixdp2x00_irq_handler(unsigne } } - desc->chip->unmask (irq); + desc->chip->unmask (desc); }static struct irq_chip ixdp2x00_cpld_irq_chip = {
arch/arm/mach-ixp2000/ixdp2x01.c +6 -4
@@ -49,14 +49,16 @@/************************************************************************* * IXDP2x01 IRQ Handling *************************************************************************/ -static void ixdp2x01_irq_mask (unsigned int irq) +static void ixdp2x01_irq_mask (struct irq_desc *desc) { +unsigned int irq = desc->irq;ixp2000_reg_wrb (IXDP2X01_INT_MASK_SET_REG ,IXP2000_BOARD_IRQ_MASK (irq)); } -static void ixdp2x01_irq_unmask (unsigned int irq) +static void ixdp2x01_irq_unmask (struct irq_desc *desc) { +unsigned int irq = desc->irq;ixp2000_reg_write (IXDP2X01_INT_MASK_CLR_REG ,IXP2000_BOARD_IRQ_MASK (irq)); }
@@ -68,7 +70,7 @@ static void ixdp2x01_irq_handler(unsigneu32 ex_interrupt;int i; - desc->chip->mask (irq); + desc->chip->mask (desc); ex_interrupt = *IXDP2X01_INT_STAT_REG & valid_irq_mask;
@@ -84,7 +86,7 @@ static void ixdp2x01_irq_handler(unsigne } } - desc->chip->unmask (irq); + desc->chip->unmask (desc); }static struct irq_chip ixdp2x01_irq_chip = {
arch/arm/mach-ixp23xx/core.c +15 -10
@@ -111,8 +111,9 @@ enum ixp23xx_irq_type {static void ixp23xx_config_irq (unsigned int ,enum ixp23xx_irq_type ); -static int ixp23xx_irq_set_type (unsigned int irq,unsigned int type) +static int ixp23xx_irq_set_type (struct irq_desc *desc,unsigned int type) { +unsigned int irq = desc->irq;int line = irq -IRQ_IXP23XX_GPIO6 +6 ;u32 int_style;enum ixp23xx_irq_type irq_type;
@@ -173,8 +174,9 @@ static int ixp23xx_irq_set_type(unsignedreturn 0 ; } -static void ixp23xx_irq_mask (unsigned int irq) +static void ixp23xx_irq_mask (struct irq_desc *desc) { +unsigned int irq = desc->irq;volatile unsigned long *intr_reg;if (irq >=56 )
@@ -184,8 +186,9 @@ static void ixp23xx_irq_mask(unsigned in *intr_reg &= ~(1 << (irq %32 )); } -static void ixp23xx_irq_ack (unsigned int irq) +static void ixp23xx_irq_ack (struct irq_desc *desc) { +unsigned int irq = desc->irq;int line = irq -IRQ_IXP23XX_GPIO6 +6 ;if ((line <6 ) || (line >15 ))
@@ -198,11 +201,12 @@ static void ixp23xx_irq_ack(unsigned int* Level triggered interrupts on GPIO lines can only be cleared when the * interrupt condition disappears. */ -static void ixp23xx_irq_level_unmask (unsigned int irq) +static void ixp23xx_irq_level_unmask (struct irq_desc *desc) { +unsigned int irq = desc->irq;volatile unsigned long *intr_reg; -ixp23xx_irq_ack (irq); +ixp23xx_irq_ack (desc);if (irq >=56 ) irq +=8 ;
@@ -211,8 +215,9 @@ static void ixp23xx_irq_level_unmask(uns *intr_reg |= (1 << (irq %32 )); } -static void ixp23xx_irq_edge_unmask (unsigned int irq) +static void ixp23xx_irq_edge_unmask (struct irq_desc *desc) { +unsigned int irq = desc->irq;volatile unsigned long *intr_reg;if (irq >=56 )
@@ -236,12 +241,12 @@ static struct irq_chip ixp23xx_irq_edge_ .set_type = ixp23xx_irq_set_type }; -static void ixp23xx_pci_irq_mask (unsigned int irq) +static void ixp23xx_pci_irq_mask (struct irq_desc *desc) { *IXP23XX_PCI_XSCALE_INT_ENABLE &= ~(1 << (IRQ_IXP23XX_INTA +27 - irq)); } -static void ixp23xx_pci_irq_unmask (unsigned int irq) +static void ixp23xx_pci_irq_unmask (struct irq_desc *desc) { *IXP23XX_PCI_XSCALE_INT_ENABLE |= (1 << (IRQ_IXP23XX_INTA +27 - irq)); }
@@ -256,7 +261,7 @@ static void pci_handler(unsigned int irq pci_interrupt = *IXP23XX_PCI_XSCALE_INT_STATUS ; - desc->chip->ack (irq); + desc->chip->ack (desc);/* See which PCI_INTA, or PCI_INTB interrupted */ if (pci_interrupt & (1 <<26 )) {
@@ -269,7 +274,7 @@ static void pci_handler(unsigned int irqgeneric_handle_irq (irqno); - desc->chip->unmask (irq); + desc->chip->unmask (desc); }static struct irq_chip ixp23xx_pci_irq_chip = {
arch/arm/mach-ixp23xx/ixdp2351.c +12 -8
@@ -48,13 +48,15 @@/* * IXDP2351 Interrupt Handling */ -static void ixdp2351_inta_mask (unsigned int irq) +static void ixdp2351_inta_mask (struct irq_desc *desc) { +unsigned int irq = desc->irq; *IXDP2351_CPLD_INTA_MASK_SET_REG =IXDP2351_INTA_IRQ_MASK (irq); } -static void ixdp2351_inta_unmask (unsigned int irq) +static void ixdp2351_inta_unmask (struct irq_desc *desc) { +unsigned int irq = desc->irq; *IXDP2351_CPLD_INTA_MASK_CLR_REG =IXDP2351_INTA_IRQ_MASK (irq); }
@@ -64,7 +66,7 @@ static void ixdp2351_inta_handler(unsign *IXDP2351_CPLD_INTA_STAT_REG &IXDP2351_INTA_IRQ_VALID ;int i; - desc->chip->mask (irq); + desc->chip->mask (desc);for (i =0 ; i <IXDP2351_INTA_IRQ_NUM ; i++) {if (ex_interrupt & (1 << i)) {
@@ -74,7 +76,7 @@ static void ixdp2351_inta_handler(unsign } } - desc->chip->unmask (irq); + desc->chip->unmask (desc); }static struct irq_chip ixdp2351_inta_chip = {
@@ -83,13 +85,15 @@ static struct irq_chip ixdp2351_inta_chi .unmask = ixdp2351_inta_unmask }; -static void ixdp2351_intb_mask (unsigned int irq) +static void ixdp2351_intb_mask (struct irq_desc *desc) { +unsigned int irq = desc->irq; *IXDP2351_CPLD_INTB_MASK_SET_REG =IXDP2351_INTB_IRQ_MASK (irq); } -static void ixdp2351_intb_unmask (unsigned int irq) +static void ixdp2351_intb_unmask (struct irq_desc *desc) { +unsigned int irq = desc->irq; *IXDP2351_CPLD_INTB_MASK_CLR_REG =IXDP2351_INTB_IRQ_MASK (irq); }
@@ -99,7 +103,7 @@ static void ixdp2351_intb_handler(unsign *IXDP2351_CPLD_INTB_STAT_REG &IXDP2351_INTB_IRQ_VALID ;int i; - desc->chip->ack (irq); + desc->chip->ack (desc);for (i =0 ; i <IXDP2351_INTB_IRQ_NUM ; i++) {if (ex_interrupt & (1 << i)) {
@@ -109,7 +113,7 @@ static void ixdp2351_intb_handler(unsign } } - desc->chip->unmask (irq); + desc->chip->unmask (desc); }static struct irq_chip ixdp2351_intb_chip = {
arch/arm/mach-ixp4xx/common.c +9 -5
@@ -128,8 +128,9 @@ int irq_to_gpio(unsigned int irq) }EXPORT_SYMBOL (irq_to_gpio); -static int ixp4xx_set_irq_type (unsigned int irq,unsigned int type) +static int ixp4xx_set_irq_type (struct irq_desc *desc,unsigned int type) { +unsigned int irq = desc->irq;int line = irq2gpio[irq];u32 int_style;enum ixp4xx_irq_type irq_type;
@@ -193,16 +194,18 @@ static int ixp4xx_set_irq_type(unsignedreturn 0 ; } -static void ixp4xx_irq_mask (unsigned int irq) +static void ixp4xx_irq_mask (struct irq_desc *desc) { +unsigned int irq = desc->irq;if ((cpu_is_ixp46x () ||cpu_is_ixp43x ()) && irq >=32 ) *IXP4XX_ICMR2 &= ~(1 << (irq -32 ));else *IXP4XX_ICMR &= ~(1 << irq); } -static void ixp4xx_irq_ack (unsigned int irq) +static void ixp4xx_irq_ack (struct irq_desc *desc) { +unsigned int irq = desc->irq;int line = (irq <32 ) ? irq2gpio[irq] :-1 ;if (line >=0 )
@@ -213,10 +216,11 @@ static void ixp4xx_irq_ack(unsigned int* Level triggered interrupts on GPIO lines can only be cleared when the * interrupt condition disappears. */ -static void ixp4xx_irq_unmask (unsigned int irq) +static void ixp4xx_irq_unmask (struct irq_desc *desc) { +unsigned int irq = desc->irq;if (!(ixp4xx_irq_edge & (1 << irq))) -ixp4xx_irq_ack (irq); +ixp4xx_irq_ack (desc);if ((cpu_is_ixp46x () ||cpu_is_ixp43x ()) && irq >=32 ) *IXP4XX_ICMR2 |= (1 << (irq -32 ));
arch/arm/mach-ks8695/irq.c +18 -13
@@ -34,29 +34,32 @@#include <mach/regs-irq.h> #include <mach/regs-gpio.h> -static void ks8695_irq_mask (unsigned int irqno) +static void ks8695_irq_mask (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned long inten; inten =__raw_readl (KS8695_IRQ_VA +KS8695_INTEN ); - inten &= ~(1 << irqno); + inten &= ~(1 << irq);__raw_writel (inten,KS8695_IRQ_VA +KS8695_INTEN ); } -static void ks8695_irq_unmask (unsigned int irqno) +static void ks8695_irq_unmask (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned long inten; inten =__raw_readl (KS8695_IRQ_VA +KS8695_INTEN ); - inten |= (1 << irqno); + inten |= (1 << irq);__raw_writel (inten,KS8695_IRQ_VA +KS8695_INTEN ); } -static void ks8695_irq_ack (unsigned int irqno) +static void ks8695_irq_ack (struct irq_desc *desc) { -__raw_writel ((1 << irqno),KS8695_IRQ_VA +KS8695_INTST ); +unsigned int irq = desc->irq; +__raw_writel ((1 << irq),KS8695_IRQ_VA +KS8695_INTST ); }
@@ -64,8 +67,9 @@ static struct irq_chip ks8695_irq_level_static struct irq_chip ks8695_irq_edge_chip; -static int ks8695_irq_set_type (unsigned int irqno,unsigned int type) +static int ks8695_irq_set_type (struct irq_desc *desc,unsigned int type) { +unsigned int irq = desc->irq;unsigned long ctrl, mode;unsigned short level_triggered =0 ;
@@ -93,7 +97,7 @@ static int ks8695_irq_set_type(unsignedreturn -EINVAL ; } -switch (irqno) { +switch (irq) {case KS8695_IRQ_EXTERN0 : ctrl &= ~IOPC_IOEINT0TM ; ctrl |=IOPC_IOEINT0_MODE (mode);
@@ -115,12 +119,12 @@ static int ks8695_irq_set_type(unsigned }if (level_triggered) { -set_irq_chip (irqno, &ks8695_irq_level_chip); -set_irq_handler (irqno, handle_level_irq); +set_irq_chip (irq, &ks8695_irq_level_chip); +set_irq_handler (irq, handle_level_irq); }else { -set_irq_chip (irqno, &ks8695_irq_edge_chip); -set_irq_handler (irqno, handle_edge_irq); +set_irq_chip (irq, &ks8695_irq_edge_chip); +set_irq_handler (irq, handle_edge_irq); }__raw_writel (ctrl,KS8695_GPIO_VA +KS8695_IOPC );
@@ -164,7 +168,8 @@ void __init ks8695_init_irq(void)/* Edge-triggered interrupts */ default : -ks8695_irq_ack (irq);/* clear pending bit */ +/* clear pending bit */ +ks8695_irq_ack (irq_to_desc (irq));set_irq_chip (irq, &ks8695_irq_edge_chip);set_irq_handler (irq, handle_edge_irq); }
arch/arm/mach-l7200/core.c +4 -2
@@ -45,13 +45,15 @@#define FIQ_SOFT (*(volatile unsigned long *) (IRQ_BASE + 0x110))#define FIQ_SOURCESEL (*(volatile unsigned long *) (IRQ_BASE + 0x118)) -static void l7200_mask_irq (unsigned int irq) +static void l7200_mask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;IRQ_ENABLECLEAR =1 << irq; } -static void l7200_unmask_irq (unsigned int irq) +static void l7200_unmask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;IRQ_ENABLE =1 << irq; }
arch/arm/mach-lh7a40x/arch-kev7a400.c +6 -3
@@ -46,19 +46,22 @@ void __init kev7a400_map_io(void)static u16 CPLD_IRQ_mask;/* Mask for CPLD IRQs, 1 == unmasked */ -static void kev7a400_ack_cpld_irq (u32 irq) +static void kev7a400_ack_cpld_irq (u32 irq,struct irq_desc *desc) { +unsigned int irq = desc->irq;CPLD_CL_INT =1 << (irq -IRQ_KEV7A400_CPLD ); } -static void kev7a400_mask_cpld_irq (u32 irq) +static void kev7a400_mask_cpld_irq (u32 irq,struct irq_desc *desc) {
Lines of this file are not shown. View the raw message.
arch/arm/mach-ns9xxx/board-a9m9750dev.c +9 -6
Lines of this file are not shown. View the raw message.
arch/arm/mach-s3c2443/irq.c +45 -30
75 lines not on this page · raw message
arch/arm/plat-s3c24xx/irq.c +68 -48
116 lines not on this page · raw message
arch/arm/plat-s5pc1xx/irq-eint.c +24 -17
41 lines not on this page · raw message
arch/blackfin/mach-common/ints-priority.c +36 -23
59 lines not on this page · raw message
arch/ia64/kernel/iosapic.c +22 -19
41 lines not on this page · raw message
arch/m32r/platforms/m32700ut/setup.c +52 -40
92 lines not on this page · raw message
arch/m32r/platforms/opsput/setup.c +50 -38
88 lines not on this page · raw message
arch/m32r/platforms/usrv/setup.c +24 -18
42 lines not on this page · raw message
arch/m68knommu/platform/coldfire/intc-2.c +4 -2
Lines of this file are not shown. View the raw message.
arch/m68knommu/platform/coldfire/intc-simr.c +6 -3
Lines of this file are not shown. View the raw message.
arch/m68knommu/platform/coldfire/intc.c +5 -3
Lines of this file are not shown. View the raw message.
arch/mips/alchemy/common/irq.c +29 -19
48 lines not on this page · raw message
arch/mips/cavium-octeon/octeon-irq.c +57 -42
99 lines not on this page · raw message
arch/mips/nxp/pnx833x/common/interrupts.c +21 -12
Lines of this file are not shown. View the raw message.
arch/mips/pmc-sierra/msp71xx/msp_irq_cic.c +7 -5
Lines of this file are not shown. View the raw message.
arch/mips/pmc-sierra/msp71xx/msp_irq_slp.c +6 -3
Lines of this file are not shown. View the raw message.
arch/mips/sgi-ip32/ip32-irq.c +39 -29
68 lines not on this page · raw message
arch/parisc/kernel/irq.c +25 -18
43 lines not on this page · raw message
arch/powerpc/platforms/512x/mpc5121_ads_cpld.c +4 -2
Lines of this file are not shown. View the raw message.
arch/powerpc/platforms/52xx/media5200.c +9 -7
Lines of this file are not shown. View the raw message.
arch/powerpc/platforms/52xx/mpc52xx_pic.c +23 -12
Lines of this file are not shown. View the raw message.
arch/powerpc/platforms/82xx/pq2ads-pci-pic.c +4 -2
Lines of this file are not shown. View the raw message.
arch/powerpc/platforms/85xx/mpc85xx_ads.c +1 -1
Lines of this file are not shown. View the raw message.
arch/powerpc/platforms/85xx/mpc85xx_ds.c +1 -1
Lines of this file are not shown. View the raw message.
arch/powerpc/platforms/85xx/socrates_fpga_pic.c +13 -7
Lines of this file are not shown. View the raw message.
arch/powerpc/platforms/8xx/m8xx_setup.c +2 -2
Lines of this file are not shown. View the raw message.
arch/powerpc/platforms/cell/beat_interrupt.c +8 -4
Lines of this file are not shown. View the raw message.
arch/powerpc/platforms/cell/interrupt.c +6 -6
Lines of this file are not shown. View the raw message.
arch/powerpc/platforms/cell/spider-pic.c +9 -6
Lines of this file are not shown. View the raw message.
arch/powerpc/platforms/embedded6xx/flipper-pic.c +8 -4
Lines of this file are not shown. View the raw message.
arch/powerpc/platforms/embedded6xx/hlwd-pic.c +15 -11
Lines of this file are not shown. View the raw message.
arch/powerpc/platforms/pseries/xics.c +16 -11
Lines of this file are not shown. View the raw message.
arch/powerpc/sysdev/mpic.c +30 -20
50 lines not on this page · raw message
arch/sparc/kernel/irq_64.c +43 -36
79 lines not on this page · raw message
arch/x86/kernel/apic/io_apic.c +53 -72
125 lines not on this page · raw message
include/linux/irq.h +24 -23
47 lines not on this page · raw message
kernel/irq/chip.c +27 -33
60 lines not on this page · raw message
kernel/irq/manage.c +32 -33
65 lines not on this page · raw message
drivers/infiniband/hw/ipath/ipath_iba6110.c +1 -1
Lines of this file are not shown. View the raw message.
arch/arm/plat-s3c24xx/include/plat/irq.h +2 -2
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
Re: [PATCH 06/12] genericirq: make irq_chip related function to take desc
Quoted 10 lines · Yinghai Lu
Quoted 7 lines · Thomas Gleixner
The code which uses the chip functions needs to be changed:
(quoted diff) +1
-1- desc->chip->fun(irq); + desc->chip->fun(desc);That's mostly in
kernel/irq/*but there are some users inarch/*lowlevel irq handling code as well.that is our -v2 version.
I know, but the difference is that it is done by a machine.
I have been involved in more than one large scale overhaul projects in the kernel and most of the time I spent on those was to figure out the right way to do it to limit the risks.
Automated conversion is the best thing you can do and if Julia can whip up that rules, I'm less worried about the wholesale switchover on a per function basis, than I'm scared about the fully manual approach you took.
Thanks,
tglx
Re: [PATCH 06/12] genericirq: make irq_chip related function to take desc
Quoted 12 lines · Thomas Gleixner
Quoted 10 lines · Yinghai Lu
Quoted 7 lines · Thomas Gleixner
The code which uses the chip functions needs to be changed:
(quoted diff) +1
-1- desc->chip->fun(irq); + desc->chip->fun(desc);That's mostly in
kernel/irq/*but there are some users inarch/*lowlevel irq handling code as well.that is our -v2 version.
Quoted 5 lines
I know, but the difference is that it is done by a machine.
I have been involved in more than one large scale overhaul projects in the kernel and most of the time I spent on those was to figure out the right way to do it to limit the risks.
sure.
Quoted 5 lines
Automated conversion is the best thing you can do and if Julia can whip up that rules, I'm less worried about the wholesale switchover on a per function basis, than I'm scared about the fully manual approach you took.
ok, let wait for Julia to check it...
Thanks
Yinghai
Re: [PATCH 06/12] genericirq: make irq_chip related function to take desc
In reply to Yinghai LuI will look at it tomorrow.
julia
Quoted 142 lines · Yinghai Lu
Quoted 17 lines · Thomas Gleixner
Review
Quoted 11 lines · Yinghai Lu
/*
* Fixup enable/disable function pointers */
voidirq_chip_set_defaults(struct irq_chip *chip){(quoted diff) +6
-0+ if (!chip->desc_enable) + chip->desc_enable = default_enable_desc; + if (!chip->desc_disable) + chip->desc_disable = default_disable_desc; + if (!chip->desc_startup) + chip->desc_startup = default_startup_desc;This will break all
irq_chipswhich implement enable, disable or startup. so the check needs to be:Quoted 1 line
if (!chip->enable && !chip->desc_enable)yes.
Quoted 15 lines
Review
Quoted 12 lines
(quoted diff) +11
-0+ /* + * We use chip->disable, when the user provided its own. When + * we have default_disable set for chip->disable, then we need + * to use default_shutdown, otherwise the irq line is not + * disabled on free_irq(): + */ + if (!chip->desc_shutdown) + chip->desc_shutdown = chip->desc_disable != default_disable_desc ? + chip->desc_disable : default_shutdown_desc; + if (!chip->desc_end) + chip->desc_end = dummy_irq_chip.desc_end;Same here.
Quoted 4 lines
Review void clear_kstat_irqs(struct irq_desc *desc) · line 295
Quoted 2 lines
(quoted diff) +0
-0@@ -295,10 +295,14 @@ void clear_kstat_irqs(struct irq_desc *desc) static void ack_bad(unsigned int irq)Why do we keep that function around ?
that is for other arch...
/*
* Generic no controller implementation
*/
structirq_chipno_irq_chip= {.name = "none", .startup = noop_ret, .shutdown = noop, .enable = noop, .disable = noop, .ack = ack_bad, .end = noop,.desc_startup = noop_ret_desc, .desc_shutdown = noop_desc, .desc_enable = noop_desc, .desc_disable = noop_desc, .desc_ack = ack_bad_desc, .desc_end = noop_desc,};
Quoted 72 lines
Quoted 13 lines
kernel/irq/handle.c +1
-2{struct irq_desc *desc =irq_to_desc (irq); - -print_irq_desc (irq, desc); +print_irq_desc (desc);ack_bad_irq (irq); }/* * Generic no controller implementation kernel/irq/handle.c struct irq_chip no_irq_chip = { · line 336
Quoted 3 lines
kernel/irq/handle.c +0
-0@@ -323,6 +334,13 @@ struct irq_chip no_irq_chip = { .disable = noop, .ack = ack_bad, .end = noop,We can remove the old ones right away, can't we ?
kernel/irq/resend.c
Quoted 1 line
kernel/irq/resend.c +0
-0Yinghai, thanks for doing that. It's halfways reviewable now, but if we go that way it needs to be split further, really.
But to be honest I have to say that the code churn of that patch scares me. I expected it to be less horrible.
So I started twisting my brain around a fully automated method of solving this conversion problem with almost zero risk. It just occured to me that Julia might be able to help and whip up semantic patch rules for doing the conversion automagically on a flag day. That would be one rule and one resulting patch for each of the
chip->functions.So the task would be:
In
include/linux/irq.hstruct irq_chip { const char *name;(quoted diff) +1
-1- unsigned int startup(unsigned int irq); + unsigned int startup(struct irq_desc *desc);Then finding all
irq_chipimplementations which set that function pointer and fix up the function e.g.:
arch/x86/kernel/apic/io_apic.c:static struct
irq_chipioapic_chip__read_mostly= {
.name = "IO-APIC",
.startup =startup_ioapic_irq,-->
arch/x86/kernel/apic/io_apic.c +2
-1-static unsigned int startup_ioapic_irq (unsigned int irq) +static unsigned int startup_ioapic_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;int was_pending =0 ;unsigned long flags;struct irq_cfg *cfg;raw_spin_lock_irqsave (&ioapic_lock, flags);To make it simple, we just can put that right after the opening bracket of the function.
The code which uses the chip functions needs to be changed:
(quoted diff) +1
-1- desc->chip->fun(irq); + desc->chip->fun(desc);Quoted 2 lines
That's mostly in
kernel/irq/*but there are some users inarch/*lowlevel irq handling code as well.that is our -v2 version.
YH
Re: [PATCH 06/12] genericirq: make irq_chip related function to take desc
I haven't heard anything more on this, but I had reason to play with coccinelle http://coccinelle.lip6.fr/ which I think is think think is the semantic patcher you referred to.
In any case I was playing with it and I believe I have managed to whip up a fairly robust semantic patch. The last two hunks are to cleanup earlier transforms, by removing unnecessary irq_to_desc chatter, and removing unused variables. I am a big grumpy that I couldn't figure out how to add comments to my patch to explain the tricky bits, but otherwise I am happy.
The patch appears to have the limitation that methods that are not in the file where struct irq_chip is defined, which is an issue for the msi irq_chip helper routines. Other than that I don't know of any issues.
I would suggest changing as much of the x86 non irq_chip helpers to use irq_desc before applying this so it this the conversion can have the chance to remove any irq variables.
Eric
@ DECL @
struct irq_chip CHIP;
identifier METHOD;
identifier METHOD_NAME;
@@
CHIP.METHOD_NAME = METHOD;
@ @
identifier DECL.METHOD;
identifier IRQ;
@@
METHOD(
- unsigned int IRQ
+ struct irq_desc *unused
, ...) {
}
@ @
identifier DECL.METHOD;
identifier IRQ;
identifier DESC;
@@
METHOD(
- unsigned int IRQ
+ struct irq_desc *DESC
, ...) {
+ unsigned int IRQ = DESC->irq;
...
- struct irq_desc *DESC = irq_to_desc(IRQ); ...
}
@ @
identifier DECL.METHOD;
identifier IRQ;
identifier DESC;
@@
METHOD(
- unsigned int IRQ
+ struct irq_desc *DESC
, ...) {
+ unsigned int IRQ = DESC->irq;
...
- struct irq_desc *DESC; ... - DESC = irq_to_desc(IRQ); ...
}
@ @
identifier DECL.METHOD;
identifier IRQ;
@@
METHOD(
- unsigned int IRQ
+ struct irq_desc *desc
, ...) {
+ unsigned int IRQ = desc->irq;
...
}
@ @
identifier DECL.METHOD;
identifier FUNC;
identifier IRQ;
@@
FUNC(...) {
<...
METHOD(
- IRQ
+ irq_to_desc(IRQ)
, ... )
...>
}
@ @
identifier FUNC;
identifier DESC;
identifier IRQ;
@@
FUNC(..., struct irq_desc *DESC, ...) {
...
unsigned int IRQ = DESC->irq;
<...
- irq_to_desc(IRQ)
+ DESC
...>
}
@ @
identifier FUNC;
identifier DESC;
identifier IRQ;
@@
FUNC(..., struct irq_desc *DESC, ...) {
...
- unsigned int IRQ = DESC->irq;
... when != IRQ
}
Re: [PATCH 06/12] genericirq: make irq_chip related function to take desc
I also worked on this, but only sent it to Thomas and Yinghai. Onthe other hand, I mostly like your solution better, because it has the unintended side-effect of getting rid of some blank spaces after {s.
My rule was also more complicated in that it also searches for conditions in which it is not sure to be doing the right thing. I will send those in another message.
Quoted 12 lines
@ DECL @
structirq_chipCHIP;
identifier METHOD;
identifierMETHOD_NAME;
@@
CHIP.METHOD_NAME = METHOD;@ @
identifier DECL.METHOD;
identifier IRQ;
@@
METHOD(
Review
Quoted 4 lines
(quoted diff) +1
-1- unsigned int IRQ + struct irq_desc *unused , ...) { }
I didn't think of making a special rule for this. It could consider any case where the body is ... when != IRQ
Quoted 52 lines
@ @
identifier DECL.METHOD;
identifier IRQ;
identifier DESC;
@@
METHOD((quoted diff) +2
-2- unsigned int IRQ + struct irq_desc *DESC , ...) { + unsigned int IRQ = DESC->irq; - struct irq_desc *DESC = irq_to_desc(IRQ); }@ @
identifier DECL.METHOD;
identifier IRQ;
identifier DESC;
@@
METHOD((quoted diff) +2
-3- unsigned int IRQ + struct irq_desc *DESC , ...) { + unsigned int IRQ = DESC->irq; - struct irq_desc *DESC; - DESC = irq_to_desc(IRQ); }@ @
identifier DECL.METHOD;
identifier IRQ;
@@
METHOD((quoted diff) +2
-1- unsigned int IRQ + struct irq_desc *desc , ...) { + unsigned int IRQ = desc->irq; }@ @
identifier DECL.METHOD;
identifier FUNC;
identifier IRQ;
@@
FUNC(...) {
<...METHOD(
Review
Quoted 5 lines
(quoted diff) +1
-1- IRQ + irq_to_desc(IRQ) , ... ) ...> }
I don't think FUNC(...) { <... and ...> } are needed here. The goal is to make the change everywhere the call appears.
Review
Quoted 13 lines
@ @
identifier FUNC;
identifier DESC;
identifier IRQ;
@@
FUNC(..., struct irq_desc *DESC, ...){
...(quoted diff) +1
-1unsigned int IRQ = DESC->irq; <... - irq_to_desc(IRQ) + DESC ...> }
This rule can be extended as follows:
@ @
identifier FUNC;
identifier DESC;
identifier IRQ;
identifier FLD;
@@
FUNC(..., struct irq_desc *DESC, ...) {
...
unsigned int IRQ = DESC->irq;
<...
(
- irq_to_desc(IRQ)
+ DESC
|
- irq_desc[IRQ].FLD
+ DESC->FLD
)
...>
}
Doing so gets rid of more references to IRQ.
Another case that can be treated is method calls via a pointer:
@@
expression arg;
struct irq_desc *desc;
struct irq_chip *ic;
identifier fun;
@@
(
desc->chip->fun(
- arg
+ desc
,...)
|
ic->fun(
- arg
+ irq_to_desc(arg)
,...)
)
julia
Quoted 10 lines
@ @
identifier FUNC;
identifier DESC;
identifier IRQ;
@@
FUNC(..., struct irq_desc *DESC, ...){
...(quoted diff) +0
-1- unsigned int IRQ = DESC->irq; ... when != IRQ }
PATCH 1/1 irq: Start the transition of irq_chip methods taking a desc
With SPARSE_IRQ irq_to_desc becomes an unnecessary lookup operation on the fast path of dispatching irqs to their handlers. We can avoid this cost by passing an irq_desc pointer instead of using an integer irq token to the irq_chip methods.
A single patch to convert all of the architectures is an unreviewable 2000+ line patch. A gradual transition scenario with two sets of irq_chip methods in irq_chip is an unmanageable mess in kernel/irq.
So instead I define some macros so the generic irq code in kernel/irq/ can compile either way based on a boolean Kconfig variable CONFIG_CHIP_PARAM_DESC. This allows us to convert one architecture at a time, reducing the follow on patches to manageable proportions. It is a little bit ugly but it is much better than the alternatives, and as soon as we finish the transition we can kill the macros.
I introduce the macros CHIP_ARG, CHIP_VAR, and CHIP_PARAM where appropriate. I change a few declarations of irq as int to unsigned int. I normalize the variables names in the functions that call chip methods to ensure that I have the variables irq and desc present allowing CHIP_ARG to work properly. Most importantly none of the irq logic changes with this patch.
--- arch/Kconfig | 3 ++ include/linux/irq.h | 58 ++++++++++++++++++++++++++++------------------- kernel/irq/autoprobe.c | 39 ++++++++++++++++--------------- kernel/irq/chip.c | 44 ++++++++++++++++++------------------ kernel/irq/handle.c | 18 +++++++------- kernel/irq/internals.h | 4 +- kernel/irq/manage.c | 20 ++++++++-------- kernel/irq/migration.c | 10 ++++---- kernel/irq/pm.c | 6 ++-- kernel/irq/resend.c | 4 +- kernel/irq/spurious.c | 4 +- 11 files changed, 112 insertions(+), 98 deletions(-)
arch/Kconfig +3 -0
@@ -2,6 +2,9 @@ # General architecture dependent options # +config CHIP_PARAM_DESC + def_bool n + config OPROFILE tristate "OProfile system profiling" depends on PROFILING
include/linux/irq.h +34 -24
90 lines not on this page · raw message
kernel/irq/autoprobe.c +20 -19
@@ -33,7 +33,7 @@ unsigned long probe_irq_on(void)struct irq_desc *desc;unsigned long mask =0 ;unsigned int status; -int i; +unsigned int irq;/* * quiesce the kernel, or at least the asynchronous portion
@@ -44,7 +44,7 @@ unsigned long probe_irq_on(void)* something may have generated an irq long ago and we want to * flush such a longstanding irq before considering it as spurious. */ -for_each_irq_desc_reverse (i, desc) { +for_each_irq_desc_reverse (irq, desc) {raw_spin_lock_irq (&desc->lock);if (!desc->action && !(desc->status &IRQ_NOPROBE )) {/*
@@ -58,8 +58,8 @@ unsigned long probe_irq_on(void)* progress: */ if (desc->chip->set_type) - desc->chip->set_type (i,IRQ_TYPE_PROBE ); - desc->chip->startup (i); + desc->chip->set_type (CHIP_ARG ,IRQ_TYPE_PROBE ); + desc->chip->startup (CHIP_ARG ); }raw_spin_unlock_irq (&desc->lock); }
@@ -72,11 +72,11 @@ unsigned long probe_irq_on(void)* (we must startup again here because if a longstanding irq * happened in the previous stage, it may have masked itself) */ -for_each_irq_desc_reverse (i, desc) { +for_each_irq_desc_reverse (irq, desc) {raw_spin_lock_irq (&desc->lock);if (!desc->action && !(desc->status &IRQ_NOPROBE )) { desc->status |=IRQ_AUTODETECT |IRQ_WAITING ; -if (desc->chip->startup (i)) +if (desc->chip->startup (CHIP_ARG )) desc->status |=IRQ_PENDING ; }raw_spin_unlock_irq (&desc->lock);
@@ -90,7 +90,7 @@ unsigned long probe_irq_on(void)/* * Now filter out any obviously spurious interrupts */ -for_each_irq_desc (i, desc) { +for_each_irq_desc (irq, desc) {raw_spin_lock_irq (&desc->lock); status = desc->status;
@@ -98,10 +98,10 @@ unsigned long probe_irq_on(void)/* It triggered already - consider it spurious. */ if (!(status &IRQ_WAITING )) { desc->status = status & ~IRQ_AUTODETECT ; - desc->chip->shutdown (i); + desc->chip->shutdown (CHIP_ARG ); }else -if (i <32 ) - mask |=1 << i; +if (irq <32 ) + mask |=1 << irq; }raw_spin_unlock_irq (&desc->lock); }
@@ -126,18 +126,18 @@ unsigned int probe_irq_mask(unsigned long val) {unsigned int status, mask =0 ;struct irq_desc *desc; -int i; +unsigned int irq; -for_each_irq_desc (i, desc) { +for_each_irq_desc (irq, desc) {raw_spin_lock_irq (&desc->lock); status = desc->status;if (status &IRQ_AUTODETECT ) { -if (i <16 && !(status &IRQ_WAITING )) - mask |=1 << i; +if (irq <16 && !(status &IRQ_WAITING )) + mask |=1 << irq; desc->status = status & ~IRQ_AUTODETECT ; - desc->chip->shutdown (i); + desc->chip->shutdown (CHIP_ARG ); }raw_spin_unlock_irq (&desc->lock); }
@@ -166,22 +166,23 @@ EXPORT_SYMBOL(probe_irq_mask);*/ int probe_irq_off (unsigned long val) { -int i, irq_found =0 , nr_of_irqs =0 ; +int irq_found =0 , nr_of_irqs =0 ;struct irq_desc *desc;unsigned int status; +unsigned int irq; -for_each_irq_desc (i, desc) { +for_each_irq_desc (irq, desc) {raw_spin_lock_irq (&desc->lock); status = desc->status;if (status &IRQ_AUTODETECT ) {if (!(status &IRQ_WAITING )) {if (!nr_of_irqs) - irq_found = i; + irq_found = irq; nr_of_irqs++; } desc->status = status & ~IRQ_AUTODETECT ; - desc->chip->shutdown (i); + desc->chip->shutdown (CHIP_ARG ); }raw_spin_unlock_irq (&desc->lock); }
kernel/irq/chip.c +22 -22
136 lines not on this page · raw message
kernel/irq/handle.c +9 -9
@@ -292,22 +292,22 @@ void clear_kstat_irqs(struct irq_desc *desc)* What should we do if we get a hw irq event on an illegal vector? * Each architecture has to answer this themself. */ -static void ack_bad (unsigned int irq) +static void ack_bad (CHIP_PARAM ) { -struct irq_desc *desc =irq_to_desc (irq); +CHIP_VAR ; -print_irq_desc (irq, desc); -ack_bad_irq (irq); +print_irq_desc (desc->irq, desc); +ack_bad_irq (desc->irq); }/* * NOP functions */ -static void noop (unsigned int irq) +static void noop (CHIP_PARAM ) { } -static unsigned int noop_ret (unsigned int irq) +static unsigned int noop_ret (CHIP_PARAM ) {return 0 ; }
@@ -467,13 +467,13 @@ unsigned int __do_IRQ(unsigned int irq)if (!noirqdebug)note_interrupt (irq, desc, action_ret); } - desc->chip->end (irq); + desc->chip->end (CHIP_ARG );return 1 ; }raw_spin_lock (&desc->lock);if (desc->chip->ack) - desc->chip->ack (irq); + desc->chip->ack (CHIP_ARG );/* * REPLAY is when Linux resends an IRQ that was dropped earlier * WAITING is used by probe to mark irqs that are being tested
@@ -533,7 +533,7 @@ out:* The ->end() handler has to deal with interrupts which got * disabled while the handler was running. */ - desc->chip->end (irq); + desc->chip->end (CHIP_ARG );raw_spin_unlock (&desc->lock);return 1 ;
kernel/irq/internals.h +2 -2
@@ -44,13 +44,13 @@ extern void irq_set_thread_affinity(struct irq_desc *desc);static inline void chip_bus_lock (unsigned int irq,struct irq_desc *desc) {if (unlikely (desc->chip->bus_lock)) - desc->chip->bus_lock (irq); + desc->chip->bus_lock (CHIP_ARG ); }static inline void chip_bus_sync_unlock (unsigned int irq,struct irq_desc *desc) {if (unlikely (desc->chip->bus_sync_unlock)) - desc->chip->bus_sync_unlock (irq); + desc->chip->bus_sync_unlock (CHIP_ARG ); }/*
kernel/irq/manage.c +10 -10
@@ -118,7 +118,7 @@ int irq_set_affinity(unsigned int irq, const struct cpumask *cpumask)#ifdef CONFIG_GENERIC_PENDING_IRQ if (desc->status &IRQ_MOVE_PCNTXT ) { -if (!desc->chip->set_affinity (irq, cpumask)) { +if (!desc->chip->set_affinity (CHIP_ARG , cpumask)) {cpumask_copy (desc->affinity, cpumask);irq_set_thread_affinity (desc); }
@@ -161,7 +161,7 @@ static int setup_affinity(unsigned int irq, struct irq_desc *desc)cpumask_and (desc->affinity, cpu_online_mask, irq_default_affinity); set_affinity: - desc->chip->set_affinity (irq, desc->affinity); + desc->chip->set_affinity (CHIP_ARG , desc->affinity);return 0 ; }
@@ -207,7 +207,7 @@ void __disable_irq(struct irq_desc *desc, unsigned int irq, bool suspend)if (!desc->depth++) { desc->status |=IRQ_DISABLED ; - desc->chip->disable (irq); + desc->chip->disable (CHIP_ARG ); } }
@@ -321,7 +321,7 @@ static int set_irq_wake_real(unsigned int irq, unsigned int on)int ret = -ENXIO ;if (desc->chip->set_wake) - ret = desc->chip->set_wake (irq, on); + ret = desc->chip->set_wake (CHIP_ARG , on);return ret; }
@@ -425,7 +425,7 @@ int __irq_set_trigger(struct irq_desc *desc, unsigned int irq, }/* caller masked out all except trigger mode flags */ - ret = chip->set_type (irq, flags); + ret = chip->set_type (CHIP_ARG , flags);if (ret) pr_err("setting trigger mode %d for irq %u failed (%pF)\n",
@@ -487,7 +487,7 @@ static void irq_finalize_oneshot(unsigned int irq, struct irq_desc *desc)raw_spin_lock_irq (&desc->lock);if (!(desc->status &IRQ_DISABLED ) && (desc->status &IRQ_MASKED )) { desc->status &= ~IRQ_MASKED ; - desc->chip->unmask (irq); + desc->chip->unmask (CHIP_ARG ); }raw_spin_unlock_irq (&desc->lock);chip_bus_sync_unlock (irq, desc);
@@ -738,7 +738,7 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)if (!(desc->status &IRQ_NOAUTOEN )) { desc->depth =0 ; desc->status &= ~IRQ_DISABLED ; - desc->chip->startup (irq); + desc->chip->startup (CHIP_ARG ); }else /* Undo nested disables: */ desc->depth =1 ;
@@ -872,16 +872,16 @@ static struct irqaction *__free_irq(unsigned int irq, void *dev_id)/* Currently used only by UML, might disappear one day: */ #ifdef CONFIG_IRQ_RELEASE_METHOD if (desc->chip->release) - desc->chip->release (irq, dev_id); + desc->chip->release (CHIP_ARG , dev_id);#endif /* If this was the last handler, shut down the IRQ line: */ if (!desc->action) { desc->status |=IRQ_DISABLED ;if (desc->chip->shutdown) - desc->chip->shutdown (irq); + desc->chip->shutdown (CHIP_ARG );else - desc->chip->disable (irq); + desc->chip->disable (CHIP_ARG ); }raw_spin_unlock_irqrestore (&desc->lock, flags);
kernel/irq/migration.c +5 -5
@@ -4,7 +4,7 @@#include "internals.h" -void move_masked_irq (int irq) +void move_masked_irq (unsigned int irq) {struct irq_desc *desc =irq_to_desc (irq);
@@ -43,7 +43,7 @@ void move_masked_irq(int irq)*/ if (likely (cpumask_any_and (desc->pending_mask, cpu_online_mask) < nr_cpu_ids)) -if (!desc->chip->set_affinity (irq, desc->pending_mask)) { +if (!desc->chip->set_affinity (CHIP_ARG , desc->pending_mask)) {cpumask_copy (desc->affinity, desc->pending_mask);irq_set_thread_affinity (desc); }
@@ -51,7 +51,7 @@ void move_masked_irq(int irq)cpumask_clear (desc->pending_mask); } -void move_native_irq (int irq) +void move_native_irq (unsigned int irq) {struct irq_desc *desc =irq_to_desc (irq);
@@ -61,8 +61,8 @@ void move_native_irq(int irq)if (unlikely (desc->status &IRQ_DISABLED ))return ; - desc->chip->mask (irq); + desc->chip->mask (CHIP_ARG );move_masked_irq (irq); - desc->chip->unmask (irq); + desc->chip->unmask (CHIP_ARG ); }
kernel/irq/pm.c +3 -3
@@ -23,7 +23,7 @@void suspend_device_irqs (void ) {struct irq_desc *desc; -int irq; +unsigned int irq;for_each_irq_desc (irq, desc) {unsigned long flags;
@@ -48,7 +48,7 @@ EXPORT_SYMBOL_GPL(suspend_device_irqs);void resume_device_irqs (void ) {struct irq_desc *desc; -int irq; +unsigned int irq;for_each_irq_desc (irq, desc) {unsigned long flags;
@@ -69,7 +69,7 @@ EXPORT_SYMBOL_GPL(resume_device_irqs);int check_wakeup_irqs (void ) {struct irq_desc *desc; -int irq; +unsigned int irq;for_each_irq_desc (irq, desc)if ((desc->status &IRQ_WAKEUP ) && (desc->status &IRQ_PENDING ))
kernel/irq/resend.c +2 -2
@@ -60,7 +60,7 @@ void check_irq_resend(struct irq_desc *desc, unsigned int irq)/* * Make sure the interrupt is enabled, before resending it: */ - desc->chip->enable (irq); + desc->chip->enable (CHIP_ARG );/* * We do not resend level type interrupts. Level type
@@ -70,7 +70,7 @@ void check_irq_resend(struct irq_desc *desc, unsigned int irq)if ((status & (IRQ_LEVEL |IRQ_PENDING |IRQ_REPLAY )) ==IRQ_PENDING ) { desc->status = (status & ~IRQ_PENDING ) |IRQ_REPLAY ; -if (!desc->chip->retrigger || !desc->chip->retrigger (irq)) { +if (!desc->chip->retrigger || !desc->chip->retrigger (CHIP_ARG )) {#ifdef CONFIG_HARDIRQS_SW_RESEND /* Set it pending and activate the softirq: */ set_bit (irq, irqs_resend);
kernel/irq/spurious.c +2 -2
@@ -79,7 +79,7 @@ static int try_one_irq(int irq, struct irq_desc *desc)* IRQ controller clean up too */ if (work && desc->chip && desc->chip->end) - desc->chip->end (irq); + desc->chip->end (CHIP_ARG );raw_spin_unlock (&desc->lock);return ok;
@@ -254,7 +254,7 @@ void note_interrupt(unsigned int irq, struct irq_desc *desc,printk (KERN_EMERG "Disabling IRQ #%d\n" , irq); desc->status |=IRQ_DISABLED |IRQ_SPURIOUS_DISABLED ; desc->depth++; - desc->chip->disable (irq); + desc->chip->disable (CHIP_ARG );mod_timer (&poll_spurious_irq_timer, jiffies +POLL_SPURIOUS_IRQ_INTERVAL );
Signature · 1 line
1.6.5.2.143.g8cc62
Re: [PATCH] irq: Start the transition of irq_chip methods taking a desc
Eric,
Quoted 17 lines · Eric W. Biederman
With
SPARSE_IRQirq_to_descbecomes an unnecessary lookup operation on the fast path of dispatching irqs to their handlers. We can avoid this cost by passing anirq_descpointer instead of using an integer irq token to theirq_chipmethods.A single patch to convert all of the architectures is an unreviewable 2000+ line patch. A gradual transition scenario with two sets of
irq_chipmethods inirq_chipis an unmanageable mess in kernel/irq.So instead I define some macros so the generic irq code in
kernel/irq/can compile either way based on a booleanKconfigvariableCONFIG_CHIP_PARAM_DESC. This allows us to convert one architecture at a time, reducing the follow on patches to manageable proportions. It is a little bit ugly but it is much better than the alternatives, and as soon as we finish the transition we can kill the macros.
Quoted 6 lines
I introduce the macros
CHIP_ARG,CHIP_VAR, andCHIP_PARAMwhere appropriate. I change a few declarations of irq as int to unsigned int. I normalize the variables names in the functions that call chip methods to ensure that I have the variables irq and desc present allowingCHIP_ARGto work properly. Most importantly none of the irq logic changes with this patch.
I like that approach very much. Is the output binary equivivalent?
Thanks,
tglx
Re: [PATCH] irq: Start the transition of irq_chip methods taking a desc
Quoted 20 lines · Thomas Gleixner
Eric,
Quoted 17 lines · Eric W. Biederman
With
SPARSE_IRQirq_to_descbecomes an unnecessary lookup operation on the fast path of dispatching irqs to their handlers. We can avoid this cost by passing anirq_descpointer instead of using an integer irq token to theirq_chipmethods.A single patch to convert all of the architectures is an unreviewable 2000+ line patch. A gradual transition scenario with two sets of
irq_chipmethods inirq_chipis an unmanageable mess in kernel/irq.So instead I define some macros so the generic irq code in
kernel/irq/can compile either way based on a booleanKconfigvariableCONFIG_CHIP_PARAM_DESC. This allows us to convert one architecture at a time, reducing the follow on patches to manageable proportions. It is a little bit ugly but it is much better than the alternatives, and as soon as we finish the transition we can kill the macros.
Quoted 9 lines
Quoted 6 lines
I introduce the macros
CHIP_ARG,CHIP_VAR, andCHIP_PARAMwhere appropriate. I change a few declarations of irq as int to unsigned int. I normalize the variables names in the functions that call chip methods to ensure that I have the variables irq and desc present allowingCHIP_ARGto work properly. Most importantly none of the irq logic changes with this patch.I like that approach very much. Is the output binary equivivalent?
great.
will update x86 part and related core according to this, and give it a try.
YH
Re: [PATCH] irq: Start the transition of irq_chip methods taking a desc
In reply to Thomas GleixnerQuoted 20 lines · Thomas Gleixner
Eric,
Quoted 17 lines · Eric W. Biederman
With
SPARSE_IRQirq_to_descbecomes an unnecessary lookup operation on the fast path of dispatching irqs to their handlers. We can avoid this cost by passing anirq_descpointer instead of using an integer irq token to theirq_chipmethods.A single patch to convert all of the architectures is an unreviewable 2000+ line patch. A gradual transition scenario with two sets of
irq_chipmethods inirq_chipis an unmanageable mess in kernel/irq.So instead I define some macros so the generic irq code in
kernel/irq/can compile either way based on a booleanKconfigvariableCONFIG_CHIP_PARAM_DESC. This allows us to convert one architecture at a time, reducing the follow on patches to manageable proportions. It is a little bit ugly but it is much better than the alternatives, and as soon as we finish the transition we can kill the macros.
Quoted 8 lines
Quoted 6 lines
I introduce the macros
CHIP_ARG,CHIP_VAR, andCHIP_PARAMwhere appropriate. I change a few declarations of irq as int to unsigned int. I normalize the variables names in the functions that call chip methods to ensure that I have the variables irq and desc present allowingCHIP_ARGto work properly. Most importantly none of the irq logic changes with this patch.I like that approach very much. Is the output binary equivivalent?
Depends on what you mean.
- If you are concerned about ABI changes, non exist.
- If the question is will the compiler generate the same instruction sequences, I don't expect it will.
In particular the bug fixes to use unsigned int instead of int should affect the tests used in the for_each_irq_desc. Of less avoid-ability is the change to ack_bad to use desc->irq instead of cached irq value.
Since this is the only patch in the entire series that could possibly be binary equivalent I don't find it a particularly interesting test.
Eric
Re: [PATCH 06/12] genericirq: make irq_chip related function to take desc
In reply to Julia LawallQuoted 3 lines · Julia Lawall
I also worked on this, but only sent it to Thomas and Yinghai. Onthe other hand, I mostly like your solution better, because it has the unintended side-effect of getting rid of some blank spaces after {s.
Wow I hadn't noticed that {s removal. That is an old coding style violation on alpha. There was an intentional effect of not breaking up { }'s. But I hadn't realized I was also fixing whitespace.
Quoted 11 lines
My rule was also more complicated in that it also searches for conditions in which it is not sure to be doing the right thing. I will send those in another message.
Quoted 7 lines
@ DECL @
structirq_chipCHIP;
identifier METHOD;
identifierMETHOD_NAME;
@@
CHIP.METHOD_NAME = METHOD;
Quoted 12 lines
Review
Quoted 9 lines
@ @
identifier DECL.METHOD;
identifier IRQ;
@@
METHOD((quoted diff) +1
-1- unsigned int IRQ + struct irq_desc *unused , ...) { }I didn't think of making a special rule for this. It could consider any case where the body is ... when != IRQ
Nice addition.
Quoted 44 lines
Quoted 44 lines
@ @
identifier DECL.METHOD;
identifier IRQ;
identifier DESC;
@@
METHOD((quoted diff) +2
-2- unsigned int IRQ + struct irq_desc *DESC , ...) { + unsigned int IRQ = DESC->irq; - struct irq_desc *DESC = irq_to_desc(IRQ); }@ @
identifier DECL.METHOD;
identifier IRQ;
identifier DESC;
@@
METHOD((quoted diff) +2
-3- unsigned int IRQ + struct irq_desc *DESC , ...) { + unsigned int IRQ = DESC->irq; - struct irq_desc *DESC; - DESC = irq_to_desc(IRQ); }@ @
identifier DECL.METHOD;
identifier IRQ;
@@
METHOD((quoted diff) +2
-1- unsigned int IRQ + struct irq_desc *desc , ...) { + unsigned int IRQ = desc->irq; }
Quoted 16 lines
Review
Quoted 13 lines
@ @
identifier DECL.METHOD;
identifier FUNC;
identifier IRQ;
@@
FUNC(...) {
<...METHOD((quoted diff) +1
-1- IRQ + irq_to_desc(IRQ) , ... ) ...> }I don't think FUNC(...) { <... and ...> } are needed here. The goal is to make the change everywhere the call appears.
That is a reasonable simplification.
Quoted 7 lines
Quoted 7 lines
@ @
identifier FUNC;
identifier DESC;
identifier IRQ;
@@
FUNC(..., struct irq_desc *DESC, ...){
...
Quoted 8 lines
Review
Quoted 6 lines
(quoted diff) +1
-1unsigned int IRQ = DESC->irq; <... - irq_to_desc(IRQ) + DESC ...> }This rule can be extended as follows:
Nice. I had not picked up on the or operator.
Quoted 20 lines
@ @
identifier FUNC;
identifier DESC;
identifier IRQ;
identifier FLD;
@@
FUNC(..., struct irq_desc *DESC, ...){
...unsigned int IRQ = DESC->irq;<...
((quoted diff) +1
-1- irq_to_desc(IRQ) + DESC|
(quoted diff) +1
-1- irq_desc[IRQ].FLD + DESC->FLD)
...>
}
Quoted 1 line
Doing so gets rid of more references to IRQ.
Very reasonable, especially on arches like alpha where none of the sparse irq work has hit.
Quoted 1 line
Another case that can be treated is method calls via a pointer:
I didn't actually find any cases where that rule hit on arch/x86 so I did not include it, but it makes sense.
Quoted 17 lines
@@
expression arg;
structirq_desc*desc;
structirq_chip*ic;
identifier fun;
@@(
desc->chip->fun((quoted diff) +1
-1- arg + desc ,...)|
ic->fun((quoted diff) +1
-1- arg + irq_to_desc(arg) ,...)
Quoted 1 line
)
My paranoid sense says this rule should be:
@ @
expresion IRQ_EXPR;
struct irq_desc *DESC;
struct irq_chip *CHIP;
identifier METHOD;
@@
(
DESC->chip->METHOD(
- IRQ_EXPR
+ irq_to_desc(IRQ_EXPR)
, ... ) | CHIP->METHOD( - IRQ_EXPR + irq_to_desc(IRQ_EXPR) , ... )
If this is before my irq_to_desc removal rule. We should not see any new irq_to_desc calls popping up.
Quoted 12 lines
julia
Quoted 10 lines
@ @
identifier FUNC;
identifier DESC;
identifier IRQ;
@@
FUNC(..., struct irq_desc *DESC, ...){
...(quoted diff) +0
-1- unsigned int IRQ = DESC->irq; ... when != IRQ }
Re: [PATCH 06/12] genericirq: make irq_chip related function to take desc
Quoted 9 lines · Eric W. Biederman
Quoted 3 lines · Julia Lawall
I also worked on this, but only sent it to Thomas and Yinghai. Onthe other hand, I mostly like your solution better, because it has the unintended side-effect of getting rid of some blank spaces after {s.
Wow I hadn't noticed that {s removal. That is an old coding style violation on alpha. There was an intentional effect of not breaking up { }'s. But I hadn't realized I was also fixing whitespace.
I think it is because you added a local declaration of irq and then removed it when it was not necessary. So then coccinelle was motivated to remove the space after the {.
Quoted 174 lines
Quoted 11 lines
My rule was also more complicated in that it also searches for conditions in which it is not sure to be doing the right thing. I will send those in another message.
Quoted 7 lines
@ DECL @
structirq_chipCHIP;
identifier METHOD;
identifierMETHOD_NAME;
@@
CHIP.METHOD_NAME = METHOD;Quoted 12 lines
Review
Quoted 9 lines
@ @
identifier DECL.METHOD;
identifier IRQ;
@@
METHOD((quoted diff) +1
-1- unsigned int IRQ + struct irq_desc *unused , ...) { }I didn't think of making a special rule for this. It could consider any case where the body is ... when != IRQ
Nice addition.
Quoted 44 lines
Quoted 44 lines
@ @
identifier DECL.METHOD;
identifier IRQ;
identifier DESC;
@@
METHOD((quoted diff) +2
-2- unsigned int IRQ + struct irq_desc *DESC , ...) { + unsigned int IRQ = DESC->irq; - struct irq_desc *DESC = irq_to_desc(IRQ); }@ @
identifier DECL.METHOD;
identifier IRQ;
identifier DESC;
@@
METHOD((quoted diff) +2
-3- unsigned int IRQ + struct irq_desc *DESC , ...) { + unsigned int IRQ = DESC->irq; - struct irq_desc *DESC; - DESC = irq_to_desc(IRQ); }@ @
identifier DECL.METHOD;
identifier IRQ;
@@
METHOD((quoted diff) +2
-1- unsigned int IRQ + struct irq_desc *desc , ...) { + unsigned int IRQ = desc->irq; }Quoted 16 lines
Review
Quoted 13 lines
@ @
identifier DECL.METHOD;
identifier FUNC;
identifier IRQ;
@@
FUNC(...) {
<...METHOD((quoted diff) +1
-1- IRQ + irq_to_desc(IRQ) , ... ) ...> }I don't think FUNC(...) { <... and ...> } are needed here. The goal is to make the change everywhere the call appears.
That is a reasonable simplification.
Quoted 7 lines
Quoted 7 lines
@ @
identifier FUNC;
identifier DESC;
identifier IRQ;
@@
FUNC(..., struct irq_desc *DESC, ...){
...Quoted 8 lines
Review
Quoted 6 lines
(quoted diff) +1
-1unsigned int IRQ = DESC->irq; <... - irq_to_desc(IRQ) + DESC ...> }This rule can be extended as follows:
Nice. I had not picked up on the or operator.
Quoted 20 lines
@ @
identifier FUNC;
identifier DESC;
identifier IRQ;
identifier FLD;
@@
FUNC(..., struct irq_desc *DESC, ...){
...unsigned int IRQ = DESC->irq;<...
((quoted diff) +1
-1- irq_to_desc(IRQ) + DESC|
(quoted diff) +1
-1- irq_desc[IRQ].FLD + DESC->FLD)
...>
}Quoted 1 line
Doing so gets rid of more references to IRQ.
Very reasonable, especially on arches like alpha where none of the sparse irq work has hit.
Quoted 1 line
Another case that can be treated is method calls via a pointer:
I didn't actually find any cases where that rule hit on
arch/x86so I did not include it, but it makes sense.Quoted 17 lines
@@
expression arg;
structirq_desc*desc;
structirq_chip*ic;
identifier fun;
@@(
desc->chip->fun((quoted diff) +1
-1- arg + desc ,...)|
ic->fun((quoted diff) +1
-1- arg + irq_to_desc(arg) ,...)Quoted 1 line
)
My paranoid sense says this rule should be:
@ @
expresionIRQ_EXPR;
structirq_desc*DESC;
structirq_chip*CHIP;
identifier METHOD;
@@
((quoted diff) +1
-1DESC->chip->METHOD( - IRQ_EXPR + irq_to_desc(IRQ_EXPR), ... ) | CHIP->METHOD((quoted diff) +1
-1- IRQ_EXPR + irq_to_desc(IRQ_EXPR)
Quoted 1 line
, ... )
Agreed. But then it would be nice to check whether DESC is already computed as irq_to_desc(IRQ_EXPR).
julia
Quoted 16 lines
If this is before my
irq_to_descremoval rule. We should not see any newirq_to_desccalls popping up.Quoted 12 lines
julia
Quoted 10 lines
@ @
identifier FUNC;
identifier DESC;
identifier IRQ;
@@
FUNC(..., struct irq_desc *DESC, ...){
...(quoted diff) +0
-1- unsigned int IRQ = DESC->irq; ... when != IRQ }
Re: [PATCH 06/12] genericirq: make irq_chip related function to take desc
In reply to Eric W. BiedermanThere is a function set_irq_chained_handler that takes a function, handler, as its second argument. It seems that handler is always then called with and irq as the first argument and the associated desc as the second argument. If this is the case, one could drop the irq argument and only use desc. A lot of calls of the form
desc->chip->...(irq_to_desc(irq))
could then become
desc->chip->...(desc)
julia
Re: [PATCH 06/12] genericirq: make irq_chip related function to take desc
In reply to Eric W. BiedermanAnother detail is that the type of irq is not always unsigned int. Coccinelle will match unsigned int to just unsigned, but there are also occurrences of uint32_t and u_int. I don't know if it is desirable to preserve these names, or if it would be just as well to put unsigned int everywhere?
julia
Quoted 124 lines · Eric W. Biederman
I haven't heard anything more on this, but I had reason to play with coccinelle http://coccinelle.lip6.fr/ which I think is think think is the semantic patcher you referred to.
In any case I was playing with it and I believe I have managed to whip up a fairly robust semantic patch. The last two hunks are to cleanup earlier transforms, by removing unnecessary
irq_to_descchatter, and removing unused variables. I am a big grumpy that I couldn't figure out how to add comments to my patch to explain the tricky bits, but otherwise I am happy.The patch appears to have the limitation that methods that are not in the file where struct
irq_chipis defined, which is an issue for the msiirq_chiphelper routines. Other than that I don't know of any issues.I would suggest changing as much of the x86 non
irq_chiphelpers to useirq_descbefore applying this so it this the conversion can have the chance to remove any irq variables.Eric
@ DECL @
structirq_chipCHIP;
identifier METHOD;
identifierMETHOD_NAME;
@@
CHIP.METHOD_NAME = METHOD;@ @
identifier DECL.METHOD;
identifier IRQ;
@@
METHOD((quoted diff) +1
-1- unsigned int IRQ + struct irq_desc *unused , ...) { }@ @
identifier DECL.METHOD;
identifier IRQ;
identifier DESC;
@@
METHOD((quoted diff) +2
-2- unsigned int IRQ + struct irq_desc *DESC , ...) { + unsigned int IRQ = DESC->irq; - struct irq_desc *DESC = irq_to_desc(IRQ); }@ @
identifier DECL.METHOD;
identifier IRQ;
identifier DESC;
@@
METHOD((quoted diff) +2
-3- unsigned int IRQ + struct irq_desc *DESC , ...) { + unsigned int IRQ = DESC->irq; - struct irq_desc *DESC; - DESC = irq_to_desc(IRQ); }@ @
identifier DECL.METHOD;
identifier IRQ;
@@
METHOD((quoted diff) +2
-1- unsigned int IRQ + struct irq_desc *desc , ...) { + unsigned int IRQ = desc->irq; }@ @
identifier DECL.METHOD;
identifier FUNC;
identifier IRQ;
@@
FUNC(...) {
<...METHOD((quoted diff) +1
-1- IRQ + irq_to_desc(IRQ) , ... ) ...> }@ @
identifier FUNC;
identifier DESC;
identifier IRQ;
@@
FUNC(..., struct irq_desc *DESC, ...){
...(quoted diff) +1
-1unsigned int IRQ = DESC->irq; <... - irq_to_desc(IRQ) + DESC ...> }@ @
identifier FUNC;
identifier DESC;
identifier IRQ;
@@
FUNC(..., struct irq_desc *DESC, ...){
...(quoted diff) +0
-1- unsigned int IRQ = DESC->irq; ... when != IRQ }
Re: [PATCH 06/12] genericirq: make irq_chip related function to take desc
Quoted 5 lines · Julia Lawall
Another detail is that the type of irq is not always unsigned int. Coccinelle will match unsigned int to just unsigned, but there are also occurrences of
uint32_tandu_int. I don't know if it is desirable to preserve these names, or if it would be just as well to put unsigned int everywhere?
The correct type of irq is "unsigned int". All others that are I know of are a bit buggy. Especially the cases that use int.
Eric
Re: [PATCH 06/12] genericirq: make irq_chip related function to take desc
In reply to Eric W. BiedermanHere is my semantic patch:
// ----------------------------------------------------------------------- // find functions
@ignore@
struct irq_chip i;
identifier x;
local idexpression l;
position p;
@@
i.x@p = \(NULL\|l\);
@r@
struct irq_chip i;
identifier x!={name,typename},fn;
position p!=ignore.p;
@@
i.x@p = fn;
// ----------------------------------------------------------------------- // normalize code
@@
expression irq;
@@
(
- irq_desc + irq
+ irq_to_desc(irq)
|
- &irq_desc[irq]
+ irq_to_desc(irq)
)
// ----------------------------------------------------------------------- // find their calls
@@
identifier r.fn;
expression irq;
@@
fn(
- irq
+ irq_to_desc(irq)
,...)
@@
struct irq_chip *ic;
struct irq_desc *desc;
identifier fun != {name,typename};
expression irq;
@@
\(ic\|desc->chip\)->fun(
- irq
+ irq_to_desc(irq)
,...)
// ----------------------------------------------------------------------- // find their definitions
@unused@
identifier r.fn,irq;
type T;
@@
fn(
- T irq
+ struct irq_desc *unused
, ...) {
... when != irq
when != unused
when strict
}@with_desc@
identifier r.fn,irqv,desc;
type T;
@@
fn(
- T irqv
+ struct irq_desc *desc
, ...) {+ unsigned int irqv = desc->irq;
...
(
- struct irq_desc *desc = irq_to_desc(irqv);
|
- struct irq_desc *desc;
...
- desc = irq_to_desc(irqv);
)
...
}
@depends on !unused && !with_desc@
identifier r.fn,irqv;
type T;
@@
fn(
- T irqv
+ struct irq_desc *desc
, ...) {+ unsigned int irqv = desc->irq;
... when != desc
when strict
}
// ----------------------------------------------------------------------- // simplify definitions
@@
struct irq_desc *desc;
expression irq,E1,E2;
@@
desc = irq_to_desc(irq)
<...
- irq_to_desc(irq)
+ desc
...>
(
return;
|
desc = E1
|
?irq = E2
)
@@
identifier r.fn,irqv,desc,fld;
@@
fn(struct irq_desc *desc, ...) {
unsigned int irqv = desc->irq;
<...
(
- irq_to_desc(irqv)
+ desc
|
- irq_desc[irqv].fld
+ desc->fld
)
...>
}
@@
struct irq_desc *desc;
@@
- desc = desc;
@@
identifier r.fn,irqv,desc;
@@
fn(struct irq_desc *desc, ...) {
- unsigned int irqv = desc->irq;
... when != irqv
when strict
}
Re: [PATCH 06/12] genericirq: make irq_chip related function to take desc
In reply to Eric W. BiedermanHere is the patch that is generated by my semantic patch. Perhaps it is not safe to just apply it, but it might be useful as a reference.
arch/alpha/kernel/irq.c +1 -1
@@ -56,7 +56,7 @@ int irq_select_affinity(unsigned int irq last_cpu = cpu;cpumask_copy (irq_desc[irq].affinity,cpumask_of (cpu)); - irq_desc[irq].chip->set_affinity (irq,cpumask_of (cpu)); + irq_desc[irq].chip->set_affinity (irq_to_desc (irq),cpumask_of (cpu)); return 0; }#endif /* CONFIG_SMP */
arch/alpha/kernel/irq_alpha.c +2 -2
@@ -218,8 +218,8 @@ process_mcheck_info(unsigned long vector* processed by PALcode, and comes in via entInt vector 1. */ -static void rtc_enable_disable (unsigned int irq) { } -static unsigned int rtc_startup (unsigned int irq) {return 0 ; } +static void rtc_enable_disable (struct irq_desc *unused) { } +static unsigned int rtc_startup (struct irq_desc *unused) {return 0 ; }struct irqaction timer_irqaction = { .handler = timer_interrupt,
arch/alpha/kernel/irq_i8259.c +11 -8
@@ -33,8 +33,9 @@ i8259_update_irq_hw(unsigned int irq, un }inline void -i8259a_enable_irq (unsigned int irq) +i8259a_enable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;spin_lock (&i8259_irq_lock);i8259_update_irq_hw (irq, cached_irq_mask &= ~(1 << irq));spin_unlock (&i8259_irq_lock);
@@ -47,16 +48,18 @@ __i8259a_disable_irq(unsigned int irq) }void -i8259a_disable_irq (unsigned int irq) +i8259a_disable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;spin_lock (&i8259_irq_lock);__i8259a_disable_irq (irq);spin_unlock (&i8259_irq_lock); }void -i8259a_mask_and_ack_irq (unsigned int irq) +i8259a_mask_and_ack_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;spin_lock (&i8259_irq_lock);__i8259a_disable_irq (irq);
@@ -70,17 +73,17 @@ i8259a_mask_and_ack_irq(unsigned int irq }unsigned int -i8259a_startup_irq (unsigned int irq) +i8259a_startup_irq (struct irq_desc *desc) { -i8259a_enable_irq (irq); +i8259a_enable_irq (desc);return 0 ;/* never anything pending */ }void -i8259a_end_irq (unsigned int irq) +i8259a_end_irq (struct irq_desc *desc) { -if (!(irq_desc[irq].status & (IRQ_DISABLED |IRQ_INPROGRESS ))) -i8259a_enable_irq (irq); +if (!(desc->status & (IRQ_DISABLED |IRQ_INPROGRESS ))) +i8259a_enable_irq (desc); }struct irq_chip i8259a_irq_type = {
arch/alpha/kernel/irq_impl.h +5 -5
@@ -31,11 +31,11 @@ extern void init_rtc_irq(void);extern void common_init_isa_dma (void ); -extern void i8259a_enable_irq (unsigned int ); -extern void i8259a_disable_irq (unsigned int ); -extern void i8259a_mask_and_ack_irq (unsigned int ); -extern unsigned int i8259a_startup_irq (unsigned int ); -extern void i8259a_end_irq (unsigned int ); +extern void i8259a_enable_irq (struct irq_desc *); +extern void i8259a_disable_irq (struct irq_desc *); +extern void i8259a_mask_and_ack_irq (struct irq_desc *); +extern unsigned int i8259a_startup_irq (struct irq_desc *); +extern void i8259a_end_irq (struct irq_desc *);extern struct irq_chip i8259a_irq_type;extern void init_i8259a_irqs (void );
arch/alpha/kernel/irq_pyxis.c +11 -8
@@ -29,34 +29,37 @@ pyxis_update_irq_hw(unsigned long mask) }static inline void -pyxis_enable_irq (unsigned int irq) +pyxis_enable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;pyxis_update_irq_hw (cached_irq_mask |=1UL << (irq -16 )); }static void -pyxis_disable_irq (unsigned int irq) +pyxis_disable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;pyxis_update_irq_hw (cached_irq_mask &= ~(1UL << (irq -16 ))); }static unsigned int -pyxis_startup_irq (unsigned int irq) +pyxis_startup_irq (struct irq_desc *desc) { -pyxis_enable_irq (irq); +pyxis_enable_irq (desc);return 0 ; }static void -pyxis_end_irq (unsigned int irq) +pyxis_end_irq (struct irq_desc *desc) { -if (!(irq_desc[irq].status & (IRQ_DISABLED |IRQ_INPROGRESS ))) -pyxis_enable_irq (irq); +if (!(desc->status & (IRQ_DISABLED |IRQ_INPROGRESS ))) +pyxis_enable_irq (desc); }static void -pyxis_mask_and_ack_irq (unsigned int irq) +pyxis_mask_and_ack_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned long bit =1UL << (irq -16 );unsigned long mask = cached_irq_mask &= ~bit;
arch/alpha/kernel/irq_srm.c +9 -7
@@ -18,33 +18,35 @@DEFINE_SPINLOCK (srm_irq_lock);static inline void -srm_enable_irq (unsigned int irq) +srm_enable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;spin_lock (&srm_irq_lock);cserve_ena (irq -16 );spin_unlock (&srm_irq_lock); }static void -srm_disable_irq (unsigned int irq) +srm_disable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;spin_lock (&srm_irq_lock);cserve_dis (irq -16 );spin_unlock (&srm_irq_lock); }static unsigned int -srm_startup_irq (unsigned int irq) +srm_startup_irq (struct irq_desc *desc) { -srm_enable_irq (irq); +srm_enable_irq (desc);return 0 ; }static void -srm_end_irq (unsigned int irq) +srm_end_irq (struct irq_desc *desc) { -if (!(irq_desc[irq].status & (IRQ_DISABLED |IRQ_INPROGRESS ))) -srm_enable_irq (irq); +if (!(desc->status & (IRQ_DISABLED |IRQ_INPROGRESS ))) +srm_enable_irq (desc); }/* Handle interrupts from the SRM, assuming no additional weirdness. */
arch/alpha/kernel/sys_alcor.c +14 -10
@@ -44,21 +44,24 @@ alcor_update_irq_hw(unsigned long mask) }static inline void -alcor_enable_irq (unsigned int irq) +alcor_enable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;alcor_update_irq_hw (cached_irq_mask |=1UL << (irq -16 )); }static void -alcor_disable_irq (unsigned int irq) +alcor_disable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;alcor_update_irq_hw (cached_irq_mask &= ~(1UL << (irq -16 ))); }static void -alcor_mask_and_ack_irq (unsigned int irq) +alcor_mask_and_ack_irq (struct irq_desc *desc) { -alcor_disable_irq (irq); +unsigned int irq = desc->irq; +alcor_disable_irq (desc);/* On ALCOR/XLT, need to dismiss interrupt via GRU. */ *(vuip )GRU_INT_CLEAR =1 << (irq -16 );mb ();
@@ -66,15 +69,16 @@ alcor_mask_and_ack_irq(unsigned int irq) }static unsigned int -alcor_startup_irq (unsigned int irq) +alcor_startup_irq (struct irq_desc *desc) { -alcor_enable_irq (irq); +alcor_enable_irq (desc);return 0 ; }static void -alcor_isa_mask_and_ack_irq (unsigned int irq) +alcor_isa_mask_and_ack_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;i8259a_mask_and_ack_irq (irq);/* On ALCOR/XLT, need to dismiss interrupt via GRU. */
@@ -83,10 +87,10 @@ alcor_isa_mask_and_ack_irq(unsigned int }static void -alcor_end_irq (unsigned int irq) +alcor_end_irq (struct irq_desc *desc) { -if (!(irq_desc[irq].status & (IRQ_DISABLED |IRQ_INPROGRESS ))) -alcor_enable_irq (irq); +if (!(desc->status & (IRQ_DISABLED |IRQ_INPROGRESS ))) +alcor_enable_irq (desc); }static struct irq_chip alcor_irq_type = {
arch/alpha/kernel/sys_cabriolet.c +11 -9
@@ -46,29 +46,31 @@ cabriolet_update_irq_hw(unsigned int irq }static inline void -cabriolet_enable_irq (unsigned int irq) +cabriolet_enable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;cabriolet_update_irq_hw (irq, cached_irq_mask &= ~(1UL << irq)); }static void -cabriolet_disable_irq (unsigned int irq) +cabriolet_disable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;cabriolet_update_irq_hw (irq, cached_irq_mask |=1UL << irq); }static unsigned int -cabriolet_startup_irq (unsigned int irq) -{ -cabriolet_enable_irq (irq); +cabriolet_startup_irq (struct irq_desc *desc) +{ +cabriolet_enable_irq (desc);return 0 ;/* never anything pending */ }static void -cabriolet_end_irq (unsigned int irq) -{ -if (!(irq_desc[irq].status & (IRQ_DISABLED |IRQ_INPROGRESS ))) -cabriolet_enable_irq (irq); +cabriolet_end_irq (struct irq_desc *desc) +{ +if (!(desc->status & (IRQ_DISABLED |IRQ_INPROGRESS ))) +cabriolet_enable_irq (desc); }static struct irq_chip cabriolet_irq_type = {
arch/alpha/kernel/sys_dp264.c +28 -22
107 lines not on this page · raw message
arch/alpha/kernel/sys_eb64p.c +9 -7
@@ -44,29 +44,31 @@ eb64p_update_irq_hw(unsigned int irq, un }static inline void -eb64p_enable_irq (unsigned int irq) +eb64p_enable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;eb64p_update_irq_hw (irq, cached_irq_mask &= ~(1 << irq)); }static void -eb64p_disable_irq (unsigned int irq) +eb64p_disable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;eb64p_update_irq_hw (irq, cached_irq_mask |=1 << irq); }static unsigned int -eb64p_startup_irq (unsigned int irq) +eb64p_startup_irq (struct irq_desc *desc) { -eb64p_enable_irq (irq); +eb64p_enable_irq (desc);return 0 ;/* never anything pending */ }static void -eb64p_end_irq (unsigned int irq) +eb64p_end_irq (struct irq_desc *desc) { -if (!(irq_desc[irq].status & (IRQ_DISABLED |IRQ_INPROGRESS ))) -eb64p_enable_irq (irq); +if (!(desc->status & (IRQ_DISABLED |IRQ_INPROGRESS ))) +eb64p_enable_irq (desc); }static struct irq_chip eb64p_irq_type = {
arch/alpha/kernel/sys_eiger.c +9 -7
@@ -51,33 +51,35 @@ eiger_update_irq_hw(unsigned long irq, u }static inline void -eiger_enable_irq (unsigned int irq) +eiger_enable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned long mask; mask = (cached_irq_mask[irq >=64 ] &= ~(1UL << (irq &63 )));eiger_update_irq_hw (irq, mask); }static void -eiger_disable_irq (unsigned int irq) +eiger_disable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned long mask; mask = (cached_irq_mask[irq >=64 ] |=1UL << (irq &63 ));eiger_update_irq_hw (irq, mask); }static unsigned int -eiger_startup_irq (unsigned int irq) +eiger_startup_irq (struct irq_desc *desc) { -eiger_enable_irq (irq); +eiger_enable_irq (desc);return 0 ;/* never anything pending */ }static void -eiger_end_irq (unsigned int irq) +eiger_end_irq (struct irq_desc *desc) { -if (!(irq_desc[irq].status & (IRQ_DISABLED |IRQ_INPROGRESS ))) -eiger_enable_irq (irq); +if (!(desc->status & (IRQ_DISABLED |IRQ_INPROGRESS ))) +eiger_enable_irq (desc); }static struct irq_chip eiger_irq_type = {
arch/alpha/kernel/sys_jensen.c +14 -8
@@ -63,8 +63,9 @@*/ static unsigned int -jensen_local_startup (unsigned int irq) +jensen_local_startup (struct irq_desc *desc) { +unsigned int irq = desc->irq;/* the parport is really hw IRQ 1, silly Jensen. */ if (irq ==7 )i8259a_startup_irq (1 );
@@ -73,46 +74,51 @@ jensen_local_startup(unsigned int irq)* For all true local interrupts, set the flag that prevents * the IPL from being dropped during handler processing. */ -if (irq_desc[irq].action) - irq_desc[irq].action->flags |=IRQF_DISABLED ; +if (desc->action) + desc->action->flags |=IRQF_DISABLED ;return 0 ; }static void -jensen_local_shutdown (unsigned int irq) +jensen_local_shutdown (struct irq_desc *desc) { +unsigned int irq = desc->irq;/* the parport is really hw IRQ 1, silly Jensen. */ if (irq ==7 )i8259a_disable_irq (1 ); }static void -jensen_local_enable (unsigned int irq) +jensen_local_enable (struct irq_desc *desc) { +unsigned int irq = desc->irq;/* the parport is really hw IRQ 1, silly Jensen. */ if (irq ==7 )i8259a_enable_irq (1 ); }static void -jensen_local_disable (unsigned int irq) +jensen_local_disable (struct irq_desc *desc) { +unsigned int irq = desc->irq;/* the parport is really hw IRQ 1, silly Jensen. */ if (irq ==7 )i8259a_disable_irq (1 ); }static void -jensen_local_ack (unsigned int irq) +jensen_local_ack (struct irq_desc *desc) { +unsigned int irq = desc->irq;/* the parport is really hw IRQ 1, silly Jensen. */ if (irq ==7 )i8259a_mask_and_ack_irq (1 ); }static void -jensen_local_end (unsigned int irq) +jensen_local_end (struct irq_desc *desc) { +unsigned int irq = desc->irq;/* the parport is really hw IRQ 1, silly Jensen. */ if (irq ==7 )i8259a_end_irq (1 );
arch/alpha/kernel/sys_marvel.c +11 -9
@@ -104,8 +104,9 @@ io7_get_irq_ctl(unsigned int irq, struct }static void -io7_enable_irq (unsigned int irq) +io7_enable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;volatile unsigned long *ctl;struct io7 *io7;
@@ -124,8 +125,9 @@ io7_enable_irq(unsigned int irq) }static void -io7_disable_irq (unsigned int irq) +io7_disable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;volatile unsigned long *ctl;struct io7 *io7;
@@ -144,27 +146,27 @@ io7_disable_irq(unsigned int irq) }static unsigned int -io7_startup_irq (unsigned int irq) +io7_startup_irq (struct irq_desc *desc) { -io7_enable_irq (irq); +io7_enable_irq (desc);return 0 ;/* never anything pending */ }static void -io7_end_irq (unsigned int irq) +io7_end_irq (struct irq_desc *desc) { -if (!(irq_desc[irq].status & (IRQ_DISABLED |IRQ_INPROGRESS ))) -io7_enable_irq (irq); +if (!(desc->status & (IRQ_DISABLED |IRQ_INPROGRESS ))) +io7_enable_irq (desc); }static void -marvel_irq_noop (unsigned int irq) +marvel_irq_noop (struct irq_desc *unused) {return ; }static unsigned int -marvel_irq_noop_return (unsigned int irq) +marvel_irq_noop_return (struct irq_desc *unused) {return 0 ; }
arch/alpha/kernel/sys_mikasa.c +9 -7
@@ -43,29 +43,31 @@ mikasa_update_irq_hw(int mask) }static inline void -mikasa_enable_irq (unsigned int irq) +mikasa_enable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;mikasa_update_irq_hw (cached_irq_mask |=1 << (irq -16 )); }static void -mikasa_disable_irq (unsigned int irq) +mikasa_disable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;mikasa_update_irq_hw (cached_irq_mask &= ~(1 << (irq -16 ))); }static unsigned int -mikasa_startup_irq (unsigned int irq) +mikasa_startup_irq (struct irq_desc *desc) { -mikasa_enable_irq (irq); +mikasa_enable_irq (desc);return 0 ; }static void -mikasa_end_irq (unsigned int irq) +mikasa_end_irq (struct irq_desc *desc) { -if (!(irq_desc[irq].status & (IRQ_DISABLED |IRQ_INPROGRESS ))) -mikasa_enable_irq (irq); +if (!(desc->status & (IRQ_DISABLED |IRQ_INPROGRESS ))) +mikasa_enable_irq (desc); }static struct irq_chip mikasa_irq_type = {
arch/alpha/kernel/sys_noritake.c +9 -7
@@ -48,29 +48,31 @@ noritake_update_irq_hw(int irq, int mask }static void -noritake_enable_irq (unsigned int irq) +noritake_enable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;noritake_update_irq_hw (irq, cached_irq_mask |=1 << (irq -16 )); }static void -noritake_disable_irq (unsigned int irq) +noritake_disable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;noritake_update_irq_hw (irq, cached_irq_mask &= ~(1 << (irq -16 ))); }static unsigned int -noritake_startup_irq (unsigned int irq) +noritake_startup_irq (struct irq_desc *desc) { -noritake_enable_irq (irq); +noritake_enable_irq (desc);return 0 ; }static void -noritake_end_irq (unsigned int irq) +noritake_end_irq (struct irq_desc *desc) { -if (!(irq_desc[irq].status & (IRQ_DISABLED |IRQ_INPROGRESS ))) -noritake_enable_irq (irq); +if (!(desc->status & (IRQ_DISABLED |IRQ_INPROGRESS ))) +noritake_enable_irq (desc); }static struct irq_chip noritake_irq_type = {
arch/alpha/kernel/sys_rawhide.c +11 -8
@@ -56,8 +56,9 @@ rawhide_update_irq_hw(int hose, int mask (((h) < MCPCIA_MAX_HOSES) && (cached_irq_masks[(h)] != 0))static inline void -rawhide_enable_irq (unsigned int irq) +rawhide_enable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned int mask, hose; irq -=16 ;
@@ -76,8 +77,9 @@ rawhide_enable_irq(unsigned int irq) }static void -rawhide_disable_irq (unsigned int irq) +rawhide_disable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned int mask, hose; irq -=16 ;
@@ -96,8 +98,9 @@ rawhide_disable_irq(unsigned int irq) }static void -rawhide_mask_and_ack_irq (unsigned int irq) +rawhide_mask_and_ack_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned int mask, mask1, hose; irq -=16 ;
@@ -122,17 +125,17 @@ rawhide_mask_and_ack_irq(unsigned int ir }static unsigned int -rawhide_startup_irq (unsigned int irq) +rawhide_startup_irq (struct irq_desc *desc) { -rawhide_enable_irq (irq); +rawhide_enable_irq (desc);return 0 ; }static void -rawhide_end_irq (unsigned int irq) +rawhide_end_irq (struct irq_desc *desc) { -if (!(irq_desc[irq].status & (IRQ_DISABLED |IRQ_INPROGRESS ))) -rawhide_enable_irq (irq); +if (!(desc->status & (IRQ_DISABLED |IRQ_INPROGRESS ))) +rawhide_enable_irq (desc); }static struct irq_chip rawhide_irq_type = {
arch/alpha/kernel/sys_rx164.c +9 -7
@@ -47,29 +47,31 @@ rx164_update_irq_hw(unsigned long mask) }static inline void -rx164_enable_irq (unsigned int irq) +rx164_enable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;rx164_update_irq_hw (cached_irq_mask |=1UL << (irq -16 )); }static void -rx164_disable_irq (unsigned int irq) +rx164_disable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;rx164_update_irq_hw (cached_irq_mask &= ~(1UL << (irq -16 ))); }static unsigned int -rx164_startup_irq (unsigned int irq) +rx164_startup_irq (struct irq_desc *desc) { -rx164_enable_irq (irq); +rx164_enable_irq (desc);return 0 ; }static void -rx164_end_irq (unsigned int irq) +rx164_end_irq (struct irq_desc *desc) { -if (!(irq_desc[irq].status & (IRQ_DISABLED |IRQ_INPROGRESS ))) -rx164_enable_irq (irq); +if (!(desc->status & (IRQ_DISABLED |IRQ_INPROGRESS ))) +rx164_enable_irq (desc); }static struct irq_chip rx164_irq_type = {
arch/alpha/kernel/sys_sable.c +11 -8
@@ -443,8 +443,9 @@ lynx_swizzle(struct pci_dev *dev, u8 *pi/* GENERIC irq routines */ static inline void -sable_lynx_enable_irq (unsigned int irq) +sable_lynx_enable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned long bit, mask; bit = sable_lynx_irq_swizzle->irq_to_mask[irq];
@@ -459,8 +460,9 @@ sable_lynx_enable_irq(unsigned int irq) }static void -sable_lynx_disable_irq (unsigned int irq) +sable_lynx_disable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned long bit, mask; bit = sable_lynx_irq_swizzle->irq_to_mask[irq];
@@ -475,22 +477,23 @@ sable_lynx_disable_irq(unsigned int irq) }static unsigned int -sable_lynx_startup_irq (unsigned int irq) +sable_lynx_startup_irq (struct irq_desc *desc) { -sable_lynx_enable_irq (irq); +sable_lynx_enable_irq (desc);return 0 ; }static void -sable_lynx_end_irq (unsigned int irq) +sable_lynx_end_irq (struct irq_desc *desc) { -if (!(irq_desc[irq].status & (IRQ_DISABLED |IRQ_INPROGRESS ))) -sable_lynx_enable_irq (irq); +if (!(desc->status & (IRQ_DISABLED |IRQ_INPROGRESS ))) +sable_lynx_enable_irq (desc); }static void -sable_lynx_mask_and_ack_irq (unsigned int irq) +sable_lynx_mask_and_ack_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned long bit, mask; bit = sable_lynx_irq_swizzle->irq_to_mask[irq];
arch/alpha/kernel/sys_takara.c +9 -7
@@ -45,33 +45,35 @@ takara_update_irq_hw(unsigned long irq, }static inline void -takara_enable_irq (unsigned int irq) +takara_enable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned long mask; mask = (cached_irq_mask[irq >=64 ] &= ~(1UL << (irq &63 )));takara_update_irq_hw (irq, mask); }static void -takara_disable_irq (unsigned int irq) +takara_disable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned long mask; mask = (cached_irq_mask[irq >=64 ] |=1UL << (irq &63 ));takara_update_irq_hw (irq, mask); }static unsigned int -takara_startup_irq (unsigned int irq) +takara_startup_irq (struct irq_desc *desc) { -takara_enable_irq (irq); +takara_enable_irq (desc);return 0 ;/* never anything pending */ }static void -takara_end_irq (unsigned int irq) +takara_end_irq (struct irq_desc *desc) { -if (!(irq_desc[irq].status & (IRQ_DISABLED |IRQ_INPROGRESS ))) -takara_enable_irq (irq); +if (!(desc->status & (IRQ_DISABLED |IRQ_INPROGRESS ))) +takara_enable_irq (desc); }static struct irq_chip takara_irq_type = {
arch/alpha/kernel/sys_titan.c +12 -9
@@ -112,8 +112,9 @@ titan_update_irq_hw(unsigned long mask) }static inline void -titan_enable_irq (unsigned int irq) +titan_enable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;spin_lock (&titan_irq_lock); titan_cached_irq_mask |=1UL << (irq -16 );titan_update_irq_hw (titan_cached_irq_mask);
@@ -121,8 +122,9 @@ titan_enable_irq(unsigned int irq) }static inline void -titan_disable_irq (unsigned int irq) +titan_disable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;spin_lock (&titan_irq_lock); titan_cached_irq_mask &= ~(1UL << (irq -16 ));titan_update_irq_hw (titan_cached_irq_mask);
@@ -130,17 +132,17 @@ titan_disable_irq(unsigned int irq) }static unsigned int -titan_startup_irq (unsigned int irq) +titan_startup_irq (struct irq_desc *desc) { -titan_enable_irq (irq); +titan_enable_irq (desc);return 0 ;/* never anything pending */ }static void -titan_end_irq (unsigned int irq) +titan_end_irq (struct irq_desc *desc) { -if (!(irq_desc[irq].status & (IRQ_DISABLED |IRQ_INPROGRESS ))) -titan_enable_irq (irq); +if (!(desc->status & (IRQ_DISABLED |IRQ_INPROGRESS ))) +titan_enable_irq (desc); } static void
@@ -158,8 +160,9 @@ titan_cpu_set_irq_affinity(unsigned int }static int -titan_set_irq_affinity (unsigned int irq,const struct cpumask *affinity) -{ +titan_set_irq_affinity (struct irq_desc *desc,const struct cpumask *affinity) +{ +unsigned int irq = desc->irq;spin_lock (&titan_irq_lock);titan_cpu_set_irq_affinity (irq -16 , *affinity);titan_update_irq_hw (titan_cached_irq_mask);
arch/alpha/kernel/sys_wildfire.c +15 -11
@@ -104,8 +104,9 @@ wildfire_init_irq_hw(void) }static void -wildfire_enable_irq (unsigned int irq) +wildfire_enable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;if (irq <16 )i8259a_enable_irq (irq);
@@ -116,8 +117,9 @@ wildfire_enable_irq(unsigned int irq) }static void -wildfire_disable_irq (unsigned int irq) +wildfire_disable_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;if (irq <16 )i8259a_disable_irq (irq);
@@ -128,8 +130,9 @@ wildfire_disable_irq(unsigned int irq) }static void -wildfire_mask_and_ack_irq (unsigned int irq) +wildfire_mask_and_ack_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;if (irq <16 )i8259a_mask_and_ack_irq (irq);
@@ -140,21 +143,22 @@ wildfire_mask_and_ack_irq(unsigned int i }static unsigned int -wildfire_startup_irq (unsigned int irq) -{ -wildfire_enable_irq (irq); +wildfire_startup_irq (struct irq_desc *desc) +{ +wildfire_enable_irq (desc);return 0 ;/* never anything pending */ }static void -wildfire_end_irq (unsigned int irq) -{ +wildfire_end_irq (struct irq_desc *desc) +{ +unsigned int irq = desc->irq;#if 0 -if (!irq_desc[irq].action) +if (!desc->action)printk ("got irq %d\n" , irq);#endif -if (!(irq_desc[irq].status & (IRQ_DISABLED |IRQ_INPROGRESS ))) -wildfire_enable_irq (irq); +if (!(desc->status & (IRQ_DISABLED |IRQ_INPROGRESS ))) +wildfire_enable_irq (desc); }static struct irq_chip wildfire_irq_type = {
arch/arm/common/gic.c +11 -7
@@ -80,8 +80,9 @@ static inline unsigned int gic_irq(unsig* our "acknowledge" routine disable the interrupt, then mark it as * complete. */ -static void gic_ack_irq (unsigned int irq) +static void gic_ack_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;u32 mask =1 << (irq %32 );spin_lock (&irq_controller_lock);
@@ -90,8 +91,9 @@ static void gic_ack_irq(unsigned int irqspin_unlock (&irq_controller_lock); } -static void gic_mask_irq (unsigned int irq) +static void gic_mask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;u32 mask =1 << (irq %32 );spin_lock (&irq_controller_lock);
@@ -99,8 +101,9 @@ static void gic_mask_irq(unsigned int irspin_unlock (&irq_controller_lock); } -static void gic_unmask_irq (unsigned int irq) +static void gic_unmask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;u32 mask =1 << (irq %32 );spin_lock (&irq_controller_lock);
@@ -109,15 +112,16 @@ static void gic_unmask_irq(unsigned int }#ifdef CONFIG_SMP -static int gic_set_cpu (unsigned int irq,const struct cpumask *mask_val) +static int gic_set_cpu (struct irq_desc *desc,const struct cpumask *mask_val) { +unsigned int irq = desc->irq;void __iomem *reg =gic_dist_base (irq) +GIC_DIST_TARGET + (gic_irq (irq) & ~3 );unsigned int shift = (irq %4 ) *8 ;unsigned int cpu =cpumask_first (mask_val);u32 val;spin_lock (&irq_controller_lock); - irq_desc[irq].node = cpu; + desc->node = cpu; val =readl (reg) & ~(0xff << shift); val |=1 << (cpu + shift);writel (val, reg);
@@ -135,7 +139,7 @@ static void gic_handle_cascade_irq(unsigunsigned long status;/* primary controller ack'ing */ - chip->ack (irq); + chip->ack (irq_to_desc (irq));spin_lock (&irq_controller_lock); status =readl (chip_data->cpu_base +GIC_CPU_INTACK );
@@ -153,7 +157,7 @@ static void gic_handle_cascade_irq(unsig out:/* primary controller unmasking */ - chip->unmask (irq); + chip->unmask (irq_to_desc (irq)); }static struct irq_chip gic_chip = {
arch/arm/common/it8152.c +4 -2
@@ -32,8 +32,9 @@#define MAX_SLOTS 21 -static void it8152_mask_irq (unsigned int irq) +static void it8152_mask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;if (irq >=IT8152_LD_IRQ (0 )) { __raw_writel((__raw_readl(IT8152_INTC_LDCNIMR) | (1 << (irq - IT8152_LD_IRQ(0)))),
@@ -49,8 +50,9 @@ static void it8152_mask_irq(unsigned int } } -static void it8152_unmask_irq (unsigned int irq) +static void it8152_unmask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;if (irq >=IT8152_LD_IRQ (0 )) { __raw_writel((__raw_readl(IT8152_INTC_LDCNIMR) & ~(1 << (irq - IT8152_LD_IRQ(0)))),
arch/arm/common/locomo.c +6 -4
@@ -144,7 +144,7 @@ static void locomo_handler(unsigned intint req, i;/* Acknowledge the parent IRQ */ - desc->chip->ack (irq); + desc->chip->ack (irq_to_desc (irq));/* check why this interrupt was generated */ req =locomo_readl (lchip->base +LOCOMO_ICR ) &0x0f00 ;
@@ -161,12 +161,13 @@ static void locomo_handler(unsigned int } } -static void locomo_ack_irq (unsigned int irq) +static void locomo_ack_irq (struct irq_desc *unused) { } -static void locomo_mask_irq (unsigned int irq) +static void locomo_mask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;struct locomo *lchip =get_irq_chip_data (irq);unsigned int r; r =locomo_readl (lchip->base +LOCOMO_ICR );
@@ -174,8 +175,9 @@ static void locomo_mask_irq(unsigned intlocomo_writel (r, lchip->base +LOCOMO_ICR ); } -static void locomo_unmask_irq (unsigned int irq) +static void locomo_unmask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;struct locomo *lchip =get_irq_chip_data (irq);unsigned int r; r =locomo_readl (lchip->base +LOCOMO_ICR );
arch/arm/common/sa1111.c +23 -13
@@ -213,7 +213,7 @@ sa1111_irq_handler(unsigned int irq, strsa1111_writel (stat0, mapbase +SA1111_INTSTATCLR0 ); - desc->chip->ack (irq); + desc->chip->ack (irq_to_desc (irq));sa1111_writel (stat1, mapbase +SA1111_INTSTATCLR1 );
@@ -231,18 +231,19 @@ sa1111_irq_handler(unsigned int irq, strgeneric_handle_irq (i + sachip->irq_base);/* For level-based interrupts */ - desc->chip->unmask (irq); + desc->chip->unmask (irq_to_desc (irq)); }#define SA1111_IRQMASK_LO (x) (1 << (x - sachip->irq_base))#define SA1111_IRQMASK_HI (x) (1 << (x - sachip->irq_base - 32)) -static void sa1111_ack_irq (unsigned int irq) +static void sa1111_ack_irq (struct irq_desc *unused) { } -static void sa1111_mask_lowirq (unsigned int irq) +static void sa1111_mask_lowirq (struct irq_desc *desc) { +unsigned int irq = desc->irq;struct sa1111 *sachip =get_irq_chip_data (irq);void __iomem *mapbase = sachip->base +SA1111_INTC ;unsigned long ie0;
@@ -252,8 +253,9 @@ static void sa1111_mask_lowirq(unsignedwritel (ie0, mapbase +SA1111_INTEN0 ); } -static void sa1111_unmask_lowirq (unsigned int irq) +static void sa1111_unmask_lowirq (struct irq_desc *desc) { +unsigned int irq = desc->irq;struct sa1111 *sachip =get_irq_chip_data (irq);void __iomem *mapbase = sachip->base +SA1111_INTC ;unsigned long ie0;
@@ -270,8 +272,9 @@ static void sa1111_unmask_lowirq(unsigne* be triggered. In fact, its very difficult, if not impossible to get * INTSET to re-trigger the interrupt. */ -static int sa1111_retrigger_lowirq (unsigned int irq) +static int sa1111_retrigger_lowirq (struct irq_desc *desc) { +unsigned int irq = desc->irq;struct sa1111 *sachip =get_irq_chip_data (irq);void __iomem *mapbase = sachip->base +SA1111_INTC ;unsigned int mask =SA1111_IRQMASK_LO (irq);
@@ -292,8 +295,9 @@ static int sa1111_retrigger_lowirq(unsigreturn i ==8 ?-1 :0 ; } -static int sa1111_type_lowirq (unsigned int irq,unsigned int flags) +static int sa1111_type_lowirq (struct irq_desc *desc,unsigned int flags) { +unsigned int irq = desc->irq;struct sa1111 *sachip =get_irq_chip_data (irq);void __iomem *mapbase = sachip->base +SA1111_INTC ;unsigned int mask =SA1111_IRQMASK_LO (irq);
@@ -316,8 +320,9 @@ static int sa1111_type_lowirq(unsigned ireturn 0 ; } -static int sa1111_wake_lowirq (unsigned int irq,unsigned int on) +static int sa1111_wake_lowirq (struct irq_desc *desc,unsigned int on) { +unsigned int irq = desc->irq;struct sa1111 *sachip =get_irq_chip_data (irq);void __iomem *mapbase = sachip->base +SA1111_INTC ;unsigned int mask =SA1111_IRQMASK_LO (irq);
@@ -343,8 +348,9 @@ static struct irq_chip sa1111_low_chip = .set_wake = sa1111_wake_lowirq, }; -static void sa1111_mask_highirq (unsigned int irq) +static void sa1111_mask_highirq (struct irq_desc *desc) { +unsigned int irq = desc->irq;struct sa1111 *sachip =get_irq_chip_data (irq);void __iomem *mapbase = sachip->base +SA1111_INTC ;unsigned long ie1;
@@ -354,8 +360,9 @@ static void sa1111_mask_highirq(unsignedsa1111_writel (ie1, mapbase +SA1111_INTEN1 ); } -static void sa1111_unmask_highirq (unsigned int irq) +static void sa1111_unmask_highirq (struct irq_desc *desc) { +unsigned int irq = desc->irq;struct sa1111 *sachip =get_irq_chip_data (irq);void __iomem *mapbase = sachip->base +SA1111_INTC ;unsigned long ie1;
@@ -372,8 +379,9 @@ static void sa1111_unmask_highirq(unsign* be triggered. In fact, its very difficult, if not impossible to get * INTSET to re-trigger the interrupt. */ -static int sa1111_retrigger_highirq (unsigned int irq) +static int sa1111_retrigger_highirq (struct irq_desc *desc) { +unsigned int irq = desc->irq;struct sa1111 *sachip =get_irq_chip_data (irq);void __iomem *mapbase = sachip->base +SA1111_INTC ;unsigned int mask =SA1111_IRQMASK_HI (irq);
@@ -394,8 +402,9 @@ static int sa1111_retrigger_highirq(unsireturn i ==8 ?-1 :0 ; } -static int sa1111_type_highirq (unsigned int irq,unsigned int flags) +static int sa1111_type_highirq (struct irq_desc *desc,unsigned int flags) { +unsigned int irq = desc->irq;struct sa1111 *sachip =get_irq_chip_data (irq);void __iomem *mapbase = sachip->base +SA1111_INTC ;unsigned int mask =SA1111_IRQMASK_HI (irq);
@@ -418,8 +427,9 @@ static int sa1111_type_highirq(unsignedreturn 0 ; } -static int sa1111_wake_highirq (unsigned int irq,unsigned int on) +static int sa1111_wake_highirq (struct irq_desc *desc,unsigned int on) { +unsigned int irq = desc->irq;struct sa1111 *sachip =get_irq_chip_data (irq);void __iomem *mapbase = sachip->base +SA1111_INTC ;unsigned int mask =SA1111_IRQMASK_HI (irq);
arch/arm/common/vic.c +8 -4
@@ -204,8 +204,9 @@ static void __init vic_pm_register(voidstatic inline void vic_pm_register (void __iomem *base,unsigned int irq,u32 arg1) { }#endif /* CONFIG_PM */ -static void vic_ack_irq (unsigned int irq) +static void vic_ack_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;void __iomem *base =get_irq_chip_data (irq); irq &=31 ;writel (1 << irq, base +VIC_INT_ENABLE_CLEAR );
@@ -213,15 +214,17 @@ static void vic_ack_irq(unsigned int irqwritel (1 << irq, base +VIC_INT_SOFT_CLEAR ); } -static void vic_mask_irq (unsigned int irq) +static void vic_mask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;void __iomem *base =get_irq_chip_data (irq); irq &=31 ;writel (1 << irq, base +VIC_INT_ENABLE_CLEAR ); } -static void vic_unmask_irq (unsigned int irq) +static void vic_unmask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;void __iomem *base =get_irq_chip_data (irq); irq &=31 ;writel (1 << irq, base +VIC_INT_ENABLE );
@@ -242,8 +245,9 @@ static struct vic_device *vic_from_irq(ureturn NULL ; } -static int vic_set_wake (unsigned int irq,unsigned int on) +static int vic_set_wake (struct irq_desc *desc,unsigned int on) { +unsigned int irq = desc->irq;struct vic_device *v =vic_from_irq (irq);unsigned int off = irq &31 ;u32 bit =1 << off;
arch/arm/kernel/ecard.c +7 -5
@@ -443,8 +443,9 @@ static expansioncard_ops_t ecard_default* * They are not meant to be called directly, but via enable/disable_irq. */ -static void ecard_irq_unmask (unsigned int irqnr) +static void ecard_irq_unmask (struct irq_desc *desc) { +unsigned int irqnr = desc->irq;ecard_t *ec =slot_to_ecard (irqnr -32 );if (ec) {
@@ -459,8 +460,9 @@ static void ecard_irq_unmask(unsigned in } } -static void ecard_irq_mask (unsigned int irqnr) +static void ecard_irq_mask (struct irq_desc *desc) { +unsigned int irqnr = desc->irq;ecard_t *ec =slot_to_ecard (irqnr -32 );if (ec) {
@@ -551,7 +553,7 @@ static void ecard_check_lockup(struct irprintk (KERN_ERR "\nInterrupt lockup detected - " "disabling all expansion card interrupts\n" ); - desc->chip->mask (IRQ_EXPANSIONCARD ); + desc->chip->mask (irq_to_desc (IRQ_EXPANSIONCARD ));ecard_dump_irq_state (); } }else
@@ -574,7 +576,7 @@ ecard_irq_handler(unsigned int irq, struecard_t *ec;int called =0 ; - desc->chip->mask (irq); + desc->chip->mask (irq_to_desc (irq));for (ec = cards; ec; ec = ec->next) {int pending;
@@ -591,7 +593,7 @@ ecard_irq_handler(unsigned int irq, stru called ++; } } - desc->chip->unmask (irq); + desc->chip->unmask (irq_to_desc (irq));if (called ==0 )ecard_check_lockup (desc);
arch/arm/kernel/irq.c +3 -3
@@ -138,7 +138,7 @@ void set_irq_flags(unsigned int irq, unsreturn ; } - desc = irq_desc + irq; + desc =irq_to_desc (irq);raw_spin_lock_irqsave (&desc->lock, flags); desc->status |=IRQ_NOREQUEST |IRQ_NOPROBE |IRQ_NOAUTOEN ;if (iflags &IRQF_VALID )
@@ -167,7 +167,7 @@ static void route_irq(struct irq_desc *dpr_debug ("IRQ%u: moving from cpu%u to cpu%u\n" , irq, desc->node, cpu);raw_spin_lock_irq (&desc->lock); - desc->chip->set_affinity (irq,cpumask_of (cpu)); + desc->chip->set_affinity (irq_to_desc (irq),cpumask_of (cpu));raw_spin_unlock_irq (&desc->lock); }
@@ -181,7 +181,7 @@ void migrate_irqs(void)unsigned int i, cpu =smp_processor_id ();for (i =0 ; i <NR_IRQS ; i++) { -struct irq_desc *desc = irq_desc + i; +struct irq_desc *desc =irq_to_desc (i);if (desc->node == cpu) { unsigned int newcpu = cpumask_any_and(desc->affinity,
arch/arm/mach-aaec2000/core.c +6 -3
@@ -67,18 +67,21 @@ void __init aaec2000_map_io(void)/* * Interrupt handling routines */ -static void aaec2000_int_ack (unsigned int irq) +static void aaec2000_int_ack (struct irq_desc *desc) { +unsigned int irq = desc->irq;IRQ_INTSR =1 << irq; } -static void aaec2000_int_mask (unsigned int irq) +static void aaec2000_int_mask (struct irq_desc *desc) { +unsigned int irq = desc->irq;IRQ_INTENC |= (1 << irq); } -static void aaec2000_int_unmask (unsigned int irq) +static void aaec2000_int_unmask (struct irq_desc *desc) { +unsigned int irq = desc->irq;IRQ_INTENS |= (1 << irq); }
arch/arm/mach-at91/gpio.c +11 -8
@@ -274,8 +274,9 @@ EXPORT_SYMBOL(at91_get_gpio_value);static u32 wakeups[MAX_GPIO_BANKS ];static u32 backups[MAX_GPIO_BANKS ]; -static int gpio_irq_set_wake (unsigned pin,unsigned state) +static int gpio_irq_set_wake (struct irq_desc *desc,unsigned state) { +unsigned int pin = desc->irq;unsigned mask =pin_to_mask (pin);unsigned bank = (pin -PIN_BASE ) /32 ;
@@ -344,8 +345,9 @@ void at91_gpio_resume(void)* IRQ0..IRQ6 should be configurable, e.g. level vs edge triggering. */ -static void gpio_irq_mask (unsigned pin) +static void gpio_irq_mask (struct irq_desc *desc) { +unsigned int pin = desc->irq;void __iomem *pio =pin_to_controller (pin);unsigned mask =pin_to_mask (pin);
@@ -353,8 +355,9 @@ static void gpio_irq_mask(unsigned pin)__raw_writel (mask, pio +PIO_IDR ); } -static void gpio_irq_unmask (unsigned pin) +static void gpio_irq_unmask (struct irq_desc *desc) { +unsigned int pin = desc->irq;void __iomem *pio =pin_to_controller (pin);unsigned mask =pin_to_mask (pin);
@@ -362,7 +365,7 @@ static void gpio_irq_unmask(unsigned pin__raw_writel (mask, pio +PIO_IER ); } -static int gpio_irq_type (unsigned pin,unsigned type) +static int gpio_irq_type (struct irq_desc *unused,unsigned type) {switch (type) {case IRQ_TYPE_NONE :
@@ -393,7 +396,7 @@ static void gpio_irq_handler(unsigned ir pio = at91_gpio->regbase;/* temporarily mask (level sensitive) parent IRQ */ - desc->chip->ack (irq); + desc->chip->ack (irq_to_desc (irq));for (;;) {/* Reading ISR acks pending (edge triggered) GPIO interrupts. * When there none are pending, we're finished unless we need
@@ -409,7 +412,7 @@ static void gpio_irq_handler(unsigned ir } pin = at91_gpio->chip.base; - gpio = &irq_desc[pin]; + gpio =irq_to_desc (pin);while (isr) {if (isr &1 ) {
@@ -419,7 +422,7 @@ static void gpio_irq_handler(unsigned ir* another IRQ must be generated before it actually gets * here to be disabled on the GPIO controller. */ -gpio_irq_mask (pin); +gpio_irq_mask (gpio); }else generic_handle_irq (pin);
@@ -429,7 +432,7 @@ static void gpio_irq_handler(unsigned ir isr >>=1 ; } } - desc->chip->unmask (irq); + desc->chip->unmask (irq_to_desc (irq));/* now it may re-trigger */ }
arch/arm/mach-at91/irq.c +8 -4
@@ -34,14 +34,16 @@#include <asm/mach/map.h> -static void at91_aic_mask_irq (unsigned int irq) +static void at91_aic_mask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;/* Disable interrupt on AIC */ at91_sys_write (AT91_AIC_IDCR ,1 << irq); } -static void at91_aic_unmask_irq (unsigned int irq) +static void at91_aic_unmask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;/* Enable interrupt on AIC */ at91_sys_write (AT91_AIC_IECR ,1 << irq); }
@@ -50,8 +52,9 @@ unsigned int at91_extern_irq;#define is_extern_irq (irq) ((1 << (irq)) & at91_extern_irq) -static int at91_aic_set_type (unsigned irq,unsigned type) +static int at91_aic_set_type (struct irq_desc *desc,unsigned type) { +unsigned int irq = desc->irq;unsigned int smr, srctype;switch (type) {
@@ -87,8 +90,9 @@ static int at91_aic_set_type(unsigned irstatic u32 wakeups;static u32 backups; -static int at91_aic_set_wake (unsigned irq,unsigned value) +static int at91_aic_set_wake (struct irq_desc *desc,unsigned value) { +unsigned int irq = desc->irq;if (unlikely (irq >=32 ))return -EINVAL ;
arch/arm/mach-bcmring/irq.c +12 -6
@@ -30,38 +30,44 @@#include <mach/csp/intcHw_reg.h> #include <mach/csp/mm_io.h> -static void bcmring_mask_irq0 (unsigned int irq) +static void bcmring_mask_irq0 (struct irq_desc *desc) { +unsigned int irq = desc->irq;writel (1 << (irq -IRQ_INTC0_START ),MM_IO_BASE_INTC0 +INTCHW_INTENCLEAR ); } -static void bcmring_unmask_irq0 (unsigned int irq) +static void bcmring_unmask_irq0 (struct irq_desc *desc) { +unsigned int irq = desc->irq;writel (1 << (irq -IRQ_INTC0_START ),MM_IO_BASE_INTC0 +INTCHW_INTENABLE ); } -static void bcmring_mask_irq1 (unsigned int irq) +static void bcmring_mask_irq1 (struct irq_desc *desc) { +unsigned int irq = desc->irq;writel (1 << (irq -IRQ_INTC1_START ),MM_IO_BASE_INTC1 +INTCHW_INTENCLEAR ); } -static void bcmring_unmask_irq1 (unsigned int irq) +static void bcmring_unmask_irq1 (struct irq_desc *desc) { +unsigned int irq = desc->irq;writel (1 << (irq -IRQ_INTC1_START ),MM_IO_BASE_INTC1 +INTCHW_INTENABLE ); } -static void bcmring_mask_irq2 (unsigned int irq) +static void bcmring_mask_irq2 (struct irq_desc *desc) { +unsigned int irq = desc->irq;writel (1 << (irq -IRQ_SINTC_START ),MM_IO_BASE_SINTC +INTCHW_INTENCLEAR ); } -static void bcmring_unmask_irq2 (unsigned int irq) +static void bcmring_unmask_irq2 (struct irq_desc *desc) { +unsigned int irq = desc->irq;writel (1 << (irq -IRQ_SINTC_START ),MM_IO_BASE_SINTC +INTCHW_INTENABLE ); }
arch/arm/mach-clps711x/irq.c +12 -6
@@ -27,8 +27,9 @@#include <asm/hardware/clps7111.h> -static void int1_mask (unsigned int irq) +static void int1_mask (struct irq_desc *desc) { +unsigned int irq = desc->irq;u32 intmr1; intmr1 =clps_readl (INTMR1 );
@@ -36,8 +37,9 @@ static void int1_mask(unsigned int irq)clps_writel (intmr1,INTMR1 ); } -static void int1_ack (unsigned int irq) +static void int1_ack (struct irq_desc *desc) { +unsigned int irq = desc->irq;u32 intmr1; intmr1 =clps_readl (INTMR1 );
@@ -54,8 +56,9 @@ static void int1_ack(unsigned int irq) } } -static void int1_unmask (unsigned int irq) +static void int1_unmask (struct irq_desc *desc) { +unsigned int irq = desc->irq;u32 intmr1; intmr1 =clps_readl (INTMR1 );
@@ -69,8 +72,9 @@ static struct irq_chip int1_chip = { .unmask = int1_unmask, }; -static void int2_mask (unsigned int irq) +static void int2_mask (struct irq_desc *desc) { +unsigned int irq = desc->irq;u32 intmr2; intmr2 =clps_readl (INTMR2 );
@@ -78,8 +82,9 @@ static void int2_mask(unsigned int irq)clps_writel (intmr2,INTMR2 ); } -static void int2_ack (unsigned int irq) +static void int2_ack (struct irq_desc *desc) { +unsigned int irq = desc->irq;u32 intmr2; intmr2 =clps_readl (INTMR2 );
@@ -91,8 +96,9 @@ static void int2_ack(unsigned int irq) } } -static void int2_unmask (unsigned int irq) +static void int2_unmask (struct irq_desc *desc) { +unsigned int irq = desc->irq;u32 intmr2; intmr2 =clps_readl (INTMR2 );
arch/arm/mach-davinci/cp_intc.c +9 -5
@@ -27,14 +27,16 @@ static inline void cp_intc_write(unsigne__raw_writel (value, cp_intc_base + offset); } -static void cp_intc_ack_irq (unsigned int irq) +static void cp_intc_ack_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;cp_intc_write (irq,CP_INTC_SYS_STAT_IDX_CLR ); }/* Disable interrupt */ -static void cp_intc_mask_irq (unsigned int irq) +static void cp_intc_mask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;/* XXX don't know why we need to disable nIRQ here... */ cp_intc_write (1 ,CP_INTC_HOST_ENABLE_IDX_CLR );cp_intc_write (irq,CP_INTC_SYS_ENABLE_IDX_CLR );
@@ -42,13 +44,15 @@ static void cp_intc_mask_irq(unsigned in }/* Enable interrupt */ -static void cp_intc_unmask_irq (unsigned int irq) +static void cp_intc_unmask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;cp_intc_write (irq,CP_INTC_SYS_ENABLE_IDX_SET ); } -static int cp_intc_set_irq_type (unsigned int irq,unsigned int flow_type) +static int cp_intc_set_irq_type (struct irq_desc *desc,unsigned int flow_type) { +unsigned int irq = desc->irq;unsigned reg =BIT_WORD (irq);unsigned mask =BIT_MASK (irq);unsigned polarity =cp_intc_read (CP_INTC_SYS_POLARITY (reg));
@@ -86,7 +90,7 @@ static int cp_intc_set_irq_type(unsigned* generic drivers which call {enable|disable}_irq_wake for * wake up interrupt sources (eg RTC on DA850). */ -static int cp_intc_set_wake (unsigned int irq,unsigned int on) +static int cp_intc_set_wake (struct irq_desc *unused,unsigned int on) {return 0 ; }
arch/arm/mach-davinci/gpio.c +15 -11
@@ -168,8 +168,9 @@ pure_initcall(davinci_gpio_setup);* serve as EDMA event triggers. */ -static void gpio_irq_disable (unsigned irq) +static void gpio_irq_disable (struct irq_desc *desc) { +unsigned int irq = desc->irq;struct gpio_controller __iomem *g =irq2controller (irq);u32 mask = (u32 )get_irq_data (irq);
@@ -177,11 +178,12 @@ static void gpio_irq_disable(unsigned ir__raw_writel (mask, &g->clr_rising); } -static void gpio_irq_enable (unsigned irq) +static void gpio_irq_enable (struct irq_desc *desc) { +unsigned int irq = desc->irq;struct gpio_controller __iomem *g =irq2controller (irq);u32 mask = (u32 )get_irq_data (irq); -unsigned status = irq_desc[irq].status; +unsigned status = desc->status; status &=IRQ_TYPE_EDGE_FALLING |IRQ_TYPE_EDGE_RISING ;if (!status)
@@ -193,19 +195,20 @@ static void gpio_irq_enable(unsigned irq__raw_writel (mask, &g->set_rising); } -static int gpio_irq_type (unsigned irq,unsigned trigger) +static int gpio_irq_type (struct irq_desc *desc,unsigned trigger) { +unsigned int irq = desc->irq;struct gpio_controller __iomem *g =irq2controller (irq);u32 mask = (u32 )get_irq_data (irq);if (trigger & ~(IRQ_TYPE_EDGE_FALLING |IRQ_TYPE_EDGE_RISING ))return -EINVAL ; - irq_desc[irq].status &= ~IRQ_TYPE_SENSE_MASK ; - irq_desc[irq].status |= trigger; + desc->status &= ~IRQ_TYPE_SENSE_MASK ; + desc->status |= trigger;/* don't enable the IRQ if it's currently disabled */ -if (irq_desc[irq].depth ==0 ) { +if (desc->depth ==0 ) {__raw_writel (mask, (trigger &IRQ_TYPE_EDGE_FALLING ) ? &g->set_falling : &g->clr_falling); __raw_writel(mask, (trigger & IRQ_TYPE_EDGE_RISING)
@@ -232,8 +235,8 @@ gpio_irq_handler(unsigned irq, struct ir mask <<=16 ;/* temporarily mask (level sensitive) parent IRQ */ - desc->chip->mask (irq); - desc->chip->ack (irq); + desc->chip->mask (irq_to_desc (irq)); + desc->chip->ack (irq_to_desc (irq));while (1 ) {u32 status;int n;
@@ -256,7 +259,7 @@ gpio_irq_handler(unsigned irq, struct ir status >>= res; } } - desc->chip->unmask (irq); + desc->chip->unmask (irq_to_desc (irq));/* now it may re-trigger */ }
@@ -283,8 +286,9 @@ static int gpio_to_irq_unbanked(struct greturn -ENODEV ; } -static int gpio_irq_type_unbanked (unsigned irq,unsigned trigger) +static int gpio_irq_type_unbanked (struct irq_desc *desc,unsigned trigger) { +unsigned int irq = desc->irq;struct gpio_controller __iomem *g =irq2controller (irq);u32 mask = (u32 )get_irq_data (irq);
arch/arm/mach-davinci/irq.c +6 -3
@@ -53,8 +53,9 @@ static inline void davinci_irq_writel(un }/* Disable interrupt */ -static void davinci_mask_irq (unsigned int irq) +static void davinci_mask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned int mask;u32 l;
@@ -72,8 +73,9 @@ static void davinci_mask_irq(unsigned in }/* Enable interrupt */ -static void davinci_unmask_irq (unsigned int irq) +static void davinci_unmask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned int mask;u32 l;
@@ -91,8 +93,9 @@ static void davinci_unmask_irq(unsigned }/* EOI interrupt */ -static void davinci_ack_irq (unsigned int irq) +static void davinci_ack_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned int mask; mask =1 <<IRQ_BIT (irq);
arch/arm/mach-dove/irq.c +7 -4
@@ -36,8 +36,9 @@ static void gpio_irq_handler(unsigned in } } -static void pmu_irq_mask (unsigned int irq) +static void pmu_irq_mask (struct irq_desc *desc) { +unsigned int irq = desc->irq;int pin =irq_to_pmu (irq);u32 u;
@@ -46,8 +47,9 @@ static void pmu_irq_mask(unsigned int irwritel (u,PMU_INTERRUPT_MASK ); } -static void pmu_irq_unmask (unsigned int irq) +static void pmu_irq_unmask (struct irq_desc *desc) { +unsigned int irq = desc->irq;int pin =irq_to_pmu (irq);u32 u;
@@ -56,8 +58,9 @@ static void pmu_irq_unmask(unsigned intwritel (u,PMU_INTERRUPT_MASK ); } -static void pmu_irq_ack (unsigned int irq) +static void pmu_irq_ack (struct irq_desc *desc) { +unsigned int irq = desc->irq;int pin =irq_to_pmu (irq);u32 u;
@@ -86,7 +89,7 @@ static void pmu_irq_handler(unsigned intif (!(cause & (1 << irq)))continue ; irq =pmu_to_irq (irq); - desc = irq_desc + irq; + desc =irq_to_desc (irq);desc_handle_irq (irq, desc); } }
arch/arm/mach-ebsa110/core.c +4 -2
@@ -35,13 +35,15 @@#define IRQ_STAT 0xff000000/* read */ #define IRQ_MCLR 0xff000000/* write */ -static void ebsa110_mask_irq (unsigned int irq) +static void ebsa110_mask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;__raw_writeb (1 << irq,IRQ_MCLR ); } -static void ebsa110_unmask_irq (unsigned int irq) +static void ebsa110_unmask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;__raw_writeb (1 << irq,IRQ_MSET ); }
arch/arm/mach-ep93xx/gpio.c +13 -9
@@ -112,13 +112,14 @@ static void ep93xx_gpio_f_irq_handler(ungeneric_handle_irq (gpio_irq); } -static void ep93xx_gpio_irq_ack (unsigned int irq) +static void ep93xx_gpio_irq_ack (struct irq_desc *desc) { +unsigned int irq = desc->irq;int line =irq_to_gpio (irq);int port = line >>3 ;int port_mask =1 << (line &7 ); -if ((irq_desc[irq].status &IRQ_TYPE_SENSE_MASK ) ==IRQ_TYPE_EDGE_BOTH ) { +if ((desc->status &IRQ_TYPE_SENSE_MASK ) ==IRQ_TYPE_EDGE_BOTH ) { gpio_int_type2[port] ^= port_mask;/* switch edge direction */ ep93xx_gpio_update_int_params (port); }
@@ -126,13 +127,14 @@ static void ep93xx_gpio_irq_ack(unsigned__raw_writeb (port_mask,EP93XX_GPIO_REG (eoi_register_offset[port])); } -static void ep93xx_gpio_irq_mask_ack (unsigned int irq) +static void ep93xx_gpio_irq_mask_ack (struct irq_desc *desc) { +unsigned int irq = desc->irq;int line =irq_to_gpio (irq);int port = line >>3 ;int port_mask =1 << (line &7 ); -if ((irq_desc[irq].status &IRQ_TYPE_SENSE_MASK ) ==IRQ_TYPE_EDGE_BOTH ) +if ((desc->status &IRQ_TYPE_SENSE_MASK ) ==IRQ_TYPE_EDGE_BOTH ) gpio_int_type2[port] ^= port_mask;/* switch edge direction */ gpio_int_unmasked[port] &= ~port_mask;
@@ -141,8 +143,9 @@ static void ep93xx_gpio_irq_mask_ack(uns__raw_writeb (port_mask,EP93XX_GPIO_REG (eoi_register_offset[port])); } -static void ep93xx_gpio_irq_mask (unsigned int irq) +static void ep93xx_gpio_irq_mask (struct irq_desc *desc) { +unsigned int irq = desc->irq;int line =irq_to_gpio (irq);int port = line >>3 ;
@@ -150,8 +153,9 @@ static void ep93xx_gpio_irq_mask(unsigneep93xx_gpio_update_int_params (port); } -static void ep93xx_gpio_irq_unmask (unsigned int irq) +static void ep93xx_gpio_irq_unmask (struct irq_desc *desc) { +unsigned int irq = desc->irq;int line =irq_to_gpio (irq);int port = line >>3 ;
@@ -164,9 +168,9 @@ static void ep93xx_gpio_irq_unmask(unsig* edge (1) triggered, while gpio_int_type2 controls whether it * triggers on low/falling (0) or high/rising (1). */ -static int ep93xx_gpio_irq_type (unsigned int irq,unsigned int type) +static int ep93xx_gpio_irq_type (struct irq_desc *desc,unsigned int type) { -struct irq_desc *desc = irq_desc + irq; +unsigned int irq = desc->irq;const int gpio =irq_to_gpio (irq);const int port = gpio >>3 ;const int port_mask =1 << (gpio &7 );
@@ -356,7 +360,7 @@ static void ep93xx_gpio_dbg_show(structif (!is_out) {int irq =gpio_to_irq (gpio); -struct irq_desc *desc = irq_desc + irq; +struct irq_desc *desc =irq_to_desc (irq);if (irq >=0 && desc->action) {char *trigger;
arch/arm/mach-footbridge/common.c +4 -2
@@ -75,13 +75,15 @@ static const int fb_irq_mask[] = { IRQ_MASK_PCI_PERR, /* 19 */ }; -static void fb_mask_irq (unsigned int irq) +static void fb_mask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq; *CSR_IRQ_DISABLE = fb_irq_mask[_DC21285_INR (irq)]; } -static void fb_unmask_irq (unsigned int irq) +static void fb_unmask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq; *CSR_IRQ_ENABLE = fb_irq_mask[_DC21285_INR (irq)]; }
arch/arm/mach-footbridge/isa-irq.c +12 -6
@@ -30,23 +30,26 @@#include "common.h" -static void isa_mask_pic_lo_irq (unsigned int irq) +static void isa_mask_pic_lo_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned int mask =1 << (irq &7 );outb (inb (PIC_MASK_LO ) | mask,PIC_MASK_LO ); } -static void isa_ack_pic_lo_irq (unsigned int irq) +static void isa_ack_pic_lo_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned int mask =1 << (irq &7 );outb (inb (PIC_MASK_LO ) | mask,PIC_MASK_LO );outb (0x20 ,PIC_LO ); } -static void isa_unmask_pic_lo_irq (unsigned int irq) +static void isa_unmask_pic_lo_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned int mask =1 << (irq &7 );outb (inb (PIC_MASK_LO ) & ~mask,PIC_MASK_LO );
@@ -58,15 +61,17 @@ static struct irq_chip isa_lo_chip = { .unmask = isa_unmask_pic_lo_irq, }; -static void isa_mask_pic_hi_irq (unsigned int irq) +static void isa_mask_pic_hi_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned int mask =1 << (irq &7 );outb (inb (PIC_MASK_HI ) | mask,PIC_MASK_HI ); } -static void isa_ack_pic_hi_irq (unsigned int irq) +static void isa_ack_pic_hi_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned int mask =1 << (irq &7 );outb (inb (PIC_MASK_HI ) | mask,PIC_MASK_HI );
@@ -74,8 +79,9 @@ static void isa_ack_pic_hi_irq(unsignedoutb (0x20 ,PIC_HI ); } -static void isa_unmask_pic_hi_irq (unsigned int irq) +static void isa_unmask_pic_hi_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned int mask =1 << (irq &7 );outb (inb (PIC_MASK_HI ) & ~mask,PIC_MASK_HI );
arch/arm/mach-gemini/gpio.c +10 -6
@@ -54,32 +54,36 @@ static void _set_gpio_irqenable(unsigned__raw_writel (reg, base +GPIO_INT_EN ); } -static void gpio_ack_irq (unsigned int irq) +static void gpio_ack_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned int gpio =irq_to_gpio (irq);unsigned int base =GPIO_BASE (gpio /32 );__raw_writel (1 << (gpio %32 ), base +GPIO_INT_CLR ); } -static void gpio_mask_irq (unsigned int irq) +static void gpio_mask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned int gpio =irq_to_gpio (irq);unsigned int base =GPIO_BASE (gpio /32 );_set_gpio_irqenable (base, gpio %32 ,0 ); } -static void gpio_unmask_irq (unsigned int irq) +static void gpio_unmask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned int gpio =irq_to_gpio (irq);unsigned int base =GPIO_BASE (gpio /32 );_set_gpio_irqenable (base, gpio %32 ,1 ); } -static int gpio_set_irq_type (unsigned int irq,unsigned int type) +static int gpio_set_irq_type (struct irq_desc *desc,unsigned int type) { +unsigned int irq = desc->irq;unsigned int gpio =irq_to_gpio (irq);unsigned int gpio_mask =1 << (gpio %32 );unsigned int base =GPIO_BASE (gpio /32 );
@@ -120,7 +124,7 @@ static int gpio_set_irq_type(unsigned in__raw_writel (reg_level, base +GPIO_INT_LEVEL );__raw_writel (reg_both, base +GPIO_INT_BOTH_EDGE ); -gpio_ack_irq (irq); +gpio_ack_irq (desc);return 0 ; }
@@ -140,7 +144,7 @@ static void gpio_irq_handler(unsigned inBUG_ON (!(irq_desc[gpio_irq_no].handle_irq)); irq_desc[gpio_irq_no].handle_irq (gpio_irq_no, - &irq_desc[gpio_irq_no]); +irq_to_desc (gpio_irq_no)); } }
arch/arm/mach-gemini/irq.c +6 -3
@@ -32,13 +32,15 @@#define FIQ_LEVEL (base_addr) (base_addr + 0x30)#define FIQ_STATUS (base_addr) (base_addr + 0x34) -static void gemini_ack_irq (unsigned int irq) +static void gemini_ack_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;__raw_writel (1 << irq,IRQ_CLEAR (IO_ADDRESS (GEMINI_INTERRUPT_BASE ))); } -static void gemini_mask_irq (unsigned int irq) +static void gemini_mask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned int mask; mask =__raw_readl (IRQ_MASK (IO_ADDRESS (GEMINI_INTERRUPT_BASE )));
@@ -46,8 +48,9 @@ static void gemini_mask_irq(unsigned int__raw_writel (mask,IRQ_MASK (IO_ADDRESS (GEMINI_INTERRUPT_BASE ))); } -static void gemini_unmask_irq (unsigned int irq) +static void gemini_unmask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned int mask; mask =__raw_readl (IRQ_MASK (IO_ADDRESS (GEMINI_INTERRUPT_BASE )));
arch/arm/mach-h720x/common.c +10 -5
@@ -53,16 +53,18 @@ unsigned long h720x_gettimeoffset(void)/* * mask Global irq's */ -static void mask_global_irq (unsigned int irq ) +static void mask_global_irq (struct irq_desc *desc ) { +unsigned int irq = desc->irq;CPU_REG (IRQC_VIRT ,IRQC_IER ) &= ~(1 << irq); }/* * unmask Global irq's */ -static void unmask_global_irq (unsigned int irq ) +static void unmask_global_irq (struct irq_desc *desc ) { +unsigned int irq = desc->irq;CPU_REG (IRQC_VIRT ,IRQC_IER ) |= (1 << irq); }
@@ -71,8 +73,9 @@ static void unmask_global_irq (unsigned* ack GPIO irq's * Ack only for edge triggered int's valid */ -static void inline ack_gpio_irq (u32 irq) +static void inline ack_gpio_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;u32 reg_base =GPIO_VIRT (IRQ_TO_REGNO (irq));u32 bit =IRQ_TO_BIT (irq);if ( (CPU_REG (reg_base,GPIO_EDGE ) & bit))
@@ -82,8 +85,9 @@ static void inline ack_gpio_irq(u32 irq)/* * mask GPIO irq's */ -static void inline mask_gpio_irq (u32 irq) +static void inline mask_gpio_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;u32 reg_base =GPIO_VIRT (IRQ_TO_REGNO (irq));u32 bit =IRQ_TO_BIT (irq);CPU_REG (reg_base,GPIO_MASK ) &= ~bit;
@@ -92,8 +96,9 @@ static void inline mask_gpio_irq(u32 irq/* * unmask GPIO irq's */ -static void inline unmask_gpio_irq (u32 irq) +static void inline unmask_gpio_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;u32 reg_base =GPIO_VIRT (IRQ_TO_REGNO (irq));u32 bit =IRQ_TO_BIT (irq);CPU_REG (reg_base,GPIO_MASK ) |= bit;
arch/arm/mach-h720x/cpu-h7202.c +5 -3
@@ -141,8 +141,9 @@ h7202_timer_interrupt(int irq, void *dev/* * mask multiplexed timer IRQs */ -static void inline mask_timerx_irq (u32 irq) +static void inline mask_timerx_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned int bit; bit =2 << ((irq ==IRQ_TIMER64B ) ?4 : (irq -IRQ_TIMER1 ));CPU_REG (TIMER_VIRT ,TIMER_TOPCTRL ) &= ~bit;
@@ -151,8 +152,9 @@ static void inline mask_timerx_irq (u32/* * unmask multiplexed timer IRQs */ -static void inline unmask_timerx_irq (u32 irq) +static void inline unmask_timerx_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned int bit; bit =2 << ((irq ==IRQ_TIMER64B ) ?4 : (irq -IRQ_TIMER1 ));CPU_REG (TIMER_VIRT ,TIMER_TOPCTRL ) |= bit;
@@ -196,7 +198,7 @@ void __init h7202_init_irq (void)for (irq =IRQ_TIMER1 ; irq <IRQ_CHAINED_TIMERX (NR_TIMERX_IRQS ); irq++) { -mask_timerx_irq (irq); +mask_timerx_irq (irq_to_desc (irq));set_irq_chip (irq, &h7202_timerx_chip);set_irq_handler (irq, handle_edge_irq);set_irq_flags (irq,IRQF_VALID );
arch/arm/mach-integrator/integrator_ap.c +4 -2
@@ -154,13 +154,15 @@ static void __init ap_map_io(void)#define INTEGRATOR_SC_VALID_INT 0x003fffff -static void sc_mask_irq (unsigned int irq) +static void sc_mask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;writel (1 << irq,VA_IC_BASE +IRQ_ENABLE_CLEAR ); } -static void sc_unmask_irq (unsigned int irq) +static void sc_unmask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;writel (1 << irq,VA_IC_BASE +IRQ_ENABLE_SET ); }
arch/arm/mach-integrator/integrator_cp.c +12 -6
@@ -145,14 +145,16 @@ static void __init intcp_map_io(void)#define sic_writel __raw_writel#define sic_readl __raw_readl -static void cic_mask_irq (unsigned int irq) +static void cic_mask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq; irq -=IRQ_CIC_START ;cic_writel (1 << irq,INTCP_VA_CIC_BASE +IRQ_ENABLE_CLEAR ); } -static void cic_unmask_irq (unsigned int irq) +static void cic_unmask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq; irq -=IRQ_CIC_START ;cic_writel (1 << irq,INTCP_VA_CIC_BASE +IRQ_ENABLE_SET ); }
@@ -164,14 +166,16 @@ static struct irq_chip cic_chip = { .unmask = cic_unmask_irq, }; -static void pic_mask_irq (unsigned int irq) +static void pic_mask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq; irq -=IRQ_PIC_START ;pic_writel (1 << irq,INTCP_VA_PIC_BASE +IRQ_ENABLE_CLEAR ); } -static void pic_unmask_irq (unsigned int irq) +static void pic_unmask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq; irq -=IRQ_PIC_START ;pic_writel (1 << irq,INTCP_VA_PIC_BASE +IRQ_ENABLE_SET ); }
@@ -183,14 +187,16 @@ static struct irq_chip pic_chip = { .unmask = pic_unmask_irq, }; -static void sic_mask_irq (unsigned int irq) +static void sic_mask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq; irq -=IRQ_SIC_START ;sic_writel (1 << irq,INTCP_VA_SIC_BASE +IRQ_ENABLE_CLEAR ); } -static void sic_unmask_irq (unsigned int irq) +static void sic_unmask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq; irq -=IRQ_SIC_START ;sic_writel (1 << irq,INTCP_VA_SIC_BASE +IRQ_ENABLE_SET ); }
arch/arm/mach-iop13xx/irq.c +16 -8
@@ -123,50 +123,58 @@ static void write_intsize(u32 val)/* 0 = Interrupt Masked and 1 = Interrupt not masked */ static void -iop13xx_irq_mask0 (unsigned int irq) +iop13xx_irq_mask0 (struct irq_desc *desc) { +unsigned int irq = desc->irq;write_intctl_0 (read_intctl_0 () & ~(1 << (irq -0 ))); }static void -iop13xx_irq_mask1 (unsigned int irq) +iop13xx_irq_mask1 (struct irq_desc *desc) { +unsigned int irq = desc->irq;write_intctl_1 (read_intctl_1 () & ~(1 << (irq -32 ))); }static void -iop13xx_irq_mask2 (unsigned int irq) +iop13xx_irq_mask2 (struct irq_desc *desc) { +unsigned int irq = desc->irq;write_intctl_2 (read_intctl_2 () & ~(1 << (irq -64 ))); }static void -iop13xx_irq_mask3 (unsigned int irq) +iop13xx_irq_mask3 (struct irq_desc *desc) { +unsigned int irq = desc->irq;write_intctl_3 (read_intctl_3 () & ~(1 << (irq -96 ))); }static void -iop13xx_irq_unmask0 (unsigned int irq) +iop13xx_irq_unmask0 (struct irq_desc *desc) { +unsigned int irq = desc->irq;write_intctl_0 (read_intctl_0 () | (1 << (irq -0 ))); }static void -iop13xx_irq_unmask1 (unsigned int irq) +iop13xx_irq_unmask1 (struct irq_desc *desc) { +unsigned int irq = desc->irq;write_intctl_1 (read_intctl_1 () | (1 << (irq -32 ))); }static void -iop13xx_irq_unmask2 (unsigned int irq) +iop13xx_irq_unmask2 (struct irq_desc *desc) { +unsigned int irq = desc->irq;write_intctl_2 (read_intctl_2 () | (1 << (irq -64 ))); }static void -iop13xx_irq_unmask3 (unsigned int irq) +iop13xx_irq_unmask3 (struct irq_desc *desc) { +unsigned int irq = desc->irq;write_intctl_3 (read_intctl_3 () | (1 << (irq -96 ))); }
arch/arm/mach-iop13xx/msi.c +1 -1
@@ -156,7 +156,7 @@ void arch_teardown_msi_irq(unsigned intdestroy_irq (irq); } -static void iop13xx_msi_nop (unsigned int irq) +static void iop13xx_msi_nop (struct irq_desc *unused) {return ; }
arch/arm/mach-iop32x/irq.c +4 -2
@@ -32,15 +32,17 @@ static void intstr_write(u32 val) }static void -iop32x_irq_mask (unsigned int irq) +iop32x_irq_mask (struct irq_desc *desc) { +unsigned int irq = desc->irq; iop32x_mask &= ~(1 << irq);intctl_write (iop32x_mask); }static void -iop32x_irq_unmask (unsigned int irq) +iop32x_irq_unmask (struct irq_desc *desc) { +unsigned int irq = desc->irq; iop32x_mask |=1 << irq;intctl_write (iop32x_mask); }
arch/arm/mach-iop33x/irq.c +8 -4
@@ -53,29 +53,33 @@ static void intsize_write(u32 val) }static void -iop33x_irq_mask1 (unsigned int irq) +iop33x_irq_mask1 (struct irq_desc *desc) { +unsigned int irq = desc->irq; iop33x_mask0 &= ~(1 << irq);intctl0_write (iop33x_mask0); }static void -iop33x_irq_mask2 (unsigned int irq) +iop33x_irq_mask2 (struct irq_desc *desc) { +unsigned int irq = desc->irq; iop33x_mask1 &= ~(1 << (irq -32 ));intctl1_write (iop33x_mask1); }static void -iop33x_irq_unmask1 (unsigned int irq) +iop33x_irq_unmask1 (struct irq_desc *desc) { +unsigned int irq = desc->irq; iop33x_mask0 |=1 << irq;intctl0_write (iop33x_mask0); }static void -iop33x_irq_unmask2 (unsigned int irq) +iop33x_irq_unmask2 (struct irq_desc *desc) { +unsigned int irq = desc->irq; iop33x_mask1 |= (1 << (irq -32 ));intctl1_write (iop33x_mask1); }
arch/arm/mach-ixp2000/core.c +20 -10
@@ -309,8 +309,9 @@ static void ixp2000_GPIO_irq_handler(uns } } -static int ixp2000_GPIO_irq_type (unsigned int irq,unsigned int type) +static int ixp2000_GPIO_irq_type (struct irq_desc *desc,unsigned int type) { +unsigned int irq = desc->irq;int line = irq -IRQ_IXP2000_GPIO0 ;/*
@@ -342,8 +343,9 @@ static int ixp2000_GPIO_irq_type(unsignereturn 0 ; } -static void ixp2000_GPIO_irq_mask_ack (unsigned int irq) +static void ixp2000_GPIO_irq_mask_ack (struct irq_desc *desc) { +unsigned int irq = desc->irq;ixp2000_reg_write (IXP2000_GPIO_INCR , (1 << (irq -IRQ_IXP2000_GPIO0 )));ixp2000_reg_write (IXP2000_GPIO_EDSR , (1 << (irq -IRQ_IXP2000_GPIO0 )));
@@ -351,13 +353,15 @@ static void ixp2000_GPIO_irq_mask_ack(unixp2000_reg_wrb (IXP2000_GPIO_INST , (1 << (irq -IRQ_IXP2000_GPIO0 ))); } -static void ixp2000_GPIO_irq_mask (unsigned int irq) +static void ixp2000_GPIO_irq_mask (struct irq_desc *desc) { +unsigned int irq = desc->irq;ixp2000_reg_wrb (IXP2000_GPIO_INCR , (1 << (irq -IRQ_IXP2000_GPIO0 ))); } -static void ixp2000_GPIO_irq_unmask (unsigned int irq) +static void ixp2000_GPIO_irq_unmask (struct irq_desc *desc) { +unsigned int irq = desc->irq;ixp2000_reg_write (IXP2000_GPIO_INSR , (1 << (irq -IRQ_IXP2000_GPIO0 ))); }
@@ -368,8 +372,9 @@ static struct irq_chip ixp2000_GPIO_irq_ .set_type = ixp2000_GPIO_irq_type, }; -static void ixp2000_pci_irq_mask (unsigned int irq) +static void ixp2000_pci_irq_mask (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned long temp = *IXP2000_PCI_XSCALE_INT_ENABLE ;if (irq ==IRQ_IXP2000_PCIA )ixp2000_reg_wrb (IXP2000_PCI_XSCALE_INT_ENABLE , (temp & ~(1 <<26 )));
@@ -377,8 +382,9 @@ static void ixp2000_pci_irq_mask(unsigneixp2000_reg_wrb (IXP2000_PCI_XSCALE_INT_ENABLE , (temp & ~(1 <<27 ))); } -static void ixp2000_pci_irq_unmask (unsigned int irq) +static void ixp2000_pci_irq_unmask (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned long temp = *IXP2000_PCI_XSCALE_INT_ENABLE ;if (irq ==IRQ_IXP2000_PCIA )ixp2000_reg_write (IXP2000_PCI_XSCALE_INT_ENABLE , (temp | (1 <<26 )));
@@ -401,14 +407,16 @@ static void ixp2000_err_irq_handler(unsi } } -static void ixp2000_err_irq_mask (unsigned int irq) +static void ixp2000_err_irq_mask (struct irq_desc *desc) { +unsigned int irq = desc->irq;ixp2000_reg_write (IXP2000_IRQ_ERR_ENABLE_CLR , (1 << (irq -IRQ_IXP2000_DRAM0_MIN_ERR ))); } -static void ixp2000_err_irq_unmask (unsigned int irq) +static void ixp2000_err_irq_unmask (struct irq_desc *desc) { +unsigned int irq = desc->irq;ixp2000_reg_write (IXP2000_IRQ_ERR_ENABLE_SET , (1 << (irq -IRQ_IXP2000_DRAM0_MIN_ERR ))); }
@@ -425,13 +433,15 @@ static struct irq_chip ixp2000_pci_irq_c .unmask = ixp2000_pci_irq_unmask }; -static void ixp2000_irq_mask (unsigned int irq) +static void ixp2000_irq_mask (struct irq_desc *desc) { +unsigned int irq = desc->irq;ixp2000_reg_wrb (IXP2000_IRQ_ENABLE_CLR , (1 << irq)); } -static void ixp2000_irq_unmask (unsigned int irq) +static void ixp2000_irq_unmask (struct irq_desc *desc) { +unsigned int irq = desc->irq;ixp2000_reg_write (IXP2000_IRQ_ENABLE_SET , (1 << irq)); }
arch/arm/mach-ixp2000/ixdp2x00.c +6 -4
@@ -64,8 +64,9 @@ static struct slowport_cfg slowport_cpld };#endif -static void ixdp2x00_irq_mask (unsigned int irq) +static void ixdp2x00_irq_mask (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned long dummy;static struct slowport_cfg old_cfg;
@@ -88,8 +89,9 @@ static void ixdp2x00_irq_mask(unsigned i#endif } -static void ixdp2x00_irq_unmask (unsigned int irq) +static void ixdp2x00_irq_unmask (struct irq_desc *desc) { +unsigned int irq = desc->irq;unsigned long dummy;static struct slowport_cfg old_cfg;
@@ -112,7 +114,7 @@ static void ixdp2x00_irq_handler(unsignestatic struct slowport_cfg old_cfg;int i; - desc->chip->mask (irq); + desc->chip->mask (irq_to_desc (irq));#ifdef CONFIG_ARCH_IXDP2400 if (machine_is_ixdp2400 ())
@@ -134,7 +136,7 @@ static void ixdp2x00_irq_handler(unsigne } } - desc->chip->unmask (irq); + desc->chip->unmask (irq_to_desc (irq)); }static struct irq_chip ixdp2x00_cpld_irq_chip = {
arch/arm/mach-ixp2000/ixdp2x01.c +6 -4
@@ -49,14 +49,16 @@/************************************************************************* * IXDP2x01 IRQ Handling *************************************************************************/ -static void ixdp2x01_irq_mask (unsigned int irq) +static void ixdp2x01_irq_mask (struct irq_desc *desc) { +unsigned int irq = desc->irq;ixp2000_reg_wrb (IXDP2X01_INT_MASK_SET_REG ,IXP2000_BOARD_IRQ_MASK (irq)); } -static void ixdp2x01_irq_unmask (unsigned int irq) +static void ixdp2x01_irq_unmask (struct irq_desc *desc) { +unsigned int irq = desc->irq;ixp2000_reg_write (IXDP2X01_INT_MASK_CLR_REG ,IXP2000_BOARD_IRQ_MASK (irq)); }
@@ -68,7 +70,7 @@ static void ixdp2x01_irq_handler(unsigneu32 ex_interrupt;int i; - desc->chip->mask (irq); + desc->chip->mask (irq_to_desc (irq)); ex_interrupt = *IXDP2X01_INT_STAT_REG & valid_irq_mask;
@@ -84,7 +86,7 @@ static void ixdp2x01_irq_handler(unsigne } } - desc->chip->unmask (irq); + desc->chip->unmask (irq_to_desc (irq)); }static struct irq_chip ixdp2x01_irq_chip = {
arch/arm/mach-ixp23xx/core.c +17 -10
@@ -111,8 +111,9 @@ enum ixp23xx_irq_type {static void ixp23xx_config_irq (unsigned int ,enum ixp23xx_irq_type ); -static int ixp23xx_irq_set_type (unsigned int irq,unsigned int type) +static int ixp23xx_irq_set_type (struct irq_desc *desc,unsigned int type) { +unsigned int irq = desc->irq;int line = irq -IRQ_IXP23XX_GPIO6 +6 ;u32 int_style;enum ixp23xx_irq_type irq_type;
@@ -173,8 +174,9 @@ static int ixp23xx_irq_set_type(unsignedreturn 0 ; } -static void ixp23xx_irq_mask (unsigned int irq) +static void ixp23xx_irq_mask (struct irq_desc *desc) { +unsigned int irq = desc->irq;volatile unsigned long *intr_reg;if (irq >=56 )
@@ -184,8 +186,9 @@ static void ixp23xx_irq_mask(unsigned in *intr_reg &= ~(1 << (irq %32 )); } -static void ixp23xx_irq_ack (unsigned int irq) +static void ixp23xx_irq_ack (struct irq_desc *desc) { +unsigned int irq = desc->irq;int line = irq -IRQ_IXP23XX_GPIO6 +6 ;if ((line <6 ) || (line >15 ))
@@ -198,11 +201,12 @@ static void ixp23xx_irq_ack(unsigned int* Level triggered interrupts on GPIO lines can only be cleared when the * interrupt condition disappears. */ -static void ixp23xx_irq_level_unmask (unsigned int irq) +static void ixp23xx_irq_level_unmask (struct irq_desc *desc) { +unsigned int irq = desc->irq;volatile unsigned long *intr_reg; -ixp23xx_irq_ack (irq); +ixp23xx_irq_ack (desc);if (irq >=56 ) irq +=8 ;
@@ -211,8 +215,9 @@ static void ixp23xx_irq_level_unmask(uns *intr_reg |= (1 << (irq %32 )); } -static void ixp23xx_irq_edge_unmask (unsigned int irq) +static void ixp23xx_irq_edge_unmask (struct irq_desc *desc) { +unsigned int irq = desc->irq;volatile unsigned long *intr_reg;if (irq >=56 )
@@ -236,13 +241,15 @@ static struct irq_chip ixp23xx_irq_edge_ .set_type = ixp23xx_irq_set_type }; -static void ixp23xx_pci_irq_mask (unsigned int irq) +static void ixp23xx_pci_irq_mask (struct irq_desc *desc) { +unsigned int irq = desc->irq; *IXP23XX_PCI_XSCALE_INT_ENABLE &= ~(1 << (IRQ_IXP23XX_INTA +27 - irq)); } -static void ixp23xx_pci_irq_unmask (unsigned int irq) +static void ixp23xx_pci_irq_unmask (struct irq_desc *desc) { +unsigned int irq = desc->irq; *IXP23XX_PCI_XSCALE_INT_ENABLE |= (1 << (IRQ_IXP23XX_INTA +27 - irq)); }
@@ -256,7 +263,7 @@ static void pci_handler(unsigned int irq pci_interrupt = *IXP23XX_PCI_XSCALE_INT_STATUS ; - desc->chip->ack (irq); + desc->chip->ack (irq_to_desc (irq));/* See which PCI_INTA, or PCI_INTB interrupted */ if (pci_interrupt & (1 <<26 )) {
@@ -269,7 +276,7 @@ static void pci_handler(unsigned int irqgeneric_handle_irq (irqno); - desc->chip->unmask (irq); + desc->chip->unmask (irq_to_desc (irq)); }static struct irq_chip ixp23xx_pci_irq_chip = {
arch/arm/mach-ixp23xx/ixdp2351.c +12 -8
@@ -48,13 +48,15 @@/* * IXDP2351 Interrupt Handling */ -static void ixdp2351_inta_mask (unsigned int irq) +static void ixdp2351_inta_mask (struct irq_desc *desc) { +unsigned int irq = desc->irq; *IXDP2351_CPLD_INTA_MASK_SET_REG =IXDP2351_INTA_IRQ_MASK (irq); } -static void ixdp2351_inta_unmask (unsigned int irq) +static void ixdp2351_inta_unmask (struct irq_desc *desc) { +unsigned int irq = desc->irq; *IXDP2351_CPLD_INTA_MASK_CLR_REG =IXDP2351_INTA_IRQ_MASK (irq); }
@@ -64,7 +66,7 @@ static void ixdp2351_inta_handler(unsign *IXDP2351_CPLD_INTA_STAT_REG &IXDP2351_INTA_IRQ_VALID ;int i; - desc->chip->mask (irq); + desc->chip->mask (irq_to_desc (irq));for (i =0 ; i <IXDP2351_INTA_IRQ_NUM ; i++) {if (ex_interrupt & (1 << i)) {
@@ -74,7 +76,7 @@ static void ixdp2351_inta_handler(unsign } } - desc->chip->unmask (irq); + desc->chip->unmask (irq_to_desc (irq)); }static struct irq_chip ixdp2351_inta_chip = {
@@ -83,13 +85,15 @@ static struct irq_chip ixdp2351_inta_chi .unmask = ixdp2351_inta_unmask }; -static void ixdp2351_intb_mask (unsigned int irq) +static void ixdp2351_intb_mask (struct irq_desc *desc) { +unsigned int irq = desc->irq; *IXDP2351_CPLD_INTB_MASK_SET_REG =IXDP2351_INTB_IRQ_MASK (irq); } -static void ixdp2351_intb_unmask (unsigned int irq) +static void ixdp2351_intb_unmask (struct irq_desc *desc) { +unsigned int irq = desc->irq; *IXDP2351_CPLD_INTB_MASK_CLR_REG =IXDP2351_INTB_IRQ_MASK (irq); }
@@ -99,7 +103,7 @@ static void ixdp2351_intb_handler(unsign *IXDP2351_CPLD_INTB_STAT_REG &IXDP2351_INTB_IRQ_VALID ;int i; - desc->chip->ack (irq); + desc->chip->ack (irq_to_desc (irq));for (i =0 ; i <IXDP2351_INTB_IRQ_NUM ; i++) {if (ex_interrupt & (1 << i)) {
@@ -109,7 +113,7 @@ static void ixdp2351_intb_handler(unsign } } - desc->chip->unmask (irq); + desc->chip->unmask (irq_to_desc (irq)); }static struct irq_chip ixdp2351_intb_chip = {
arch/arm/mach-ixp4xx/common.c +9 -5
@@ -128,8 +128,9 @@ int irq_to_gpio(unsigned int irq) }EXPORT_SYMBOL (irq_to_gpio); -static int ixp4xx_set_irq_type (unsigned int irq,unsigned int type) +static int ixp4xx_set_irq_type (struct irq_desc *desc,unsigned int type) { +unsigned int irq = desc->irq;int line = irq2gpio[irq];u32 int_style;enum ixp4xx_irq_type irq_type;
@@ -193,16 +194,18 @@ static int ixp4xx_set_irq_type(unsignedreturn 0 ; } -static void ixp4xx_irq_mask (unsigned int irq) +static void ixp4xx_irq_mask (struct irq_desc *desc) { +unsigned int irq = desc->irq;if ((cpu_is_ixp46x () ||cpu_is_ixp43x ()) && irq >=32 ) *IXP4XX_ICMR2 &= ~(1 << (irq -32 ));else *IXP4XX_ICMR &= ~(1 << irq); } -static void ixp4xx_irq_ack (unsigned int irq) +static void ixp4xx_irq_ack (struct irq_desc *desc) { +unsigned int irq = desc->irq;int line = (irq <32 ) ? irq2gpio[irq] :-1 ;if (line >=0 )
@@ -213,10 +216,11 @@ static void ixp4xx_irq_ack(unsigned int* Level triggered interrupts on GPIO lines can only be cleared when the * interrupt condition disappears. */ -static void ixp4xx_irq_unmask (unsigned int irq) +static void ixp4xx_irq_unmask (struct irq_desc *desc) { +unsigned int irq = desc->irq;if (!(ixp4xx_irq_edge & (1 << irq))) -ixp4xx_irq_ack (irq); +ixp4xx_irq_ack (desc);if ((cpu_is_ixp46x () ||cpu_is_ixp43x ()) && irq >=32 ) *IXP4XX_ICMR2 |= (1 << (irq -32 ));
arch/arm/mach-ks8695/irq.c +9 -5
@@ -34,8 +34,9 @@#include <mach/regs-irq.h> #include <mach/regs-gpio.h> -static void ks8695_irq_mask (unsigned int irqno) +static void ks8695_irq_mask (struct irq_desc *desc) { +unsigned int irqno = desc->irq;unsigned long inten; inten =__raw_readl (KS8695_IRQ_VA +KS8695_INTEN );
@@ -44,8 +45,9 @@ static void ks8695_irq_mask(unsigned int__raw_writel (inten,KS8695_IRQ_VA +KS8695_INTEN ); } -static void ks8695_irq_unmask (unsigned int irqno) +static void ks8695_irq_unmask (struct irq_desc *desc) { +unsigned int irqno = desc->irq;unsigned long inten; inten =__raw_readl (KS8695_IRQ_VA +KS8695_INTEN );
@@ -54,8 +56,9 @@ static void ks8695_irq_unmask(unsigned i__raw_writel (inten,KS8695_IRQ_VA +KS8695_INTEN ); } -static void ks8695_irq_ack (unsigned int irqno) +static void ks8695_irq_ack (struct irq_desc *desc) { +unsigned int irqno = desc->irq;__raw_writel ((1 << irqno),KS8695_IRQ_VA +KS8695_INTST ); }
@@ -64,8 +67,9 @@ static struct irq_chip ks8695_irq_level_static struct irq_chip ks8695_irq_edge_chip; -static int ks8695_irq_set_type (unsigned int irqno,unsigned int type) +static int ks8695_irq_set_type (struct irq_desc *desc,unsigned int type) { +unsigned int irqno = desc->irq;unsigned long ctrl, mode;unsigned short level_triggered =0 ;
@@ -164,7 +168,7 @@ void __init ks8695_init_irq(void)/* Edge-triggered interrupts */ default : -ks8695_irq_ack (irq);/* clear pending bit */ +ks8695_irq_ack (irq_to_desc (irq));/* clear pending bit */ set_irq_chip (irq, &ks8695_irq_edge_chip);set_irq_handler (irq, handle_edge_irq); }
arch/arm/mach-l7200/core.c +4 -2
@@ -45,13 +45,15 @@#define FIQ_SOFT (*(volatile unsigned long *) (IRQ_BASE + 0x110))#define FIQ_SOURCESEL (*(volatile unsigned long *) (IRQ_BASE + 0x118)) -static void l7200_mask_irq (unsigned int irq) +static void l7200_mask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;IRQ_ENABLECLEAR =1 << irq; } -static void l7200_unmask_irq (unsigned int irq) +static void l7200_unmask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;IRQ_ENABLE =1 << irq; }
arch/arm/mach-lh7a40x/arch-kev7a400.c +6 -3
@@ -46,19 +46,22 @@ void __init kev7a400_map_io(void)static u16 CPLD_IRQ_mask;/* Mask for CPLD IRQs, 1 == unmasked */ -static void kev7a400_ack_cpld_irq (u32 irq) +static void kev7a400_ack_cpld_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;CPLD_CL_INT =1 << (irq -IRQ_KEV7A400_CPLD ); } -static void kev7a400_mask_cpld_irq (u32 irq) +static void kev7a400_mask_cpld_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq; CPLD_IRQ_mask &= ~(1 << (irq -IRQ_KEV7A400_CPLD ));CPLD_WR_PB_INT_MASK = CPLD_IRQ_mask; } -static void kev7a400_unmask_cpld_irq (u32 irq) +static void kev7a400_unmask_cpld_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq; CPLD_IRQ_mask |=1 << (irq -IRQ_KEV7A400_CPLD );CPLD_WR_PB_INT_MASK = CPLD_IRQ_mask; }
arch/arm/mach-lh7a40x/arch-lpd7a40x.c +8 -5
@@ -159,8 +159,9 @@ static void __init lpd7a40x_init (void)#endif } -static void lh7a40x_ack_cpld_irq (u32 irq) +static void lh7a40x_ack_cpld_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;/* CPLD doesn't have ack capability, but some devices may */ #if defined (CPLD_INTMASK_TOUCH )
@@ -172,8 +173,9 @@ static void lh7a40x_ack_cpld_irq (u32 ir#endif } -static void lh7a40x_mask_cpld_irq (u32 irq) +static void lh7a40x_mask_cpld_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;switch (irq) {case IRQ_LPD7A40X_ETH_INT :CPLD_INTERRUPTS |=CPLD_INTMASK_ETHERNET ;
@@ -186,8 +188,9 @@ static void lh7a40x_mask_cpld_irq (u32 i } } -static void lh7a40x_unmask_cpld_irq (u32 irq) +static void lh7a40x_unmask_cpld_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;switch (irq) {case IRQ_LPD7A40X_ETH_INT :CPLD_INTERRUPTS &= ~CPLD_INTMASK_ETHERNET ;
@@ -211,7 +214,7 @@ static void lpd7a40x_cpld_handler (unsig {unsigned int mask =CPLD_INTERRUPTS ; - desc->chip->ack (irq); + desc->chip->ack (irq_to_desc (irq));if ((mask & (1 <<0 )) ==0 )/* WLAN */ generic_handle_irq (IRQ_LPD7A40X_ETH_INT );
@@ -221,7 +224,7 @@ static void lpd7a40x_cpld_handler (unsiggeneric_handle_irq (IRQ_TOUCH );#endif - desc->chip->unmask (irq);/* Level-triggered need this */ + desc->chip->unmask (irq_to_desc (irq));/* Level-triggered need this */ }
arch/arm/mach-lh7a40x/irq-kev7a400.c +6 -3
@@ -23,21 +23,24 @@static u16 CPLD_IRQ_mask;/* Mask for CPLD IRQs, 1 == unmasked */ static void -lh7a400_ack_cpld_irq (u32 irq) +lh7a400_ack_cpld_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;CPLD_CL_INT =1 << (irq -IRQ_KEV7A400_CPLD ); }static void -lh7a400_mask_cpld_irq (u32 irq) +lh7a400_mask_cpld_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq; CPLD_IRQ_mask &= ~(1 << (irq -IRQ_KEV7A400_CPLD ));CPLD_WR_PB_INT_MASK = CPLD_IRQ_mask; }static void -lh7a400_unmask_cpld_irq (u32 irq) +lh7a400_unmask_cpld_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq; CPLD_IRQ_mask |=1 << (irq -IRQ_KEV7A400_CPLD );CPLD_WR_PB_INT_MASK = CPLD_IRQ_mask; }
arch/arm/mach-lh7a40x/irq-lh7a400.c +6 -3
@@ -21,18 +21,21 @@/* CPU IRQ handling */ -static void lh7a400_mask_irq (u32 irq) +static void lh7a400_mask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;INTC_INTENC = (1 << irq); } -static void lh7a400_unmask_irq (u32 irq) +static void lh7a400_unmask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;INTC_INTENS = (1 << irq); } -static void lh7a400_ack_gpio_irq (u32 irq) +static void lh7a400_ack_gpio_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;GPIO_GPIOFEOI = (1 <<IRQ_TO_GPIO (irq));INTC_INTENC = (1 << irq); }
arch/arm/mach-lh7a40x/irq-lh7a404.c +12 -6
@@ -43,34 +43,40 @@ static unsigned char irq_pri_vic2[] = {/* CPU IRQ handling */ -static void lh7a404_vic1_mask_irq (u32 irq) +static void lh7a404_vic1_mask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;VIC1_INTENCLR = (1 << irq); } -static void lh7a404_vic1_unmask_irq (u32 irq) +static void lh7a404_vic1_unmask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;VIC1_INTEN = (1 << irq); } -static void lh7a404_vic2_mask_irq (u32 irq) +static void lh7a404_vic2_mask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;VIC2_INTENCLR = (1 << (irq -32 )); } -static void lh7a404_vic2_unmask_irq (u32 irq) +static void lh7a404_vic2_unmask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;VIC2_INTEN = (1 << (irq -32 )); } -static void lh7a404_vic1_ack_gpio_irq (u32 irq) +static void lh7a404_vic1_ack_gpio_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;GPIO_GPIOFEOI = (1 <<IRQ_TO_GPIO (irq));VIC1_INTENCLR = (1 << irq); } -static void lh7a404_vic2_ack_gpio_irq (u32 irq) +static void lh7a404_vic2_ack_gpio_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;GPIO_GPIOFEOI = (1 <<IRQ_TO_GPIO (irq));VIC2_INTENCLR = (1 << irq); }
arch/arm/mach-lh7a40x/irq-lpd7a40x.c +7 -5
@@ -20,13 +20,14 @@#include "common.h" -static void lh7a40x_ack_cpld_irq (u32 irq) +static void lh7a40x_ack_cpld_irq (struct irq_desc *unused) {/* CPLD doesn't have ack capability */ } -static void lh7a40x_mask_cpld_irq (u32 irq) +static void lh7a40x_mask_cpld_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;switch (irq) {case IRQ_LPD7A40X_ETH_INT :CPLD_INTERRUPTS =CPLD_INTERRUPTS |0x4 ;
@@ -37,8 +38,9 @@ static void lh7a40x_mask_cpld_irq (u32 i } } -static void lh7a40x_unmask_cpld_irq (u32 irq) +static void lh7a40x_unmask_cpld_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;switch (irq) {case IRQ_LPD7A40X_ETH_INT :CPLD_INTERRUPTS =CPLD_INTERRUPTS & ~0x4 ;
@@ -60,7 +62,7 @@ static void lh7a40x_cpld_handler (unsign {unsigned int mask =CPLD_INTERRUPTS ; - desc->chip->ack (irq); + desc->chip->ack (irq_to_desc (irq));if ((mask &0x1 ) ==0 )/* WLAN */ generic_handle_irq (IRQ_LPD7A40X_ETH_INT );
@@ -68,7 +70,7 @@ static void lh7a40x_cpld_handler (unsignif ((mask &0x2 ) ==0 )/* Touch */ generic_handle_irq (IRQ_LPD7A400_TS ); - desc->chip->unmask (irq);/* Level-triggered need this */ + desc->chip->unmask (irq_to_desc (irq));/* Level-triggered need this */ }
arch/arm/mach-mmp/irq-mmp2.c +7 -5
@@ -19,16 +19,18 @@#include "common.h" -static void icu_mask_irq (unsigned int irq) +static void icu_mask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;uint32_t r =__raw_readl (ICU_INT_CONF (irq)); r &= ~ICU_INT_ROUTE_PJ4_IRQ ;__raw_writel (r,ICU_INT_CONF (irq)); } -static void icu_unmask_irq (unsigned int irq) +static void icu_unmask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;uint32_t r =__raw_readl (ICU_INT_CONF (irq)); r |=ICU_INT_ROUTE_PJ4_IRQ ;
@@ -103,9 +105,9 @@ static void init_mux_irq(struct irq_chipfor (irq = start; num >0 ; irq++, num--) {/* mask and clear the IRQ */ - chip->mask (irq); + chip->mask (irq_to_desc (irq));if (chip->ack) - chip->ack (irq); + chip->ack (irq_to_desc (irq));set_irq_chip (irq, chip);set_irq_flags (irq,IRQF_VALID );
@@ -118,7 +120,7 @@ void __init mmp2_init_icu(void)int irq;for (irq =0 ; irq <IRQ_MMP2_MUX_BASE ; irq++) { -icu_mask_irq (irq); +icu_mask_irq (irq_to_desc (irq));set_irq_chip (irq, &icu_irq_chip);set_irq_flags (irq,IRQF_VALID );
arch/arm/mach-mmp/irq-pxa168.c +5 -3
@@ -25,13 +25,15 @@#define PRIORITY_DEFAULT 0x1#define PRIORITY_NONE 0x0/* means IRQ disabled */ -static void icu_mask_irq (unsigned int irq) +static void icu_mask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;__raw_writel (PRIORITY_NONE ,ICU_INT_CONF (irq)); } -static void icu_unmask_irq (unsigned int irq) +static void icu_unmask_irq (struct irq_desc *desc) { +unsigned int irq = desc->irq;__raw_writel (IRQ_ROUTE_TO_AP |PRIORITY_DEFAULT ,ICU_INT_CONF (irq)); }
@@ -47,7 +49,7 @@ void __init icu_init_irq(void)int irq;for (irq =0 ; irq <64 ; irq++) { -icu_mask_irq (irq); +icu_mask_irq (irq_to_desc (irq));set_irq_chip (irq, &icu_irq_chip);set_irq_handler (irq, handle_level_irq);set_irq_flags (irq,IRQF_VALID );
arch/arm/mach-msm/irq.c +11 -7
@@ -64,32 +64,36 @@#define VIC_VECTPRIORITY (n) VIC_REG(0x0200+((n) * 4))#define VIC_VECTADDR (n) VIC_REG(0x0400+((n) * 4)) -static void msm_irq_ack (unsigned int irq) +static void msm_irq_ack (struct irq_desc *desc) { +unsigned int irq = desc->irq;void __iomem *reg =VIC_INT_CLEAR0 + ((irq &32 ) ?4 :0 ); irq =1 << (irq &31 );writel (irq, reg); } -static void msm_irq_mask (unsigned int irq) +static void msm_irq_mask (struct irq_desc *desc) { +unsigned int irq = desc->irq;void __iomem *reg =VIC_INT_ENCLEAR0 + ((irq &32 ) ?4 :0 );writel (1 << (irq &31 ), reg); } -static void msm_irq_unmask (unsigned int irq) +static void msm_irq_unmask (struct irq_desc *desc) { +unsigned int irq = desc->irq;void __iomem *reg =VIC_INT_ENSET0 + ((irq &32 ) ?4 :0 );writel (1 << (irq &31 ), reg); } -static int msm_irq_set_wake (unsigned int irq,unsigned int on) +static int msm_irq_set_wake (struct irq_desc *unused,unsigned int on) {return -EINVAL ; } -static int msm_irq_set_type (unsigned int irq,unsigned int flow_type) +static int msm_irq_set_type (struct irq_desc *desc,unsigned int flow_type) { +unsigned int irq = desc->irq;void __iomem *treg =VIC_INT_TYPE0 + ((irq &32 ) ?4 :0 );void __iomem *preg =VIC_INT_POLARITY0 + ((irq &32 ) ?4 :0 );int b =1 << (irq &31 );
@@ -101,11 +105,11 @@ static int msm_irq_set_type(unsigned intif (flow_type & (IRQF_TRIGGER_RISING |IRQF_TRIGGER_FALLING )) {writel (readl (treg) | b, treg); - irq_desc[irq].handle_irq = handle_edge_irq; + desc->handle_irq = handle_edge_irq; }if (flow_type & (IRQF_TRIGGER_HIGH |IRQF_TRIGGER_LOW )) {writel (readl (treg) & (~b), treg); - irq_desc[irq].handle_irq = handle_level_irq; + desc->handle_irq = handle_level_irq; }return 0 ;
Lines of this file are not shown. View the raw message.
arch/arm/mach-ns9xxx/board-a9m9750dev.c +10 -8
Lines of this file are not shown. View the raw message.
arch/arm/mach-s3c2443/irq.c +30 -15
45 lines not on this page · raw message
arch/arm/plat-s3c24xx/irq.c +42 -22
64 lines not on this page · raw message
arch/blackfin/mach-common/ints-priority.c +66 -45
111 lines not on this page · raw message
arch/m32r/platforms/m32700ut/setup.c +68 -56
124 lines not on this page · raw message
arch/m32r/platforms/mappi2/setup.c +22 -19
41 lines not on this page · raw message
arch/m32r/platforms/mappi3/setup.c +22 -19
41 lines not on this page · raw message
arch/m32r/platforms/opsput/setup.c +55 -46
101 lines not on this page · raw message
arch/m32r/platforms/usrv/setup.c +35 -29
64 lines not on this page · raw message
arch/m68knommu/platform/coldfire/intc-2.c +8 -4
Lines of this file are not shown. View the raw message.
arch/m68knommu/platform/coldfire/intc-simr.c +9 -5
Lines of this file are not shown. View the raw message.
arch/m68knommu/platform/coldfire/intc.c +7 -4
Lines of this file are not shown. View the raw message.
arch/mips/cavium-octeon/octeon-irq.c +60 -38
98 lines not on this page · raw message
arch/mips/nxp/pnx833x/common/interrupts.c +22 -13
Lines of this file are not shown. View the raw message.
arch/mips/pmc-sierra/msp71xx/msp_irq_cic.c +4 -2
Lines of this file are not shown. View the raw message.
arch/mips/pmc-sierra/msp71xx/msp_irq_slp.c +6 -3
Lines of this file are not shown. View the raw message.
arch/mips/sgi-ip32/ip32-irq.c +39 -29
68 lines not on this page · raw message
arch/mips/vr41xx/common/icu.c +30 -26
56 lines not on this page · raw message
arch/powerpc/platforms/512x/mpc5121_ads_cpld.c +4 -2
Lines of this file are not shown. View the raw message.
arch/powerpc/platforms/52xx/media5200.c +7 -5
Lines of this file are not shown. View the raw message.
arch/powerpc/platforms/52xx/mpc52xx_gpt.c +8 -4
Lines of this file are not shown. View the raw message.
arch/powerpc/platforms/52xx/mpc52xx_pic.c +23 -12
Lines of this file are not shown. View the raw message.
arch/powerpc/platforms/82xx/pq2ads-pci-pic.c +4 -2
Lines of this file are not shown. View the raw message.
arch/powerpc/platforms/85xx/mpc85xx_ads.c +1 -1
Lines of this file are not shown. View the raw message.
arch/powerpc/platforms/85xx/mpc85xx_ds.c +1 -1
Lines of this file are not shown. View the raw message.
arch/powerpc/platforms/85xx/socrates_fpga_pic.c +13 -7
Lines of this file are not shown. View the raw message.
arch/powerpc/platforms/8xx/m8xx_setup.c +2 -2
Lines of this file are not shown. View the raw message.
arch/powerpc/platforms/cell/beat_interrupt.c +6 -3
Lines of this file are not shown. View the raw message.
arch/powerpc/platforms/cell/interrupt.c +6 -6
Lines of this file are not shown. View the raw message.
arch/powerpc/platforms/cell/spider-pic.c +10 -7
Lines of this file are not shown. View the raw message.
arch/powerpc/platforms/embedded6xx/flipper-pic.c +8 -4
Lines of this file are not shown. View the raw message.
arch/powerpc/platforms/embedded6xx/hlwd-pic.c +11 -7
Lines of this file are not shown. View the raw message.
arch/powerpc/platforms/ps3/interrupt.c +12 -9
Lines of this file are not shown. View the raw message.
arch/powerpc/platforms/pseries/xics.c +17 -11
Lines of this file are not shown. View the raw message.
arch/powerpc/sysdev/mpic.c +28 -19
47 lines not on this page · raw message
arch/sparc/kernel/irq_64.c +30 -22
52 lines not on this page · raw message
arch/x86/kernel/apic/io_apic.c +26 -37
63 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
Re: [PATCH 06/12] genericirq: make irq_chip related function to take desc
In reply to Eric W. BiedermanHere is the list of potential trouble spots. This is from a slightly older version of Linux than the patch, so the line numbers don't match up. But the function names are probably good enough to find the problem.
julia
function definition not found:
arch/arm/mach-iop13xx/msi.c::167: unmask_msi_irq arch/arm/mach-iop13xx/msi.c::168: mask_msi_irq arch/arm/mach-iop13xx/msi.c::169: mask_msi_irq arch/arm/mach-iop13xx/msi.c::170: unmask_msi_irq arch/arm/mach-s3c2410/bast-irq.c::109: bast_pc104_maskack arch/arm/mach-s3c2412/irq.c::108: s3c_irq_wake arch/arm/mach-s3c2412/irq.c::109: s3c_irqext_type arch/arm/mach-s3c64xx/irq-eint.c::148: s3c_irqext_wake arch/arm/plat-s3c24xx/irq.c::241: s3c_irqext_wake arch/arm/plat-s3c24xx/irq.c::249: s3c_irq_wake arch/arm/plat-s3c24xx/irq.c::91: s3c_irq_wake arch/arm/plat-s3c24xx/irq.c::99: s3c_irq_wake arch/arm/plat-s5pc1xx/irq-eint.c::179: s3c_irqext_wake arch/arm/plat-s5pc1xx/irq-eint.c::257: s3c_irqext_wake arch/frv/kernel/irq-mb93093.c::76: frv_fpga_end arch/ia64/kernel/iosapic.c::425: iosapic_shutdown_level_irq arch/ia64/kernel/iosapic.c::426: iosapic_enable_level_irq arch/ia64/kernel/iosapic.c::427: iosapic_disable_level_irq arch/ia64/kernel/iosapic.c::428: iosapic_ack_level_irq arch/ia64/kernel/iosapic.c::475: iosapic_disable_edge_irq arch/ia64/kernel/iosapic.c::476: iosapic_enable_edge_irq arch/ia64/kernel/iosapic.c::477: iosapic_disable_edge_irq arch/ia64/kernel/iosapic.c::479: iosapic_end_edge_irq arch/ia64/kernel/msi_ia64.c::107: mask_msi_irq arch/ia64/kernel/msi_ia64.c::108: unmask_msi_irq arch/ia64/kernel/msi_ia64.c::163: dmar_msi_unmask arch/ia64/kernel/msi_ia64.c::164: dmar_msi_mask arch/ia64/sn/kernel/irq.c::280: sn_set_affinity_irq arch/ia64/sn/kernel/msi_sn.c::230: mask_msi_irq arch/ia64/sn/kernel/msi_sn.c::231: unmask_msi_irq arch/m68knommu/platform/coldfire/intc.c::187: intc_irq_unmask arch/mips/dec/ioasic-irq.c::86: ack_ioasic_dma_irq arch/mips/dec/ioasic-irq.c::87: mask_ioasic_dma_irq arch/mips/dec/ioasic-irq.c::88: ack_ioasic_dma_irq arch/mips/dec/ioasic-irq.c::89: unmask_ioasic_dma_irq arch/mips/kernel/i8259.c::45: plat_set_irq_affinity arch/mips/kernel/irq_cpu.c::94: mask_mips_mt_irq arch/mips/kernel/irq_cpu.c::96: unmask_mips_mt_irq arch/mips/kernel/irq_cpu.c::97: unmask_mips_mt_irq arch/powerpc/platforms/cell/axon_msi.c::312: mask_msi_irq arch/powerpc/platforms/cell/axon_msi.c::313: unmask_msi_irq arch/powerpc/platforms/cell/axon_msi.c::314: unmask_msi_irq arch/powerpc/sysdev/cpm2_pic.c::205: cpm2_end_irq arch/powerpc/sysdev/fsl_msi.c::47: mask_msi_irq arch/powerpc/sysdev/fsl_msi.c::48: unmask_msi_irq arch/powerpc/sysdev/mpic_pasemi_msi.c::60: mpic_end_irq arch/powerpc/sysdev/mpic_pasemi_msi.c::61: mpic_set_irq_type arch/powerpc/sysdev/mpic_pasemi_msi.c::62: mpic_set_affinity arch/powerpc/sysdev/mpic_u3msi.c::42: mpic_end_irq arch/powerpc/sysdev/mpic_u3msi.c::43: mpic_set_irq_type arch/powerpc/sysdev/mpic_u3msi.c::44: mpic_set_affinity arch/sparc/kernel/pci_msi.c::116: mask_msi_irq arch/sparc/kernel/pci_msi.c::117: unmask_msi_irq arch/sparc/kernel/pci_msi.c::118: unmask_msi_irq arch/sparc/kernel/pci_msi.c::119: mask_msi_irq arch/x86/kernel/apic/io_apic.c::3462: unmask_msi_irq arch/x86/kernel/apic/io_apic.c::3463: mask_msi_irq arch/x86/kernel/apic/io_apic.c::3473: unmask_msi_irq arch/x86/kernel/apic/io_apic.c::3474: mask_msi_irq arch/x86/kernel/apic/io_apic.c::3634: dmar_msi_unmask arch/x86/kernel/apic/io_apic.c::3635: dmar_msi_mask arch/x86/kernel/apic/io_apic.c::3689: hpet_msi_unmask arch/x86/kernel/apic/io_apic.c::3690: hpet_msi_mask arch/x86/kernel/apic/io_apic.c::3702: hpet_msi_unmask arch/x86/kernel/apic/io_apic.c::3703: hpet_msi_mask arch/x86/kernel/apic/io_apic.c::3788: mask_ht_irq arch/x86/kernel/apic/io_apic.c::3789: unmask_ht_irq drivers/parisc/dino.c::362: no_ack_irq drivers/parisc/dino.c::363: no_end_irq drivers/parisc/eisa.c::197: no_ack_irq drivers/parisc/eisa.c::198: no_end_irq drivers/parisc/gsc.c::157: no_ack_irq drivers/parisc/gsc.c::158: no_end_irq drivers/parisc/iosapic.c::738: cpu_ack_irq drivers/parisc/superio.c::334: no_ack_irq drivers/parisc/superio.c::335: no_end_irq
initialization to local variable:
arch/arm/mach-pxa/irq.c::120: fn
arch/arm/mach-pxa/irq.c::151: fn
arch/arm/mach-pxa/pxa3xx.c::573: fn
arch/arm/plat-pxa/gpio.c::294: fn
non-call use of a function:
arch/ia64/kernel/iosapic.c::417: mask_irq arch/ia64/kernel/iosapic.c::418: unmask_irq arch/ia64/kernel/iosapic.c::419: mask_irq arch/ia64/kernel/iosapic.c::468: unmask_irq arch/microblaze/kernel/intc.c::121: intc_enable_or_unmask arch/microblaze/kernel/intc.c::122: intc_disable_or_mask arch/microblaze/kernel/intc.c::123: intc_mask_ack arch/microblaze/kernel/intc.c::124: intc_ack arch/microblaze/kernel/intc.c::125: intc_end arch/mips/dec/ioasic-irq.c::71: unmask_ioasic_irq arch/mips/dec/ioasic-irq.c::73: mask_ioasic_irq arch/mips/dec/ioasic-irq.c::75: ack_ioasic_irq arch/mips/kernel/irq_cpu.c::64: unmask_mips_irq arch/mips/kernel/irq_cpu.c::65: mask_mips_irq arch/mn10300/kernel/irq.c::76: mn10300_cpupic_mask arch/x86/kernel/i8259.c::397: legacy_pic_uint_noop arch/xtensa/variants/s6000/gpio.c::169: mask arch/xtensa/variants/s6000/gpio.c::192: mask arch/xtensa/variants/s6000/gpio.c::195: mask arch/xtensa/variants/s6000/gpio.c::198: mask arch/xtensa/variants/s6000/gpio.c::201: mask arch/xtensa/variants/s6000/gpio.c::204: mask arch/xtensa/variants/s6000/gpio.c::209: mask arch/xtensa/variants/s6000/gpio.c::216: mask arch/xtensa/variants/s6000/gpio.c::219: mask arch/xtensa/variants/s6000/gpio.c::221: mask arch/xtensa/variants/s6000/gpio.c::224: mask include/linux/kernel.h::41: mask kernel/irq/chip.c::345: default_disable
non-static function:
arch/alpha/kernel/irq_i8259.c::88: i8259a_startup_irq arch/alpha/kernel/irq_i8259.c::89: i8259a_disable_irq arch/alpha/kernel/irq_i8259.c::90: i8259a_enable_irq arch/alpha/kernel/irq_i8259.c::91: i8259a_disable_irq arch/alpha/kernel/irq_i8259.c::92: i8259a_mask_and_ack_irq arch/alpha/kernel/irq_i8259.c::93: i8259a_end_irq arch/arm/mach-msm/board-sapphire-gpio.c::264: sapphire_gpio_irq_set_wake arch/arm/mach-msm/board-trout-gpio.c::248: trout_gpio_irq_set_wake arch/arm/plat-s3c24xx/irq.c::240: s3c_irqext_type arch/arm/plat-s3c24xx/irq.c::250: s3c_irqext_type arch/blackfin/mach-common/ints-priority.c::274: bfin_internal_set_wake arch/blackfin/mach-common/ints-priority.c::937: bfin_gpio_set_wake arch/cris/arch-v32/kernel/irq.c::346: set_affinity_crisv32_irq arch/mips/jazz/irq.c::49: disable_r4030_irq arch/mips/jazz/irq.c::50: disable_r4030_irq arch/mips/jazz/irq.c::51: disable_r4030_irq arch/mips/lasat/interrupt.c::49: disable_lasat_irq arch/mips/lasat/interrupt.c::50: disable_lasat_irq arch/mips/lasat/interrupt.c::51: disable_lasat_irq arch/mips/lasat/interrupt.c::52: enable_lasat_irq arch/mips/sni/pcimt.c::218: disable_pcimt_irq arch/mips/sni/pcimt.c::219: disable_pcimt_irq arch/mips/sni/pcimt.c::220: disable_pcimt_irq arch/mips/sni/pcit.c::180: disable_pcit_irq arch/mips/sni/pcit.c::181: disable_pcit_irq arch/mips/sni/pcit.c::182: disable_pcit_irq arch/mips/sni/pcit.c::184: end_pcit_irq arch/mips/sni/rm200.c::289: sni_rm200_mask_and_ack_8259A arch/mips/sni/rm200.c::453: disable_rm200_irq arch/mips/sni/rm200.c::454: disable_rm200_irq arch/mips/sni/rm200.c::455: disable_rm200_irq arch/mips/sni/rm200.c::457: end_rm200_irq arch/powerpc/sysdev/mpic.c::907: mpic_mask_irq arch/powerpc/sysdev/mpic.c::908: mpic_unmask_irq arch/powerpc/sysdev/mpic.c::909: mpic_end_irq arch/powerpc/sysdev/mpic.c::910: mpic_set_irq_type arch/powerpc/sysdev/mpic.c::925: mpic_mask_irq arch/powerpc/sysdev/mpic.c::928: mpic_set_irq_type arch/sh/boards/mach-cayman/irq.c::100: disable_cayman_irq
non-test or call reference to field:
kernel/irq/manage.c::432: set_type
non-updated function:
arch/arm/mach-s3c2410/bast-irq.c::109: bast_pc104_maskack arch/m68knommu/platform/coldfire/intc.c::129: intc_irq_unmask arch/powerpc/sysdev/cpm2_pic.c::116: cpm2_end_irq
Re: [PATCH 06/12] genericirq: make irq_chip related function to take desc
Quoted 3 lines · Julia Lawall
Here is the list of potential trouble spots. This is from a slightly older version of Linux than the patch, so the line numbers don't match up. But the function names are probably good enough to find the problem.
Thanks for doing all of this. The set of trouble spots in particular looks like a useful list.
Quoted 165 lines
julia
function definition not found:
arch/arm/mach-iop13xx/msi.c::167:unmask_msi_irqarch/arm/mach-iop13xx/msi.c::168:mask_msi_irqarch/arm/mach-iop13xx/msi.c::169:mask_msi_irqarch/arm/mach-iop13xx/msi.c::170:unmask_msi_irqarch/arm/mach-s3c2410/bast-irq.c::109:bast_pc104_maskackarch/arm/mach-s3c2412/irq.c::108:s3c_irq_wakearch/arm/mach-s3c2412/irq.c::109:s3c_irqext_typearch/arm/mach-s3c64xx/irq-eint.c::148:s3c_irqext_wakearch/arm/plat-s3c24xx/irq.c::241:s3c_irqext_wakearch/arm/plat-s3c24xx/irq.c::249:s3c_irq_wakearch/arm/plat-s3c24xx/irq.c::91:s3c_irq_wakearch/arm/plat-s3c24xx/irq.c::99:s3c_irq_wakearch/arm/plat-s5pc1xx/irq-eint.c::179:s3c_irqext_wakearch/arm/plat-s5pc1xx/irq-eint.c::257:s3c_irqext_wakearch/frv/kernel/irq-mb93093.c::76:frv_fpga_endarch/ia64/kernel/iosapic.c::425:iosapic_shutdown_level_irqarch/ia64/kernel/iosapic.c::426:iosapic_enable_level_irqarch/ia64/kernel/iosapic.c::427:iosapic_disable_level_irqarch/ia64/kernel/iosapic.c::428:iosapic_ack_level_irqarch/ia64/kernel/iosapic.c::475:iosapic_disable_edge_irqarch/ia64/kernel/iosapic.c::476:iosapic_enable_edge_irqarch/ia64/kernel/iosapic.c::477:iosapic_disable_edge_irqarch/ia64/kernel/iosapic.c::479:iosapic_end_edge_irqarch/ia64/kernel/msi_ia64.c::107:mask_msi_irqarch/ia64/kernel/msi_ia64.c::108:unmask_msi_irqarch/ia64/kernel/msi_ia64.c::163:dmar_msi_unmaskarch/ia64/kernel/msi_ia64.c::164:dmar_msi_maskarch/ia64/sn/kernel/irq.c::280:sn_set_affinity_irqarch/ia64/sn/kernel/msi_sn.c::230:mask_msi_irqarch/ia64/sn/kernel/msi_sn.c::231:unmask_msi_irqarch/m68knommu/platform/coldfire/intc.c::187:intc_irq_unmaskarch/mips/dec/ioasic-irq.c::86:ack_ioasic_dma_irqarch/mips/dec/ioasic-irq.c::87:mask_ioasic_dma_irqarch/mips/dec/ioasic-irq.c::88:ack_ioasic_dma_irqarch/mips/dec/ioasic-irq.c::89:unmask_ioasic_dma_irqarch/mips/kernel/i8259.c::45:plat_set_irq_affinityarch/mips/kernel/irq_cpu.c::94:mask_mips_mt_irqarch/mips/kernel/irq_cpu.c::96:unmask_mips_mt_irqarch/mips/kernel/irq_cpu.c::97:unmask_mips_mt_irqarch/powerpc/platforms/cell/axon_msi.c::312:mask_msi_irqarch/powerpc/platforms/cell/axon_msi.c::313:unmask_msi_irqarch/powerpc/platforms/cell/axon_msi.c::314:unmask_msi_irqarch/powerpc/sysdev/cpm2_pic.c::205:cpm2_end_irqarch/powerpc/sysdev/fsl_msi.c::47:mask_msi_irqarch/powerpc/sysdev/fsl_msi.c::48:unmask_msi_irqarch/powerpc/sysdev/mpic_pasemi_msi.c::60:mpic_end_irqarch/powerpc/sysdev/mpic_pasemi_msi.c::61:mpic_set_irq_typearch/powerpc/sysdev/mpic_pasemi_msi.c::62:mpic_set_affinityarch/powerpc/sysdev/mpic_u3msi.c::42:mpic_end_irqarch/powerpc/sysdev/mpic_u3msi.c::43:mpic_set_irq_typearch/powerpc/sysdev/mpic_u3msi.c::44:mpic_set_affinityarch/sparc/kernel/pci_msi.c::116:mask_msi_irqarch/sparc/kernel/pci_msi.c::117:unmask_msi_irqarch/sparc/kernel/pci_msi.c::118:unmask_msi_irqarch/sparc/kernel/pci_msi.c::119:mask_msi_irqarch/x86/kernel/apic/io_apic.c::3462:unmask_msi_irqarch/x86/kernel/apic/io_apic.c::3463:mask_msi_irqarch/x86/kernel/apic/io_apic.c::3473:unmask_msi_irqarch/x86/kernel/apic/io_apic.c::3474:mask_msi_irqarch/x86/kernel/apic/io_apic.c::3634:dmar_msi_unmaskarch/x86/kernel/apic/io_apic.c::3635:dmar_msi_maskarch/x86/kernel/apic/io_apic.c::3689:hpet_msi_unmaskarch/x86/kernel/apic/io_apic.c::3690:hpet_msi_maskarch/x86/kernel/apic/io_apic.c::3702:hpet_msi_unmaskarch/x86/kernel/apic/io_apic.c::3703:hpet_msi_maskarch/x86/kernel/apic/io_apic.c::3788:mask_ht_irqarch/x86/kernel/apic/io_apic.c::3789:unmask_ht_irqdrivers/parisc/dino.c::362:no_ack_irqdrivers/parisc/dino.c::363:no_end_irqdrivers/parisc/eisa.c::197:no_ack_irqdrivers/parisc/eisa.c::198:no_end_irqdrivers/parisc/gsc.c::157:no_ack_irqdrivers/parisc/gsc.c::158:no_end_irqdrivers/parisc/iosapic.c::738:cpu_ack_irqdrivers/parisc/superio.c::334:no_ack_irqdrivers/parisc/superio.c::335:no_end_irqinitialization to local variable:
arch/arm/mach-pxa/irq.c::120: fn
arch/arm/mach-pxa/irq.c::151: fn
arch/arm/mach-pxa/pxa3xx.c::573: fn
arch/arm/plat-pxa/gpio.c::294: fnnon-call use of a function:
arch/ia64/kernel/iosapic.c::417:mask_irqarch/ia64/kernel/iosapic.c::418:unmask_irqarch/ia64/kernel/iosapic.c::419:mask_irqarch/ia64/kernel/iosapic.c::468:unmask_irqarch/microblaze/kernel/intc.c::121:intc_enable_or_unmaskarch/microblaze/kernel/intc.c::122:intc_disable_or_maskarch/microblaze/kernel/intc.c::123:intc_mask_ackarch/microblaze/kernel/intc.c::124:intc_ackarch/microblaze/kernel/intc.c::125:intc_endarch/mips/dec/ioasic-irq.c::71:unmask_ioasic_irqarch/mips/dec/ioasic-irq.c::73:mask_ioasic_irqarch/mips/dec/ioasic-irq.c::75:ack_ioasic_irqarch/mips/kernel/irq_cpu.c::64:unmask_mips_irqarch/mips/kernel/irq_cpu.c::65:mask_mips_irqarch/mn10300/kernel/irq.c::76:mn10300_cpupic_maskarch/x86/kernel/i8259.c::397:legacy_pic_uint_nooparch/xtensa/variants/s6000/gpio.c::169: mask arch/xtensa/variants/s6000/gpio.c::192: mask arch/xtensa/variants/s6000/gpio.c::195: mask arch/xtensa/variants/s6000/gpio.c::198: mask arch/xtensa/variants/s6000/gpio.c::201: mask arch/xtensa/variants/s6000/gpio.c::204: mask arch/xtensa/variants/s6000/gpio.c::209: mask arch/xtensa/variants/s6000/gpio.c::216: mask arch/xtensa/variants/s6000/gpio.c::219: mask arch/xtensa/variants/s6000/gpio.c::221: mask arch/xtensa/variants/s6000/gpio.c::224: mask include/linux/kernel.h::41: mask kernel/irq/chip.c::345:default_disablenon-static function:
arch/alpha/kernel/irq_i8259.c::88:i8259a_startup_irqarch/alpha/kernel/irq_i8259.c::89:i8259a_disable_irqarch/alpha/kernel/irq_i8259.c::90:i8259a_enable_irqarch/alpha/kernel/irq_i8259.c::91:i8259a_disable_irqarch/alpha/kernel/irq_i8259.c::92:i8259a_mask_and_ack_irqarch/alpha/kernel/irq_i8259.c::93:i8259a_end_irqarch/arm/mach-msm/board-sapphire-gpio.c::264:sapphire_gpio_irq_set_wakearch/arm/mach-msm/board-trout-gpio.c::248:trout_gpio_irq_set_wakearch/arm/plat-s3c24xx/irq.c::240:s3c_irqext_typearch/arm/plat-s3c24xx/irq.c::250:s3c_irqext_typearch/blackfin/mach-common/ints-priority.c::274:bfin_internal_set_wakearch/blackfin/mach-common/ints-priority.c::937:bfin_gpio_set_wakearch/cris/arch-v32/kernel/irq.c::346:set_affinity_crisv32_irqarch/mips/jazz/irq.c::49:disable_r4030_irqarch/mips/jazz/irq.c::50:disable_r4030_irqarch/mips/jazz/irq.c::51:disable_r4030_irqarch/mips/lasat/interrupt.c::49:disable_lasat_irqarch/mips/lasat/interrupt.c::50:disable_lasat_irqarch/mips/lasat/interrupt.c::51:disable_lasat_irqarch/mips/lasat/interrupt.c::52:enable_lasat_irqarch/mips/sni/pcimt.c::218:disable_pcimt_irqarch/mips/sni/pcimt.c::219:disable_pcimt_irqarch/mips/sni/pcimt.c::220:disable_pcimt_irqarch/mips/sni/pcit.c::180:disable_pcit_irqarch/mips/sni/pcit.c::181:disable_pcit_irqarch/mips/sni/pcit.c::182:disable_pcit_irqarch/mips/sni/pcit.c::184:end_pcit_irqarch/mips/sni/rm200.c::289:sni_rm200_mask_and_ack_8259Aarch/mips/sni/rm200.c::453:disable_rm200_irqarch/mips/sni/rm200.c::454:disable_rm200_irqarch/mips/sni/rm200.c::455:disable_rm200_irqarch/mips/sni/rm200.c::457:end_rm200_irqarch/powerpc/sysdev/mpic.c::907:mpic_mask_irqarch/powerpc/sysdev/mpic.c::908:mpic_unmask_irqarch/powerpc/sysdev/mpic.c::909:mpic_end_irqarch/powerpc/sysdev/mpic.c::910:mpic_set_irq_typearch/powerpc/sysdev/mpic.c::925:mpic_mask_irqarch/powerpc/sysdev/mpic.c::928:mpic_set_irq_typearch/sh/boards/mach-cayman/irq.c::100:disable_cayman_irqnon-test or call reference to field:
kernel/irq/manage.c::432:set_typenon-updated function:
arch/arm/mach-s3c2410/bast-irq.c::109:bast_pc104_maskackarch/m68knommu/platform/coldfire/intc.c::129:intc_irq_unmaskarch/powerpc/sysdev/cpm2_pic.c::116:cpm2_end_irq
Re: [PATCH 06/12] genericirq: make irq_chip related function to take desc
In reply to Thomas GleixnerQuoted 19 lines · Thomas Gleixner
kernel/irq/chip.c static void default_shutdown(unsigned int irq) · line 355
Quoted 11 lines · Yinghai Lu
/*
* Fixup enable/disable function pointers */
voidirq_chip_set_defaults(struct irq_chip *chip){kernel/irq/chip.c +6
-0+if (!chip->desc_enable) + chip->desc_enable = default_enable_desc; +if (!chip->desc_disable) + chip->desc_disable = default_disable_desc; +if (!chip->desc_startup) + chip->desc_startup = default_startup_desc;This will break all
irq_chipswhich implement enable, disable or startup. so the check needs to be:if (!chip->enable && !chip->desc_enable)
Quoted 13 lines
kernel/irq/chip.c static void default_shutdown(unsigned int irq) · line 366
Quoted 11 lines
kernel/irq/chip.c +11
-0+/* +* We use chip->disable, when the user provided its own. When +* we have default_disable set for chip->disable, then we need +* to use default_shutdown, otherwise the irq line is not +* disabled on free_irq(): +*/ +if (!chip->desc_shutdown) + chip->desc_shutdown = chip->desc_disable != default_disable_desc ? + chip->desc_disable : default_shutdown_desc; +if (!chip->desc_end) + chip->desc_end = dummy_irq_chip.desc_end;Same here.
should be:
/*
* Fixup enable/disable function pointers
*/
static void irq_chip_set_defaults_desc(struct irq_chip *chip)
{
if (!chip->desc_enable && !chip->enable)
chip->desc_enable = default_enable_desc;
if (!chip->desc_disable)
chip->desc_disable = default_disable_desc;
if (!chip->desc_startup)
chip->desc_startup = default_startup_desc;
/*
* We use chip->disable, when the user provided its own. When
* we have default_disable set for chip->disable, then we need
* to use default_shutdown, otherwise the irq line is not
* disabled on free_irq():
*/
if (!chip->desc_shutdown)
chip->desc_shutdown = chip->desc_disable != default_disable_desc ?
chip->desc_disable : default_shutdown_desc;
if (!chip->desc_end)
chip->desc_end = dummy_irq_chip.desc_end;
}
static void irq_chip_set_defaults_irq(struct irq_chip *chip)
{
if (!chip->enable)
chip->enable = default_enable;
if (!chip->disable)
chip->disable = default_disable;
if (!chip->startup)
chip->startup = default_startup;
/*
* We use chip->disable, when the user provided its own. When
* we have default_disable set for chip->disable, then we need
* to use default_shutdown, otherwise the irq line is not
* disabled on free_irq():
*/
if (!chip->shutdown)
chip->shutdown = chip->disable != default_disable ?
chip->disable : default_shutdown;
if (!chip->end)
chip->end = dummy_irq_chip.end;
}
void irq_chip_set_defaults(struct irq_chip *chip)
{
if (chip->desc_mask && chip->desc_unmask)
irq_chip_set_defaults_desc(chip);
else
irq_chip_set_defaults_irq(chip);
if (!chip->name)
chip->name = chip->typename;
}PATCH 7/12 genericirq: make hpet_msi/ht/msi/dmar_msi to take desc
In reply to Yinghai Lualso keep the old interface.
--- arch/x86/include/asm/hpet.h | 4 ++ arch/x86/kernel/hpet.c | 40 ++++++++++++++++++---- drivers/infiniband/hw/ipath/ipath_iba6110.c | 2 +- drivers/pci/dmar.c | 33 ++++++++++++++---- drivers/pci/htirq.c | 47 ++++++++++++++++++++------- drivers/pci/msi.c | 17 +++++++-- include/linux/dmar.h | 4 ++ include/linux/htirq.h | 7 +++- 8 files changed, 120 insertions(+), 34 deletions(-)
arch/x86/include/asm/hpet.h +4 -0
@@ -78,6 +78,10 @@ extern void hpet_msi_unmask(unsigned int irq);extern void hpet_msi_mask (unsigned int irq);extern void hpet_msi_write (unsigned int irq,struct msi_msg *msg);extern void hpet_msi_read (unsigned int irq,struct msi_msg *msg); +extern void hpet_msi_unmask_desc (struct irq_desc *); +extern void hpet_msi_mask_desc (struct irq_desc *); +extern void hpet_msi_write_desc (struct irq_desc *desc,struct msi_msg *msg); +extern void hpet_msi_read_desc (struct irq_desc *desc,struct msi_msg *msg);#ifdef CONFIG_PCI_MSI extern int arch_setup_hpet_msi (unsigned int irq,unsigned int id);
arch/x86/kernel/hpet.c +32 -8
@@ -426,9 +426,9 @@ static int hpet_legacy_next_event(unsigned long delta, static DEFINE_PER_CPU(struct hpet_dev *, cpu_hpet_dev);static struct hpet_dev *hpet_devs; -void hpet_msi_unmask (unsigned int irq) +void hpet_msi_unmask_desc (struct irq_desc *desc) { -struct hpet_dev *hdev =get_irq_data (irq); +struct hpet_dev *hdev =get_irq_desc_data (desc);unsigned int cfg;/* unmask it */
@@ -436,34 +436,58 @@ void hpet_msi_unmask(unsigned int irq) cfg |=HPET_TN_FSB ;hpet_writel (cfg,HPET_Tn_CFG (hdev->num)); } +void hpet_msi_unmask (unsigned int irq) +{ +struct irq_desc *desc =irq_to_desc (irq); -void hpet_msi_mask (unsigned int irq) +hpet_msi_unmask_desc (desc); +} + +void hpet_msi_mask_desc (struct irq_desc *desc) {unsigned int cfg; -struct hpet_dev *hdev =get_irq_data (irq); +struct hpet_dev *hdev =get_irq_desc_data (desc);/* mask it */ cfg =hpet_readl (HPET_Tn_CFG (hdev->num)); cfg &= ~HPET_TN_FSB ;hpet_writel (cfg,HPET_Tn_CFG (hdev->num)); } +void hpet_msi_mask (unsigned int irq) +{ +struct irq_desc *desc =irq_to_desc (irq); -void hpet_msi_write (unsigned int irq,struct msi_msg *msg) +hpet_msi_mask_desc (desc); +} + +void hpet_msi_write_desc (struct irq_desc *desc,struct msi_msg *msg) { -struct hpet_dev *hdev =get_irq_data (irq); +struct hpet_dev *hdev =get_irq_desc_data (desc);hpet_writel (msg->data,HPET_Tn_ROUTE (hdev->num));hpet_writel (msg->address_lo,HPET_Tn_ROUTE (hdev->num) +4 ); } +void hpet_msi_write (unsigned int irq,struct msi_msg *msg) +{ +struct irq_desc *desc =irq_to_desc (irq); -void hpet_msi_read (unsigned int irq,struct msi_msg *msg) +hpet_msi_write_desc (desc, msg); +} + +void hpet_msi_read_desc (struct irq_desc *desc,struct msi_msg *msg) { -struct hpet_dev *hdev =get_irq_data (irq); +struct hpet_dev *hdev =get_irq_desc_data (desc); msg->data =hpet_readl (HPET_Tn_ROUTE (hdev->num)); msg->address_lo =hpet_readl (HPET_Tn_ROUTE (hdev->num) +4 ); msg->address_hi =0 ; } +void hpet_msi_read (unsigned int irq,struct msi_msg *msg) +{ +struct irq_desc *desc =irq_to_desc (irq); + +hpet_msi_read_desc (desc, msg); +}static void hpet_msi_set_mode (enum clock_event_mode mode,struct clock_event_device *evt)
drivers/infiniband/hw/ipath/ipath_iba6110.c +1 -1
@@ -986,7 +986,7 @@ static int ipath_ht_intconfig(struct ipath_devdata *dd)return ret; } -static void ipath_ht_irq_update (struct pci_dev *dev,int irq, +static void ipath_ht_irq_update (struct pci_dev *dev,struct irq_desc *desc,struct ht_irq_msg *msg) {struct ipath_devdata *dd =pci_get_drvdata (dev);
drivers/pci/dmar.c +25 -8
@@ -1230,9 +1230,9 @@ const char *dmar_get_fault_reason(u8 fault_reason, int *fault_type) } } -void dmar_msi_unmask (unsigned int irq) +void dmar_msi_unmask_desc (struct irq_desc *desc) { -struct intel_iommu *iommu =get_irq_data (irq); +struct intel_iommu *iommu =get_irq_desc_data (desc);unsigned long flag;/* unmask it */
@@ -1242,11 +1242,15 @@ void dmar_msi_unmask(unsigned int irq)readl (iommu->reg +DMAR_FECTL_REG );spin_unlock_irqrestore (&iommu->register_lock, flag); } +void dmar_msi_unmask (unsigned int irq) +{ +dmar_msi_unmask_desc (irq_to_desc (irq)); +} -void dmar_msi_mask (unsigned int irq) +void dmar_msi_mask_desc (struct irq_desc *desc) {unsigned long flag; -struct intel_iommu *iommu =get_irq_data (irq); +struct intel_iommu *iommu =get_irq_desc_data (desc);/* mask it */ spin_lock_irqsave (&iommu->register_lock, flag);
@@ -1256,9 +1260,14 @@ void dmar_msi_mask(unsigned int irq)spin_unlock_irqrestore (&iommu->register_lock, flag); } -void dmar_msi_write (int irq,struct msi_msg *msg) +void dmar_msi_mask (unsigned int irq) { -struct intel_iommu *iommu =get_irq_data (irq); +dmar_msi_mask_desc (irq_to_desc (irq)); +} + +void dmar_msi_write_desc (struct irq_desc *desc,struct msi_msg *msg) +{ +struct intel_iommu *iommu =get_irq_desc_data (desc);unsigned long flag;spin_lock_irqsave (&iommu->register_lock, flag);
@@ -1267,10 +1276,14 @@ void dmar_msi_write(int irq, struct msi_msg *msg)writel (msg->address_hi, iommu->reg +DMAR_FEUADDR_REG );spin_unlock_irqrestore (&iommu->register_lock, flag); } +void dmar_msi_write (int irq,struct msi_msg *msg) +{ +dmar_msi_write_desc (irq_to_desc (irq), msg); +} -void dmar_msi_read (int irq,struct msi_msg *msg) +void dmar_msi_read_desc (struct irq_desc *desc,struct msi_msg *msg) { -struct intel_iommu *iommu =get_irq_data (irq); +struct intel_iommu *iommu =get_irq_desc_data (desc);unsigned long flag;spin_lock_irqsave (&iommu->register_lock, flag);
@@ -1280,6 +1293,10 @@ void dmar_msi_read(int irq, struct msi_msg *msg)spin_unlock_irqrestore (&iommu->register_lock, flag); } +void dmar_msi_read (int irq,struct msi_msg *msg) +{ +dmar_msi_read_desc (irq_to_desc (irq), msg); +}static int dmar_fault_do_one (struct intel_iommu *iommu,int type,u8 fault_reason,u16 source_id,unsigned long long addr) {
drivers/pci/htirq.c +35 -12
84 lines not on this page · raw message
drivers/pci/msi.c +13 -4
@@ -169,9 +169,10 @@ static void msix_mask_irq(struct msi_desc *desc, u32 flag) desc->masked =__msix_mask_irq (desc, flag); } -static void msi_set_mask_bit (unsigned irq,u32 flag) +static void msi_set_mask_bit (struct irq_desc *descx,u32 flag) { -struct msi_desc *desc =get_irq_msi (irq); +unsigned int irq = descx->irq; +struct msi_desc *desc =get_irq_desc_msi (descx);if (desc->msi_attrib.is_msix) {msix_mask_irq (desc, flag);
@@ -182,14 +183,22 @@ static void msi_set_mask_bit(unsigned irq, u32 flag) } } +void mask_msi_irq_desc (struct irq_desc *desc) +{ +msi_set_mask_bit (desc,1 ); +}void mask_msi_irq (unsigned int irq) { -msi_set_mask_bit (irq,1 ); +mask_msi_irq_desc (irq_to_desc (irq)); } +void unmask_msi_irq_desc (struct irq_desc *desc) +{ +msi_set_mask_bit (desc,0 ); +}void unmask_msi_irq (unsigned int irq) { -msi_set_mask_bit (irq,0 ); +unmask_msi_irq_desc (irq_to_desc (irq)); }void read_msi_msg_desc (struct irq_desc *desc,struct msi_msg *msg)
include/linux/dmar.h +4 -0
@@ -191,6 +191,10 @@ extern void dmar_msi_unmask(unsigned int irq);extern void dmar_msi_mask (unsigned int irq);extern void dmar_msi_read (int irq,struct msi_msg *msg);extern void dmar_msi_write (int irq,struct msi_msg *msg); +extern void dmar_msi_unmask_desc (struct irq_desc *); +extern void dmar_msi_mask_desc (struct irq_desc *); +extern void dmar_msi_read_desc (struct irq_desc *desc,struct msi_msg *msg); +extern void dmar_msi_write_desc (struct irq_desc *desc,struct msi_msg *msg);extern int dmar_set_interrupt (struct intel_iommu *iommu);extern irqreturn_t dmar_fault (int irq,void *dev_id);extern int arch_setup_dmar_msi (unsigned int irq);
include/linux/htirq.h +6 -1
@@ -7,16 +7,21 @@ struct ht_irq_msg { };/* Helper functions.. */ +struct irq_desc ;void fetch_ht_irq_msg (unsigned int irq,struct ht_irq_msg *msg);void write_ht_irq_msg (unsigned int irq,struct ht_irq_msg *msg);void mask_ht_irq (unsigned int irq);void unmask_ht_irq (unsigned int irq); +void fetch_ht_irq_desc_msg (struct irq_desc *desc,struct ht_irq_msg *msg); +void write_ht_irq_desc_msg (struct irq_desc *desc,struct ht_irq_msg *msg); +void mask_ht_irq_desc (struct irq_desc *); +void unmask_ht_irq_desc (struct irq_desc *);/* The arch hook for getting things started */ int arch_setup_ht_irq (unsigned int irq,struct pci_dev *dev);/* For drivers of buggy hardware */ -typedef void (ht_irq_update_t )(struct pci_dev *dev,int irq, +typedef void (ht_irq_update_t )(struct pci_dev *dev,struct irq_desc *desc,struct ht_irq_msg *msg);int __ht_create_irq (struct pci_dev *dev,int idx,ht_irq_update_t *update);
Signature · 1 line
1.6.4.2
PATCH 8/12 x86: make irq_chip to use desc_mask instead of mask
In reply to Yinghai Lucore irq_chip ...
--- arch/x86/include/asm/i8259.h | 2 +- arch/x86/include/asm/irq.h | 4 +- arch/x86/kernel/apic/io_apic.c | 314 ++++++++++++++++------------------------ arch/x86/kernel/i8259.c | 45 +++--- arch/x86/kernel/irq.c | 19 ++- 5 files changed, 165 insertions(+), 219 deletions(-)
arch/x86/include/asm/i8259.h +1 -1
@@ -58,7 +58,7 @@ struct legacy_pic {void (*mask_all)(void );void (*restore_mask)(void );void (*init)(int auto_eoi); -int (*irq_pending)(unsigned int irq); +int (*irq_pending)(struct irq_desc *desc);void (*make_irq)(unsigned int irq); };
arch/x86/include/asm/irq.h +2 -2
@@ -31,15 +31,15 @@ static inline int irq_canonicalize(int irq)# endif #endif +struct irq_desc ;#ifdef CONFIG_HOTPLUG_CPU #include <linux/cpumask.h> extern void fixup_irqs (void ); -extern void irq_force_complete_move (int ); +void irq_force_complete_move (struct irq_desc *desc);#endif extern void (*x86_platform_ipi_callback)(void );extern void native_init_IRQ (void ); -struct irq_desc ;extern bool handle_irq (struct irq_desc *desc,struct pt_regs *regs);extern unsigned int do_IRQ (struct pt_regs *regs);
arch/x86/kernel/apic/io_apic.c +127 -187
736 lines not on this page · raw message
arch/x86/kernel/i8259.c +25 -20
103 lines not on this page · raw message
arch/x86/kernel/irq.c +10 -9
@@ -27,7 +27,7 @@ void (*x86_platform_ipi_callback)(void) = NULL;void ack_bad_irq (unsigned int irq) {if (printk_ratelimit ()) -pr_err ("unexpected IRQ trap at vector %02x\n" , irq); +pr_err ("unexpected IRQ trap at irq %02x\n" , irq);/* * Currently unexpected vectors happen only on SMP and APIC.
@@ -308,23 +308,25 @@ void fixup_irqs(void)* non intr-remapping case, we can't wait till this interrupt * arrives at this cpu before completing the irq move. */ -irq_force_complete_move (irq); +irq_force_complete_move (desc);if (cpumask_any_and (affinity, cpu_online_mask) >= nr_cpu_ids) { break_affinity =1 ; affinity = cpu_all_mask; } -if (!(desc->status &IRQ_MOVE_PCNTXT ) && desc->chip->mask) - desc->chip->mask (irq); +if (!(desc->status &IRQ_MOVE_PCNTXT )) +desc_chip_mask (desc->chip, irq, desc); -if (desc->chip->set_affinity) +if (desc->chip->desc_set_affinity) + desc->chip->desc_set_affinity (desc, affinity); +else if (desc->chip->set_affinity) desc->chip->set_affinity (irq, affinity);else if (!(warned++)) set_affinity =0 ; -if (!(desc->status &IRQ_MOVE_PCNTXT ) && desc->chip->unmask) - desc->chip->unmask (irq); +if (!(desc->status &IRQ_MOVE_PCNTXT )) +desc_chip_unmask (desc->chip, irq, desc);raw_spin_unlock (&desc->lock);
@@ -356,8 +358,7 @@ void fixup_irqs(void) desc =__get_cpu_var (vector_desc)[vector];raw_spin_lock (&desc->lock); -if (desc->chip->retrigger) - desc->chip->retrigger (irq); +desc_chip_retrigger (desc->chip, desc->irq, desc);raw_spin_unlock (&desc->lock); } }
Signature · 1 line
1.6.4.2
Re: [PATCH 08/12] x86: make irq_chip to use desc_mask instead of maskn
Quoted 142 lines · Yinghai Lu
core
irq_chip...Signed-off-by Yinghai Lu <[email protected]>--- arch/x86/include/asm/i8259.h | 2 +- arch/x86/include/asm/irq.h | 4 +- arch/x86/kernel/apic/io_apic.c | 314 ++++++++++++++++------------------------ arch/x86/kernel/i8259.c | 45 +++--- arch/x86/kernel/irq.c | 19 ++- 5 files changed, 165 insertions(+), 219 deletions(-)arch/x86/include/asm/i8259.h +1
-1@@ -58,7 +58,7 @@ struct legacy_pic {void (*mask_all)(void );void (*restore_mask)(void );void (*init)(int auto_eoi); -int (*irq_pending)(unsigned int irq); +int (*irq_pending)(struct irq_desc *desc);void (*make_irq)(unsigned int irq); };arch/x86/include/asm/irq.h +2
-2@@ -31,15 +31,15 @@ static inline int irq_canonicalize(int irq)# endif #endif +struct irq_desc ;#ifdef CONFIG_HOTPLUG_CPU #include <linux/cpumask.h> extern void fixup_irqs (void ); -extern void irq_force_complete_move (int ); +void irq_force_complete_move (struct irq_desc *desc);#endif extern void (*x86_platform_ipi_callback)(void );extern void native_init_IRQ (void ); -struct irq_desc ;extern bool handle_irq (struct irq_desc *desc,struct pt_regs *regs);extern unsigned int do_IRQ (struct pt_regs *regs);arch/x86/kernel/apic/io_apic.c +4
-36@@ -176,18 +176,6 @@ int __init arch_early_irq_init(void) }#ifdef CONFIG_SPARSE_IRQ -struct irq_cfg *irq_cfg (unsigned int irq) -{ -struct irq_cfg *cfg =NULL ; -struct irq_desc *desc; - - desc =irq_to_desc (irq); -if (desc) - cfg = desc->chip_data; - -return cfg; -} -static struct irq_cfg *get_one_free_irq_cfg (int node) {struct irq_cfg *cfg;@@ -326,13 +314,6 @@ void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc) } }/* end for move_irq_desc */ - -#else -struct irq_cfg *irq_cfg (unsigned int irq) -{ -return irq < nr_irqs ? irq_cfgx + irq :NULL ; -} -#endif struct io_apic {@@ -580,7 +561,7 @@ static void __mask_IO_APIC_irq(struct irq_cfg *cfg)io_apic_modify_irq (cfg, ~0 ,IO_APIC_REDIR_MASKED , &io_apic_sync); } -static void mask_IO_APIC_irq_desc (struct irq_desc *desc) +static void mask_IO_APIC_irq (struct irq_desc *desc) {struct irq_cfg *cfg = desc->chip_data;unsigned long flags;@@ -592,7 +573,7 @@ static void mask_IO_APIC_irq_desc(struct irq_desc *desc)raw_spin_unlock_irqrestore (&ioapic_lock, flags); } -static void unmask_IO_APIC_irq_desc (struct irq_desc *desc) +static void unmask_IO_APIC_irq (struct irq_desc *desc) {struct irq_cfg *cfg = desc->chip_data;unsigned long flags;@@ -602,19 +583,6 @@ static void unmask_IO_APIC_irq_desc(struct irq_desc *desc)raw_spin_unlock_irqrestore (&ioapic_lock, flags); } -static void mask_IO_APIC_irq (unsigned int irq) -{ -struct irq_desc *desc =irq_to_desc (irq); - -mask_IO_APIC_irq_desc (desc); -} -static void unmask_IO_APIC_irq (unsigned int irq) -{ -struct irq_desc *desc =irq_to_desc (irq); - -unmask_IO_APIC_irq_desc (desc); -} -static void clear_IO_APIC_pin (unsigned int apic,unsigned int pin) {struct IO_APIC_route_entry entry;@@ -1470,7 +1438,7 @@ static void setup_IO_APIC_irq(int apic_id, int pin, unsigned int irq, struct irqioapic_register_intr (irq, desc, trigger);if (irq < legacy_pic->nr_legacy_irqs) - legacy_pic->chip->mask (irq); +desc_chip_mask (legacy_pic->chip, irq, desc);ioapic_write_entry (apic_id, pin, entry); }@@ -2267,29 +2235,29 @@ static int __init timer_irq_works(void)* an edge even if it isn't on the 8259A... */ -static unsigned int startup_ioapic_irq (unsigned int irq) +static unsigned int startup_ioapic_irq (struct irq_desc *desc) {int was_pending =0 ;unsigned long flags;struct irq_cfg *cfg;raw_spin_lock_irqsave (&ioapic_lock, flags);
arch/x86/kernel/apic/io_apic.c static int __init timer_irq_works(void) · line 2250
Quoted 10 lines
arch/x86/kernel/apic/io_apic.c +4
-4-if (irq < legacy_pic->nr_legacy_irqs) { - legacy_pic->chip->mask (irq); -if (legacy_pic->irq_pending (irq)) +if (desc->irq < legacy_pic->nr_legacy_irqs) { +desc_chip_mask (legacy_pic->chip,-1 , desc); +if (legacy_pic->irq_pending (desc)) was_pending =1 ; } - cfg =irq_cfg (irq); + cfg = desc->chip_data;
get_irq_desc_chip_data(desc); please
arch/x86/kernel/apic/io_apic.c static int __init timer_irq_works(void) · line 2260
Quoted 12 lines
arch/x86/kernel/apic/io_apic.c +2
-2__unmask_IO_APIC_irq (cfg);raw_spin_unlock_irqrestore (&ioapic_lock, flags);return was_pending; } -static int ioapic_retrigger_irq (unsigned int irq) +static int ioapic_retrigger_irq (struct irq_desc *desc) { -struct irq_cfg *cfg =irq_cfg (irq); +struct irq_cfg *cfg = desc->chip_data;
Ditto
arch/x86/kernel/apic/io_apic.c unlock: · line 2537
Quoted 6 lines
arch/x86/kernel/apic/io_apic.c +0
-3unsigned long flags; -static void __irq_complete_move (struct irq_desc **descp,unsigned vector) -{ -struct irq_desc *desc = *descp;
Who merged that particular piece of horror ?
arch/x86/kernel/apic/io_apic.c unlock: · line 2488
Quoted 5 lines
arch/x86/kernel/apic/io_apic.c +1
-2-static void __irq_complete_move (struct irq_desc **descp,unsigned vector) +static void __irq_complete_move (struct irq_desc *desc,unsigned vector) { -struct irq_desc *desc = *descp;struct irq_cfg *cfg = desc->chip_data;
That should be fixed as well and probably at some other places.
arch/x86/kernel/apic/io_apic.c void destroy_irq(unsigned int irq) · line 3288
Quoted 9 lines
* MSI message composition
*/
#ifdefCONFIG_PCI_MSIarch/x86/kernel/apic/io_apic.c +2
-2-static int msi_compose_msg (struct pci_dev *pdev,unsigned int irq, +static int msi_compose_msg (struct pci_dev *pdev,struct irq_desc *desc,struct msi_msg *msg,u8 hpet_id) { -struct irq_desc *desc; +unsigned int irq = desc->irq;
Please separate out unrelated changes. This has nothing to do with the irq chip implementation.
arch/x86/kernel/apic/io_apic.c static int setup_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc, int irq) · line 3485
Quoted 7 lines
/*
arch/x86/kernel/apic/io_apic.c +1
-0@@ -3540,8 +3482,9 @@ static int setup_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc, int irq) {int ret;struct msi_msg msg; +struct irq_desc *desc =irq_to_desc (irq);
Ditto
Quoted 15 lines
arch/x86/kernel/apic/io_apic.c +1
-2- ret =msi_compose_msg (dev, irq, &msg,-1 ); + ret =msi_compose_msg (dev, desc, &msg,-1 );if (ret <0 )return ret;@@ -3549,7 +3492,6 @@ static int setup_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc, int irq)write_msi_msg (irq, &msg);if (irq_remapped (irq)) { -struct irq_desc *desc =irq_to_desc (irq);/* * irq migration in process context */
arch/x86/kernel/apic/io_apic.c void arch_teardown_msi_irq(unsigned int irq) · line 3578
Quoted 6 lines
arch/x86/kernel/apic/io_apic.c +1
-0@@ -3631,9 +3573,8 @@ void arch_teardown_msi_irq(unsigned int irq)int arch_setup_dmar_msi (unsigned int irq) {int ret;struct msi_msg msg; +struct irq_desc *desc =irq_to_desc (irq);
Ditto
Quoted 17 lines
arch/x86/kernel/apic/io_apic.c +2
-2- ret =msi_compose_msg (NULL , irq, &msg,-1 ); + ret =msi_compose_msg (NULL , desc, &msg,-1 );if (ret <0 )return ret; -dmar_msi_write (irq, &msg); +dmar_msi_write_desc (desc, &msg);set_irq_chip_and_handler_name (irq, &dmar_msi_type, handle_edge_irq,"edge" );return 0 ;@@ -3686,9 +3628,8 @@ int arch_setup_dmar_msi(unsigned int irq)#ifdef CONFIG_HPET_TIMER arch/x86/kernel/irq.c +0
-0
arch/x86/kernel/irq.c void (*x86_platform_ipi_callback)(void) = NULL; · line 30
Quoted 5 lines
arch/x86/kernel/irq.c +1
-1@@ -27,7 +27,7 @@ void (*x86_platform_ipi_callback)(void) = NULL;void ack_bad_irq (unsigned int irq) {if (printk_ratelimit ()) -pr_err ("unexpected IRQ trap at vector %02x\n" , irq); +pr_err ("unexpected IRQ trap at irq %02x\n" , irq);
Unrelated
Thanks,
tglx
PATCH 9/12 x86: irq_chip to use desc_mask instead of mask part 2
In reply to Yinghai Lufor uv/vmi/lgues/xen etc...
--- arch/x86/kernel/uv_irq.c | 36 ++++++++++++++-------------- arch/x86/kernel/visws_quirks.c | 51 +++++++++++++++++++-------------------- arch/x86/kernel/vmiclock_32.c | 18 +++++++------- arch/x86/lguest/boot.c | 14 +++++----- drivers/misc/sgi-gru/grufile.c | 8 +++--- drivers/xen/events.c | 36 ++++++++++++++-------------- 6 files changed, 81 insertions(+), 82 deletions(-)
arch/x86/kernel/uv_irq.c +18 -18
@@ -27,34 +27,34 @@ struct uv_irq_2_mmr_pnode{static spinlock_t uv_irq_lock;static struct rb_root uv_irq_root; -static int uv_set_irq_affinity (unsigned int ,const struct cpumask *); +static int uv_set_irq_affinity (struct irq_desc *desc,const struct cpumask *); -static void uv_noop (unsigned int irq) +static void uv_noop (struct irq_desc *desc) { } -static unsigned int uv_noop_ret (unsigned int irq) +static unsigned int uv_noop_ret (struct irq_desc *desc) {return 0 ; } -static void uv_ack_apic (unsigned int irq) +static void uv_ack_apic (struct irq_desc *desc) {ack_APIC_irq (); }struct irq_chip uv_irq_chip = { - .name ="UV-CORE" , - .startup = uv_noop_ret, - .shutdown = uv_noop, - .enable = uv_noop, - .disable = uv_noop, - .ack = uv_noop, - .mask = uv_noop, - .unmask = uv_noop, - .eoi = uv_ack_apic, - .end = uv_noop, - .set_affinity = uv_set_irq_affinity, + .name ="UV-CORE" , + .desc_startup = uv_noop_ret, + .desc_shutdown = uv_noop, + .desc_enable = uv_noop, + .desc_disable = uv_noop, + .desc_ack = uv_noop, + .desc_mask = uv_noop, + .desc_unmask = uv_noop, + .desc_eoi = uv_ack_apic, + .desc_end = uv_noop, + .desc_set_affinity = uv_set_irq_affinity, };/*
@@ -153,7 +153,7 @@ arch_enable_uv_irq(char *irq_name, unsigned int irq, int cpu, int mmr_blade,BUILD_BUG_ON (sizeof (struct uv_IO_APIC_route_entry ) !=sizeof (unsigned long )); - cfg =irq_cfg (irq); + cfg = desc->chip_data; err =assign_irq_vector (irq, cfg, eligible_cpu);if (err !=0 )
@@ -205,9 +205,9 @@ static void arch_disable_uv_irq(int mmr_pnode, unsigned long mmr_offset)uv_write_global_mmr64 (mmr_pnode, mmr_offset, mmr_value); } -static int uv_set_irq_affinity (unsigned int irq,const struct cpumask *mask) +static int uv_set_irq_affinity (struct irq_desc *desc,const struct cpumask *mask) { -struct irq_desc *desc =irq_to_desc (irq); +unsigned int irq = desc->irq;struct irq_cfg *cfg = desc->chip_data;unsigned int dest;unsigned long mmr_value;
arch/x86/kernel/visws_quirks.c +25 -26
114 lines not on this page · raw message
arch/x86/kernel/vmiclock_32.c +9 -9
@@ -84,7 +84,7 @@ static inline unsigned int vmi_get_timer_vector(void)/** vmi clockchip */ #ifdef CONFIG_X86_LOCAL_APIC -static unsigned int startup_timer_irq (unsigned int irq) +static unsigned int startup_timer_irq (struct irq_desc *desc) {unsigned long val =apic_read (APIC_LVTT );apic_write (APIC_LVTT ,vmi_get_timer_vector ());
@@ -92,29 +92,29 @@ static unsigned int startup_timer_irq(unsigned int irq) return (val & APIC_SEND_PENDING); } -static void mask_timer_irq (unsigned int irq) +static void mask_timer_irq (struct irq_desc *desc) {unsigned long val =apic_read (APIC_LVTT );apic_write (APIC_LVTT , val |APIC_LVT_MASKED ); } -static void unmask_timer_irq (unsigned int irq) +static void unmask_timer_irq (struct irq_desc *desc) {unsigned long val =apic_read (APIC_LVTT );apic_write (APIC_LVTT , val & ~APIC_LVT_MASKED ); } -static void ack_timer_irq (unsigned int irq) +static void ack_timer_irq (struct irq_desc *desc) {ack_APIC_irq (); }static struct irq_chip vmi_chip__read_mostly = { - .name ="VMI-LOCAL" , - .startup = startup_timer_irq, - .mask = mask_timer_irq, - .unmask = unmask_timer_irq, - .ack = ack_timer_irq + .name ="VMI-LOCAL" , + .desc_startup = startup_timer_irq, + .desc_mask = mask_timer_irq, + .desc_unmask = unmask_timer_irq, + .desc_ack = ack_timer_irq };#endif
arch/x86/lguest/boot.c +7 -7
@@ -789,22 +789,22 @@ static void lguest_flush_tlb_kernel(void)* simple as setting a bit. We don't actually "ack" interrupts as such, we * just mask and unmask them. I wonder if we should be cleverer? */ -static void disable_lguest_irq (unsigned int irq) +static void disable_lguest_irq (struct irq_desc *desc) { -set_bit (irq, lguest_data.blocked_interrupts); +set_bit (desc->irq, lguest_data.blocked_interrupts); } -static void enable_lguest_irq (unsigned int irq) +static void enable_lguest_irq (struct irq_desc *desc) { -clear_bit (irq, lguest_data.blocked_interrupts); +clear_bit (desc->irq, lguest_data.blocked_interrupts); }/* This structure describes the lguest IRQ controller. */ static struct irq_chip lguest_irq_controller = { .name ="lguest" , - .mask = disable_lguest_irq, - .mask_ack = disable_lguest_irq, - .unmask = enable_lguest_irq, + .desc_mask = disable_lguest_irq, + .desc_mask_ack = disable_lguest_irq, + .desc_unmask = enable_lguest_irq, };/*
drivers/misc/sgi-gru/grufile.c +4 -4
@@ -348,15 +348,15 @@ static unsigned long gru_chiplet_cpu_to_mmr(int chiplet, int cpu, int *corep)static int gru_irq_count[GRU_CHIPLETS_PER_BLADE ]; -static void gru_noop (unsigned int irq) +static void gru_noop (struct irq_desc *desc) { }static struct irq_chip gru_chip[GRU_CHIPLETS_PER_BLADE ] = { [0 ... GRU_CHIPLETS_PER_BLADE - 1] { - .mask = gru_noop, - .unmask = gru_noop, - .ack = gru_noop + .desc_mask = gru_noop, + .desc_unmask = gru_noop, + .desc_ack = gru_noop } };
drivers/xen/events.c +18 -18
@@ -725,11 +725,11 @@ static int rebind_irq_to_cpu(unsigned irq, unsigned tcpu)return 0 ; } -static int set_affinity_irq (unsigned irq,const struct cpumask *dest) +static int set_affinity_irq (struct irq_desc *desc,const struct cpumask *dest) {unsigned tcpu =cpumask_first (dest); -return rebind_irq_to_cpu (irq, tcpu); +return rebind_irq_to_cpu (desc->irq, tcpu); }int resend_irq_on_evtchn (unsigned int irq)
@@ -748,35 +748,35 @@ int resend_irq_on_evtchn(unsigned int irq)return 1 ; } -static void enable_dynirq (unsigned int irq) +static void enable_dynirq (struct irq_desc *desc) { -int evtchn =evtchn_from_irq (irq); +int evtchn =evtchn_from_irq (desc->irq);if (VALID_EVTCHN (evtchn))unmask_evtchn (evtchn); } -static void disable_dynirq (unsigned int irq) +static void disable_dynirq (struct irq_desc *desc) { -int evtchn =evtchn_from_irq (irq); +int evtchn =evtchn_from_irq (desc->irq);if (VALID_EVTCHN (evtchn))mask_evtchn (evtchn); } -static void ack_dynirq (unsigned int irq) +static void ack_dynirq (struct irq_desc *desc) { -int evtchn =evtchn_from_irq (irq); +int evtchn =evtchn_from_irq (desc->irq); -move_native_irq (irq); +move_native_irq_desc (desc);if (VALID_EVTCHN (evtchn))clear_evtchn (evtchn); } -static int retrigger_dynirq (unsigned int irq) +static int retrigger_dynirq (struct irq_desc *desc) { -int evtchn =evtchn_from_irq (irq); +int evtchn =evtchn_from_irq (desc->irq);struct shared_info *sh = HYPERVISOR_shared_info;int ret =0 ;
@@ -921,15 +921,15 @@ void xen_irq_resume(void) }static struct irq_chip xen_dynamic_chip__read_mostly = { - .name ="xen-dyn" , + .name ="xen-dyn" , - .disable = disable_dynirq, - .mask = disable_dynirq, - .unmask = enable_dynirq, + .desc_disable = disable_dynirq, + .desc_mask = disable_dynirq, + .desc_unmask = enable_dynirq, - .ack = ack_dynirq, - .set_affinity = set_affinity_irq, - .retrigger = retrigger_dynirq, + .desc_ack = ack_dynirq, + .desc_set_affinity = set_affinity_irq, + .desc_retrigger = retrigger_dynirq, };void __init xen_init_IRQ (void )
Signature · 1 line
1.6.4.2
PATCH 10/12 genericirq: add set_irq_desc_chip/data ...
In reply to Yinghai Luwith set_irq_chip/data...
to take desc instead of irq
--- include/linux/irq.h | 10 +++- include/linux/irqnr.h | 1 + kernel/irq/chip.c | 127 ++++++++++++++++++++++++++++-------------------- 3 files changed, 83 insertions(+), 55 deletions(-)
include/linux/irq.h +8 -2
@@ -526,9 +526,9 @@ static inline int irq_has_action(unsigned int irq)/* Dynamic irq helper functions */ extern void dynamic_irq_init (unsigned int irq); -void dynamic_irq_init_keep_chip_data (unsigned int irq); +void dynamic_irq_init_keep_chip_data (struct irq_desc *desc);extern void dynamic_irq_cleanup (unsigned int irq); -void dynamic_irq_cleanup_keep_chip_data (unsigned int irq); +void dynamic_irq_cleanup_keep_chip_data (struct irq_desc *desc);/* Set/get chip/data for an IRQ: */ extern int set_irq_chip (unsigned int irq,struct irq_chip *chip);
@@ -537,6 +537,12 @@ extern int set_irq_chip_data(unsigned int irq, void *data);extern int set_irq_type (unsigned int irq,unsigned int type);extern int set_irq_msi (unsigned int irq,struct msi_desc *entry); +int set_irq_desc_chip (struct irq_desc *desc,struct irq_chip *chip); +int set_irq_desc_data (struct irq_desc *desc,void *data); +int set_irq_desc_chip_data (struct irq_desc *desc,void *data); +int set_irq_desc_type (struct irq_desc *desc,unsigned int type); +int set_irq_desc_msi (struct irq_desc *desc,struct msi_desc *entry); +#define get_irq_chip (irq) (irq_to_desc(irq)->chip)#define get_irq_chip_data (irq) (irq_to_desc(irq)->chip_data)#define get_irq_data (irq) (irq_to_desc(irq)->handler_data)
include/linux/irqnr.h +1 -0
@@ -43,6 +43,7 @@ extern struct irq_desc *irq_to_desc(unsigned int irq);#ifdef CONFIG_SMP #define irq_node (irq) (irq_to_desc(irq)->node) +#define irq_desc_node (desc) ((desc)->node)#else #define irq_node (irq) 0#endif
kernel/irq/chip.c +74 -53
235 lines not on this page · raw message
Signature · 1 line
1.6.4.2
PATCH 11/12 x86/iommu/dmar: update iommu/inter_remapping to use desc
In reply to Yinghai Luto make irq_remapped() not going to call irq_to_desc() ....
--- arch/x86/include/asm/io_apic.h | 4 -- arch/x86/kernel/apic/io_apic.c | 80 +++++++++++++++++++--------------------- drivers/pci/intr_remapping.c | 69 ++++++++++++++-------------------- include/linux/dmar.h | 36 +++++++++-------- 4 files changed, 86 insertions(+), 103 deletions(-)
arch/x86/include/asm/io_apic.h +0 -4
@@ -171,10 +171,6 @@ extern int restore_IO_APIC_setup(struct IO_APIC_route_entry **ioapic_entries);extern void probe_nr_irqs_gsi (void ); -extern int setup_ioapic_entry (int apic,int irq, -struct IO_APIC_route_entry *entry, -unsigned int destination,int trigger, -int polarity,int vector,int pin);extern void ioapic_write_entry (int apic,int pin,struct IO_APIC_route_entry e);extern void setup_ioapic_ids_from_mpc (void );
arch/x86/kernel/apic/io_apic.c +38 -42
288 lines not on this page · raw message
drivers/pci/intr_remapping.c +29 -40
223 lines not on this page · raw message
include/linux/dmar.h +19 -17
@@ -113,17 +113,17 @@ extern int enable_intr_remapping(int);extern void disable_intr_remapping (void );extern int reenable_intr_remapping (int ); -extern int get_irte (int irq,struct irte *entry); -extern int modify_irte (int irq,struct irte *irte_modified); -extern int alloc_irte (struct intel_iommu *iommu,int irq,u16 count); -extern int set_irte_irq (int irq,struct intel_iommu *iommu,u16 index, -u16 sub_handle); -extern int map_irq_to_irte_handle (int irq,u16 *sub_handle); -extern int clear_irte_irq (int irq,struct intel_iommu *iommu,u16 index); -extern int flush_irte (int irq); -extern int free_irte (int irq); - -extern int irq_remapped (int irq); +int get_irte (struct irq_desc *desc,struct irte *entry); +int modify_irte (struct irq_desc *desc,struct irte *irte_modified); +int alloc_irte (struct intel_iommu *iommu,struct irq_desc *desc,u16 count); +int set_irte_irq (struct irq_desc *desc,struct intel_iommu *iommu,u16 index, +u16 sub_handle); +int map_irq_to_irte_handle (struct irq_desc *desc,u16 *sub_handle); +int clear_irte_irq (struct irq_desc *desc,struct intel_iommu *iommu,u16 index); +int flush_irte (struct irq_desc *desc); +int free_irte (struct irq_desc *desc); + +extern int irq_remapped (struct irq_desc *desc);extern struct intel_iommu *map_dev_to_ir (struct pci_dev *dev);extern struct intel_iommu *map_ioapic_to_ir (int apic);extern struct intel_iommu *map_hpet_to_ir (u8 id);
@@ -131,23 +131,25 @@ extern int set_ioapic_sid(struct irte *irte, int apic);extern int set_hpet_sid (struct irte *irte,u8 id);extern int set_msi_sid (struct irte *irte,struct pci_dev *dev);#else -static inline int alloc_irte (struct intel_iommu *iommu,int irq,u16 count) +static inline int +alloc_irte (struct intel_iommu *iommu,struct irq_desc *desc,u16 count) {return -1 ; } -static inline int modify_irte (int irq,struct irte *irte_modified) +static inline int modify_irte (struct irq_desc *desc,struct irte *irte_modified) {return -1 ; } -static inline int free_irte (int irq) +static inline int free_irte (struct irq_desc *desc) {return -1 ; } -static inline int map_irq_to_irte_handle (int irq,u16 *sub_handle) +static inline int map_irq_to_irte_handle (struct irq_desc *desc,u16 *sub_handle) {return -1 ; } -static inline int set_irte_irq (int irq,struct intel_iommu *iommu,u16 index, +static inline int +set_irte_irq (struct irq_desc *desc,struct intel_iommu *iommu,u16 index,u16 sub_handle) {return -1 ;
@@ -177,7 +179,7 @@ static inline int set_msi_sid(struct irte *irte, struct pci_dev *dev)return 0 ; } -#define irq_remapped (irq) (0) +#define irq_remapped (desc) (0)#define enable_intr_remapping (mode) (-1)#define disable_intr_remapping () (0)#define reenable_intr_remapping (mode) (0)
Signature · 1 line
1.6.4.2
PATCH 12/12 x86: remove arch_probe_nr_irqs
In reply to Yinghai Luso keep nr_irqs == NR_IRQS
--- arch/x86/kernel/apic/io_apic.c | 22 ---------------------- 1 files changed, 0 insertions(+), 22 deletions(-)
arch/x86/kernel/apic/io_apic.c +0 -22
@@ -3839,28 +3839,6 @@ void __init probe_nr_irqs_gsi(void)printk (KERN_DEBUG "nr_irqs_gsi: %d\n" , nr_irqs_gsi); } -#ifdef CONFIG_SPARSE_IRQ -int __init arch_probe_nr_irqs (void ) -{ -int nr; - -if (nr_irqs > (NR_VECTORS * nr_cpu_ids)) - nr_irqs =NR_VECTORS * nr_cpu_ids; - - nr = nr_irqs_gsi +8 * nr_cpu_ids; -#if defined(CONFIG_PCI_MSI ) || defined(CONFIG_HT_IRQ ) -/* -* for MSI and HT dyn irq -*/ - nr += nr_irqs_gsi *16 ; -#endif -if (nr < nr_irqs) - nr_irqs = nr; - -return 0 ; -} -#endif -static int __io_apic_set_pci_routing (struct device *dev,int irq,struct io_apic_irq_attr *irq_attr) {
Signature · 1 line
1.6.4.2