From patchwork Mon Jan 28 15:59:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 156763 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3588053jaa; Mon, 28 Jan 2019 08:01:25 -0800 (PST) X-Google-Smtp-Source: ALg8bN7v4MVCePGzJAfjRfu76NiuyIC0SR8T49xHmcEqc9nst5FN0/fniu+IDp3FI1LUfxIf8tB4 X-Received: by 2002:a81:8886:: with SMTP id y128mr21815080ywf.107.1548691285727; Mon, 28 Jan 2019 08:01:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548691285; cv=none; d=google.com; s=arc-20160816; b=mN18ZEC0+BmgcmadpHxW+WoPLR7yR3cJefb/kRpD8gK8GZRNQfjHfNgGdFE34gDJ8K ekz6XC4+WFwJvBY5KS7hVQKDP2vqzEtY4PiP+3zcyAzjDOX5820Q/woyCUI2XFAnNr2b WOswgTZSVgCYrIEqJ2z4SSQ2bE8HWRNFjweCEANwuHUTPotKSLryZAXHofSUzKoN7r6c aS9Va5reVbGvhGUoUKUs+Twx3ZYDVpB5ZIGc3WEw4aKtYmxadaeByIBiyANEzqvT9Sgh GYd/QlDH7QF8crm4mwDYqz8ZZoTvphMzFm/IpyAy1CuxQ1DU4qw5rwSWkhtZVn7y4thZ olgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:message-id:date:to:from; bh=AWWK3pTq6/JvjTer5sgZCZCnmMr+aTqYrwuFoNx0wo0=; b=zIuYPRUODWAeIc7KSWnsJZuTV5GQkxZOvJPBiLJ4qCV6DUBp2SwVpWM1pUUzJjcy/U 8XIn/6/GlOhY49gbnLjMywkHTGHuDcF5L7GDkO4KQYSxPKvRSbT7vqggwR1Neg6+bKie IkBnHSOykcPNlPXueuVpODXXyPXlphwHPKI5rV+mXbtvrhZNLkAffjFBaeOMGwaOKPH/ GZSELf5QJiLLkUs+2gjIY+TNo7CEExMn/VvLfNdTvWjlVowlW8fn/iVIVZlftrLSgAJS a7KrXL79AB+5IL6PosLDPSRLCzEaXQkRrfFS+8pOiN2POvOcDo7pyy9bLj5w11Dky1E1 3aMw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id r131si19185507yba.164.2019.01.28.08.01.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 Jan 2019 08:01:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1go9Jh-0003BB-VR; Mon, 28 Jan 2019 15:59:21 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1go9Jg-0003B1-MZ for xen-devel@lists.xenproject.org; Mon, 28 Jan 2019 15:59:20 +0000 X-Inumbo-ID: ac0e720a-2315-11e9-8f2c-876af2adb134 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id ac0e720a-2315-11e9-8f2c-876af2adb134; Mon, 28 Jan 2019 15:59:20 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B65C880D; Mon, 28 Jan 2019 07:59:19 -0800 (PST) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A59B43F589; Mon, 28 Jan 2019 07:59:18 -0800 (PST) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Mon, 28 Jan 2019 15:59:09 +0000 Message-Id: <20190128155909.14289-1-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 Subject: [Xen-devel] [PATCH for-next] xen/arm: irq: Don't use _IRQ_PENDING when handling host interrupt X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: andre.przywara@arm.com, Julien Grall , sstabellini@kernel.org, andrii.anisov@gmail.com MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" While SPIs are shared between CPU, it is not possible to receive the same interrupts on a different CPU while the interrupt is in active state. The deactivation of the interrupt is done at the end of the handling. This means the _IRQ_PENDING logic is unecessary on Arm as a same interrupt can never come up while in the loop. So remove it to simplify the interrupt handle code. Signed-off-by: Julien Grall Reviewed-by: Andrii Anisov Reviewed-by: Stefano Stabellini --- xen/arch/arm/irq.c | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c index c51cf333ce..3877657a52 100644 --- a/xen/arch/arm/irq.c +++ b/xen/arch/arm/irq.c @@ -199,6 +199,7 @@ int request_irq(unsigned int irq, unsigned int irqflags, void do_IRQ(struct cpu_user_regs *regs, unsigned int irq, int is_fiq) { struct irq_desc *desc = irq_to_desc(irq); + struct irqaction *action; perfc_incr(irqs); @@ -242,35 +243,22 @@ void do_IRQ(struct cpu_user_regs *regs, unsigned int irq, int is_fiq) goto out_no_end; } - set_bit(_IRQ_PENDING, &desc->status); - - /* - * Since we set PENDING, if another processor is handling a different - * instance of this same irq, the other processor will take care of it. - */ - if ( test_bit(_IRQ_DISABLED, &desc->status) || - test_bit(_IRQ_INPROGRESS, &desc->status) ) + if ( test_bit(_IRQ_DISABLED, &desc->status) ) goto out; set_bit(_IRQ_INPROGRESS, &desc->status); - while ( test_bit(_IRQ_PENDING, &desc->status) ) - { - struct irqaction *action; + action = desc->action; - clear_bit(_IRQ_PENDING, &desc->status); - action = desc->action; + spin_unlock_irq(&desc->lock); - spin_unlock_irq(&desc->lock); - - do - { - action->handler(irq, action->dev_id, regs); - action = action->next; - } while ( action ); + do + { + action->handler(irq, action->dev_id, regs); + action = action->next; + } while ( action ); - spin_lock_irq(&desc->lock); - } + spin_lock_irq(&desc->lock); clear_bit(_IRQ_INPROGRESS, &desc->status);