Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751070AbaKEXtl (ORCPT ); Wed, 5 Nov 2014 18:49:41 -0500 Received: from www.linutronix.de ([62.245.132.108]:39986 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750796AbaKEXtj (ORCPT ); Wed, 5 Nov 2014 18:49:39 -0500 Date: Thu, 6 Nov 2014 00:48:41 +0100 (CET) From: Thomas Gleixner To: Jiang Liu cc: Benjamin Herrenschmidt , Ingo Molnar , "H. Peter Anvin" , "Rafael J. Wysocki" , Bjorn Helgaas , Randy Dunlap , Yinghai Lu , Borislav Petkov , Grant Likely , Marc Zyngier , Yingjoe Chen , Jonathan Corbet , Matthias Brugger , Konrad Rzeszutek Wilk , Andrew Morton , Tony Luck , Joerg Roedel , Greg Kroah-Hartman , x86@kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org Subject: Re: [Patch Part2 v4 01/31] irqdomain: Introduce new interfaces to support hierarchy irqdomains In-Reply-To: <1415102525-9898-2-git-send-email-jiang.liu@linux.intel.com> Message-ID: References: <1415102525-9898-1-git-send-email-jiang.liu@linux.intel.com> <1415102525-9898-2-git-send-email-jiang.liu@linux.intel.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 On Tue, 4 Nov 2014, Jiang Liu wrote: > /* Number of irqs reserved for a legacy isa controller */ > #define NUM_ISA_INTERRUPTS 16 > @@ -64,6 +66,16 @@ struct irq_domain_ops { > int (*xlate)(struct irq_domain *d, struct device_node *node, > const u32 *intspec, unsigned int intsize, > unsigned long *out_hwirq, unsigned int *out_type); > + > +#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY > + /* extended V2 interfaces to support hierarchy irq_domains */ > + int (*alloc)(struct irq_domain *d, unsigned int virq, > + unsigned int nr_irqs, void *arg); > + void (*free)(struct irq_domain *d, unsigned int virq, > + unsigned int nr_irqs); > + int (*activate)(struct irq_domain *d, struct irq_data *irq_data); > + int (*deactivate)(struct irq_domain *d, struct irq_data *irq_data); Why do we have a return value here? Especially the deactivate one makes no sense at all. > +extern int irq_domain_activate_irq(struct irq_data *irq_data); > +extern int irq_domain_deactivate_irq(struct irq_data *irq_data); And here. > @@ -178,6 +179,7 @@ int irq_startup(struct irq_desc *desc, bool resend) > irq_state_clr_disabled(desc); > desc->depth = 0; > > + irq_domain_activate_irq(&desc->irq_data); We do not check it and we cannot do here AFAICT. > if (desc->irq_data.chip->irq_startup) { > ret = desc->irq_data.chip->irq_startup(&desc->irq_data); > irq_state_clr_masked(desc); > @@ -199,6 +201,7 @@ void irq_shutdown(struct irq_desc *desc) > desc->irq_data.chip->irq_disable(&desc->irq_data); > else > desc->irq_data.chip->irq_mask(&desc->irq_data); > + irq_domain_deactivate_irq(&desc->irq_data); Ditto. So the return value for irq_domain_deactivate_irq() is silly to begin with, but also the return value for irq_domain_activate_irq() does not really make sense. We've allocated the resources for the interrupt already down the hierarchy chain. So there is no reason why the actual activation should fail. 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/