From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH for-4.5 6/8] xen/arm: IRQ: Add lock contrainst for gic_irq_{startup, shutdown} Date: Thu, 20 Feb 2014 20:48:31 +0000 Message-ID: <53066A1F.8020203@linaro.org> References: <1390581822-32624-1-git-send-email-julien.grall@linaro.org> <1390581822-32624-7-git-send-email-julien.grall@linaro.org> <1392810675.29739.15.camel@kazak.uk.xensource.com> <5304C13C.5060505@linaro.org> <1392820736.29739.86.camel@kazak.uk.xensource.com> <5304C4E1.2070901@linaro.org> <5304D6BC020000780011DC4F@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WGaXs-00076n-LX for xen-devel@lists.xenproject.org; Thu, 20 Feb 2014 20:48:36 +0000 Received: by mail-ee0-f43.google.com with SMTP id e51so1099709eek.30 for ; Thu, 20 Feb 2014 12:48:34 -0800 (PST) In-Reply-To: <5304D6BC020000780011DC4F@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: "Keir (Xen.org)" , Ian Campbell , patches@linaro.org, tim@xen.org, stefano.stabellini@citrix.com, xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org Hi Jan, On 02/19/2014 03:07 PM, Jan Beulich wrote: >>>> On 19.02.14 at 15:51, Julien Grall wrote: >> Adding Keir and Jan. >> >> On 02/19/2014 02:38 PM, Ian Campbell wrote: >>> On Wed, 2014-02-19 at 14:35 +0000, Julien Grall wrote: >>> >>>>>> -static void gic_irq_enable(struct irq_desc *desc) >>>>>> +static unsigned int gic_irq_startup(struct irq_desc *desc) >>>>> >>>>> unsigned? What are the error codes here going to be? >>>> >>>> This is the return type requested by hw_interrupt_type.startup. >>>> >>>> It seems that the return is never checked (even in x86 code). Maybe we >>>> should change the prototype of hw_interrupt_type.startup. >>> >>> Worth investigating. I wonder if someone thought this might return the >>> resulting interrupt number (those are normally unsigned int I think) or >>> if it actually did used to etc. >> >> I think it was copied from Linux which also have unsigned int. I gave a >> quick look to the code and this callback is only used in 2 places which >> always return 0. >> >> Surprisingly, the wrapper irq_startup (kernel/irq/manage.c) is returning >> an int... >> >> I can create a patch to return void instead of unsigned if everyone is >> happy with this solution. > > I'd be fine with such a change; I'd like to ask though that if you > do this, you at the same time do the resulting possible cleanup: > As an example, xen/arch/x86/msi.c:startup_msi_irq() becomes > unnecessary then. It will in fact be interesting to see how many > distinct startup routines actually remain. Before the clean up there was 8 distinct startup routines for x86. No there is only 2: - drivers/passthrough/amd/iommu_init.c: iommu_maskable_msi_startup - arch/x86/ioapic.c: startup_edge_ioapic_irq For a latter one, I'm a bit surprised that the function can return 1, but the result is never used. Cheers, -- Julien Grall