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

powerpc: mpic: use IRQCHIP_SKIP_SET_WAKE instead of redundant mpic_irq_set_wake

mpic_irq_set_wake return -ENXIO for non FSL MPIC and sets IRQF_NO_SUSPEND
flag for FSL ones. enable_irq_wake already returns -ENXIO if irq_set_wak
is not implemented. Also there's no need to set the IRQF_NO_SUSPEND flag
as it doesn't guarantee wakeup for that interrupt.

This patch removes the redundant mpic_irq_set_wake and sets the
IRQCHIP_SKIP_SET_WAKE for only FSL MPIC.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Hongtao Jia <hongtao.jia@freescale.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Acked-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>

authored by

Sudeep Holla and committed by
Scott Wood
9100d20c 96eea642

+4 -19
+4 -19
arch/powerpc/sysdev/mpic.c
··· 924 924 return IRQ_SET_MASK_OK_NOCOPY; 925 925 } 926 926 927 - static int mpic_irq_set_wake(struct irq_data *d, unsigned int on) 928 - { 929 - struct irq_desc *desc = container_of(d, struct irq_desc, irq_data); 930 - struct mpic *mpic = mpic_from_irq_data(d); 931 - 932 - if (!(mpic->flags & MPIC_FSL)) 933 - return -ENXIO; 934 - 935 - if (on) 936 - desc->action->flags |= IRQF_NO_SUSPEND; 937 - else 938 - desc->action->flags &= ~IRQF_NO_SUSPEND; 939 - 940 - return 0; 941 - } 942 - 943 927 void mpic_set_vector(unsigned int virq, unsigned int vector) 944 928 { 945 929 struct mpic *mpic = mpic_from_irq(virq); ··· 961 977 .irq_unmask = mpic_unmask_irq, 962 978 .irq_eoi = mpic_end_irq, 963 979 .irq_set_type = mpic_set_irq_type, 964 - .irq_set_wake = mpic_irq_set_wake, 965 980 }; 966 981 967 982 #ifdef CONFIG_SMP ··· 975 992 .irq_mask = mpic_mask_tm, 976 993 .irq_unmask = mpic_unmask_tm, 977 994 .irq_eoi = mpic_end_irq, 978 - .irq_set_wake = mpic_irq_set_wake, 979 995 }; 980 996 981 997 #ifdef CONFIG_MPIC_U3_HT_IRQS ··· 1265 1283 flags |= MPIC_NO_RESET; 1266 1284 if (of_get_property(node, "single-cpu-affinity", NULL)) 1267 1285 flags |= MPIC_SINGLE_DEST_CPU; 1268 - if (of_device_is_compatible(node, "fsl,mpic")) 1286 + if (of_device_is_compatible(node, "fsl,mpic")) { 1269 1287 flags |= MPIC_FSL | MPIC_LARGE_VECTORS; 1288 + mpic_irq_chip.flags |= IRQCHIP_SKIP_SET_WAKE; 1289 + mpic_tm_chip.flags |= IRQCHIP_SKIP_SET_WAKE; 1290 + } 1270 1291 1271 1292 mpic = kzalloc(sizeof(struct mpic), GFP_KERNEL); 1272 1293 if (mpic == NULL)