From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v4 18/18] xen/arm: IRQ: Handle multiple action per IRQ Date: Wed, 23 Apr 2014 15:56:09 +0100 Message-ID: <5357D489.10308@linaro.org> References: <1398171530-27391-1-git-send-email-julien.grall@linaro.org> <1398171530-27391-19-git-send-email-julien.grall@linaro.org> <1398262073.18537.129.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Wcyar-0004ZF-Hl for xen-devel@lists.xenproject.org; Wed, 23 Apr 2014 14:56:13 +0000 Received: by mail-ee0-f48.google.com with SMTP id b57so871064eek.35 for ; Wed, 23 Apr 2014 07:56:11 -0700 (PDT) In-Reply-To: <1398262073.18537.129.camel@kazak.uk.xensource.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: Ian Campbell Cc: xen-devel@lists.xenproject.org, Keir Fraser , tim@xen.org, Jan Beulich , stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org On 04/23/2014 03:07 PM, Ian Campbell wrote: > On Tue, 2014-04-22 at 13:58 +0100, Julien Grall wrote: >> On ARM, it may happen (eg ARM SMMU) to setup multiple handler for the same >> interrupt. >> >> To be able to use multiple action, the driver has to explicitly call >> {setup,request}_irq with IRQF_SHARED as 2nd parameter. >> >> The behavior stays the same on x86, e.g only one action is handled. >> >> Signed-off-by: Julien Grall >> Cc: Keir Fraser >> Cc: Jan Beulich >> >> --- >> Changes in v4: >> - Go back to a single custom linked list. The double linked-list >> doesn't fit the requirements (i.e browsing safely without look) and >> the llist.h from Linux doesn't allow use to delete a node in the middle >> of the list. > > Is this variant any safer? Yes, everything is protected by a desc->lock, except in do_IRQ (see below why). >> + do >> + { >> + action->handler(irq, action->dev_id, regs); >> + action = action->next; >> + } while ( action ); > > What happens if action is freed and recycled in the midst of this loop? Nothing, the action won't be free until IRQ_INPROGRESS is set (see do .. while at the end of release_irq). Regards, -- Julien Grall