Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc:eVh_pic: Kill irq_desc abuse

I'm really grumpy about this one. The line:

#include "../../../kernel/irq/settings.h"

should have been an alarm sign for all people who added their SOB to
this trainwreck.

When I cleaned up the mess people made with interrupt descriptors a
few years ago, I warned that I'm going to hunt down new offenders and
treat them with stinking trouts. In this case I'll use frozen shark
for a better educational value.

The whole idiocy which was done there could have been avoided with two
lines of perfectly fine code. And do not complain about the lack of
correct examples in tree.

The solution is simple:

Remove the brainfart and use the proper functions, which should
have been used in the first place

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Ashish Kalra <ashish.kalra@freescale.com>
Cc: Timur Tabi <timur@freescale.com>
Cc: Kumar Gala <galak@kernel.crashing.org>
Cc: ppc <linuxppc-dev@lists.ozlabs.org>
Link: http://lkml.kernel.org/r/20140223212736.451970660@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

+2 -8
+2 -8
arch/powerpc/sysdev/ehv_pic.c
··· 28 28 #include <asm/ehv_pic.h> 29 29 #include <asm/fsl_hcalls.h> 30 30 31 - #include "../../../kernel/irq/settings.h" 32 - 33 31 static struct ehv_pic *global_ehv_pic; 34 32 static DEFINE_SPINLOCK(ehv_pic_lock); 35 33 ··· 111 113 int ehv_pic_set_irq_type(struct irq_data *d, unsigned int flow_type) 112 114 { 113 115 unsigned int src = virq_to_hw(d->irq); 114 - struct irq_desc *desc = irq_to_desc(d->irq); 115 116 unsigned int vecpri, vold, vnew, prio, cpu_dest; 116 117 unsigned long flags; 117 118 118 119 if (flow_type == IRQ_TYPE_NONE) 119 120 flow_type = IRQ_TYPE_LEVEL_LOW; 120 121 121 - irq_settings_clr_level(desc); 122 - irq_settings_set_trigger_mask(desc, flow_type); 123 - if (flow_type & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) 124 - irq_settings_set_level(desc); 122 + irqd_set_trigger_type(d, flow_type); 125 123 126 124 vecpri = ehv_pic_type_to_vecpri(flow_type); 127 125 ··· 138 144 ev_int_set_config(src, vecpri, prio, cpu_dest); 139 145 140 146 spin_unlock_irqrestore(&ehv_pic_lock, flags); 141 - return 0; 147 + return IRQ_SET_MASK_OK_NOCOPY; 142 148 } 143 149 144 150 static struct irq_chip ehv_pic_irq_chip = {