Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755600AbbHYPrW (ORCPT ); Tue, 25 Aug 2015 11:47:22 -0400 Received: from www.linutronix.de ([62.245.132.108]:51610 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755139AbbHYPrV (ORCPT ); Tue, 25 Aug 2015 11:47:21 -0400 Date: Tue, 25 Aug 2015 17:46:44 +0200 (CEST) From: Thomas Gleixner To: Marc Zyngier cc: Jason Cooper , Christoffer Dall , Jiang Liu , Eric Auger , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 3/4] irqchip: GIC: Convert to EOImode == 1 In-Reply-To: <1440503605-10185-4-git-send-email-marc.zyngier@arm.com> Message-ID: References: <1440503605-10185-1-git-send-email-marc.zyngier@arm.com> <1440503605-10185-4-git-send-email-marc.zyngier@arm.com> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1339 Lines: 44 On Tue, 25 Aug 2015, Marc Zyngier wrote: > +static struct static_key supports_deactivate = STATIC_KEY_INIT_TRUE; > + > #ifndef MAX_GIC_NR > #define MAX_GIC_NR 1 > #endif > @@ -137,6 +140,14 @@ static inline unsigned int gic_irq(struct irq_data *d) > return d->hwirq; > } > > +static inline bool primary_gic_irq(struct irq_data *d) > +{ > + if (MAX_GIC_NR > 1) > + return irq_data_get_irq_chip_data(d) == &gic_data[0]; > + > + return true; > +} > + > /* > * Routines to acknowledge, disable and enable interrupts > */ > @@ -164,7 +175,14 @@ static void gic_unmask_irq(struct irq_data *d) > > static void gic_eoi_irq(struct irq_data *d) > { > - writel_relaxed(gic_irq(d), gic_cpu_base(d) + GIC_CPU_EOI); > + u32 deact_offset = GIC_CPU_EOI; > + > + if (static_key_true(&supports_deactivate)) { > + if (primary_gic_irq(d)) > + deact_offset = GIC_CPU_DEACTIVATE; I really wonder for the whole series whether you really want all that static key dance and extra conditionals in the callbacks instead of just using seperate irq chips for the different interrupts. Thanks, tglx -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/