Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4584511pxj; Tue, 25 May 2021 11:15:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1DERxav7CmTGJECXykFe7YphRYg2C9IvLCY2n4hv7ybK7f0i+VYFkxchIg15r7oRbCBnJ X-Received: by 2002:a92:d201:: with SMTP id y1mr21833666ily.103.1621966521677; Tue, 25 May 2021 11:15:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621966521; cv=none; d=google.com; s=arc-20160816; b=orqqO3y/vPbCHilYpmv+dFEYYj1mAVEXHg5/9wUhoxRzehTghKavpCHPoR+ql3SaIW o8/GCkbjOQV/12hPxsJfKxxV5ATLLgVt5FKEAWTXLvsz7l3VpuDra3SJFdafVT91rW0i 9wJC0Vpawv2eChjvC0ywEzNOAx85sskzU2kzsETtiYIphBtG3BDkFqgEj0Dtjuc6nQuW WT9eZy3z1TA3I7DvSsLCgxWeUNJtN0F0Dx+4yqRrIP2BuVl8Z0g1UrUK3Q4d8cCO5UGz 3RUwuJ838qYGVsbmOTJCvjEVnxQqCPHOA8IzRw1Ko4dhaTYSSAYnzhQAUFTJcuwRo7j8 gl9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=kEmCFqRvp3oDYF3yRnOYhUDcl7Fzcy2jl7PeIPbTH40=; b=exJjZlZI66MJbFO7PyI2zAt3ZhSnCJ98RSz89IcJeVXSLZmzCpIcb71fREBIBnVMZN 2qyrdL3/iusNFIn9E9W+/42Qj8au1xWlKwtVZuOsxLteCibhLSdxMSULvA4gxndUUDKI BsQQ0+gT5XQmqOV67n36e8AeF2RhJrI6huR/0Eed5vdIyeRPw8pbLHoLKY2EDJPs7C/r Xc4Xtr6Mv1DX5/B8lhaf2+4VSmi0IIsiloVBDj2hKrn99SzN0MB9rBkEGgAsm8p97itv T3A0U7a4Tc03fAxRcSZQ3J1izDZ4AxmfIqGseO525D4yeoEpr91D/BEwT92PdaZozuBG FbrQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l2si15239642ilj.152.2021.05.25.11.15.08; Tue, 25 May 2021 11:15:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234088AbhEYRfU (ORCPT + 99 others); Tue, 25 May 2021 13:35:20 -0400 Received: from foss.arm.com ([217.140.110.172]:33096 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234020AbhEYRe4 (ORCPT ); Tue, 25 May 2021 13:34:56 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8BA9B169C; Tue, 25 May 2021 10:33:26 -0700 (PDT) Received: from e113632-lin.cambridge.arm.com (e113632-lin.cambridge.arm.com [10.1.194.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 7F9343F792; Tue, 25 May 2021 10:33:25 -0700 (PDT) From: Valentin Schneider To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Marc Zyngier , Thomas Gleixner , Lorenzo Pieralisi , Vincenzo Frascino Subject: [RFC PATCH v2 09/10] irqchip/gic: Convert to handle_strict_flow_irq() Date: Tue, 25 May 2021 18:32:54 +0100 Message-Id: <20210525173255.620606-10-valentin.schneider@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210525173255.620606-1-valentin.schneider@arm.com> References: <20210525173255.620606-1-valentin.schneider@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that the proper infrastructure is in place, convert the irq-gic chip to use handle_strict_flow_irq() along with IRQCHIP_AUTOMASKS_FLOW. For EOImode=1, the Priority Drop is moved from gic_handle_irq() into chip->irq_ack(). This effectively pushes the EOI write down into ->handle_irq(), but doesn't change its ordering wrt the irqaction handling. The EOImode=1 irqchip also gains IRQCHIP_EOI_THREADED, which allows the ->irq_eoi() call to be deferred to the tail of ONESHOT IRQ threads. This means a threaded ONESHOT IRQ can now be handled entirely without a single chip->irq_mask() call. EOImode=0 handling remains unchanged. Signed-off-by: Valentin Schneider --- drivers/irqchip/irq-gic.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c index b1d9c22caf2e..4919478c3e41 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c @@ -344,8 +344,6 @@ static void __exception_irq_entry gic_handle_irq(struct pt_regs *regs) if (unlikely(irqnr >= 1020)) break; - if (static_branch_likely(&supports_deactivate_key)) - writel_relaxed(irqstat, cpu_base + GIC_CPU_EOI); isb(); /* @@ -1012,7 +1010,9 @@ static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq, break; default: irq_domain_set_info(d, irq, hw, &gic->chip, d->host_data, - handle_fasteoi_irq, NULL, NULL); + static_branch_likely(&supports_deactivate_key) ? + handle_strict_flow_irq : handle_fasteoi_irq, + NULL, NULL); irq_set_probe(irq); irqd_set_single_target(irqd); break; @@ -1116,8 +1116,16 @@ static void gic_init_chip(struct gic_chip_data *gic, struct device *dev, if (use_eoimode1) { gic->chip.irq_mask = gic_eoimode1_mask_irq; + gic->chip.irq_ack = gic_eoi_irq; gic->chip.irq_eoi = gic_eoimode1_eoi_irq; gic->chip.irq_set_vcpu_affinity = gic_irq_set_vcpu_affinity; + + /* + * eoimode0 shouldn't expose FLOW_MASK because the priority + * drop is undissociable from the deactivation, and we do need + * the priority drop to happen within the flow handler. + */ + gic->chip.flags |= IRQCHIP_AUTOMASKS_FLOW | IRQCHIP_EOI_THREADED; } if (gic == &gic_data[0]) { -- 2.25.1