Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1875074rwl; Sat, 8 Apr 2023 03:49:48 -0700 (PDT) X-Google-Smtp-Source: AKy350axGkwRu/jQ0I+6sjZk7oBMuxl4SUIG5XW2xBRYSQ53gYFREHJrDBadpqwlXDTwL71IeDAa X-Received: by 2002:a05:6402:1647:b0:502:62:7c with SMTP id s7-20020a056402164700b005020062007cmr4596392edx.24.1680950988410; Sat, 08 Apr 2023 03:49:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680950988; cv=none; d=google.com; s=arc-20160816; b=UBHoRpj9WZFtWpbhJ/2mFtsDMXMIyv9dreSfHRacRGlIOuMMw366p9Z8nOzwmIDUvl J6AaKFl4TjHCVWQyblHOebMt1SYfKkZeDo+IHb1D1OkwON+p5FS3iVQo6du6vJ1inmYI 5C9aYowBnVF5YF+180uydBxWGuV8umAWCwfvEUWbWEWxSbRC/k29KmT/bYBQCgGggy1B +HFopsKgfkjyyy2uUruIjiG1/XgozhxehB1WVk6zBqJ9gexZpL40azs+uQ0pERi4+5h3 rGTGMGOhopORQvTI9KEi54jgk7/Eu69d4rP9KwZyovpwtnR3B/HPRg8xqm+RaLJw3tQX V8Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=cl686Q9wQUjCqkyYPZeUOap60JNb3wqV6Kj5yMUk6Bw=; b=XpOMRCj/ShsCKO94MHVQXc/n5rlBppF+oMaHzpX+5TDqJ1avlmS42T+CpuMiQE/v/t 0YGONsKnlVtKOqIg1YtrttYqN7K6lnb3n+MhPnIPjIdusABz/z/bWyt04hi+JrU/KIsK 7WxdvV0xgeCB8TkhUPHN47nWYETr/yd/7TrjxDNzzhWQAEnI+4KQeiRPBhR/m7Ab8Z6E HLMMF4/rZm25ywdudCgF61YekPbACNYb55B5m+I49+MCvzO45GVFVzxGkRm9X/s3vebN hQshFWPeQu90izhhTQ1qcSHySv6aalmz6WY+YPNWVlvmcQzmIBdgu1pO5/RuvBn87LcA 6O7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=rKul6jiV; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f1-20020a056402150100b00502241c86afsi5025889edw.320.2023.04.08.03.49.23; Sat, 08 Apr 2023 03:49:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=rKul6jiV; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230146AbjDHKs5 (ORCPT + 99 others); Sat, 8 Apr 2023 06:48:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229901AbjDHKso (ORCPT ); Sat, 8 Apr 2023 06:48:44 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50922CC0A for ; Sat, 8 Apr 2023 03:48:06 -0700 (PDT) Date: Sat, 08 Apr 2023 10:45:16 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1680950716; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cl686Q9wQUjCqkyYPZeUOap60JNb3wqV6Kj5yMUk6Bw=; b=rKul6jiVDtYKPxe07eJzUxAkaw2lKkLAVzcTrESC+yJIVLtiyBoTcaZgBBdRN/pTq/BPZM E/N2pGRLrZ27kEN6EP2MywIFWykHgx3sQXQh5Vd3wBCG9z2Wyh0sZshsLxqIoyaUFgAcPI fb22mZDslIDA86vsqUgHOz3HEQHwMKNoG3eyhkLNgy5Zo1nYyqqnfg63dxVoWiNhJnAFD6 kbkyKnrQ4mjWo93Jc4Z7Um33x85tMoJ9NO+5EQD45X6D4AcHUXCV6OaC+hTwtkGpoWs2EK 3YTXZ1jsxJvSNY4qaSv2Wd9fkhhJ1pNW9GRo0oE3amLFqNs2rdvDeIehULioDA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1680950716; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cl686Q9wQUjCqkyYPZeUOap60JNb3wqV6Kj5yMUk6Bw=; b=Y0WAqcZNs6azwxU+R+vZ6RtnqDIIvbRiAfeeMhQRg1lzgH3OErrJVlFOxa9faZTpYvKV9b 9rDkbp5zG2RuBEBw== From: "irqchip-bot for Anup Patel" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-kernel@vger.kernel.org Subject: [irqchip: irq/irqchip-next] irqchip/riscv-intc: Add empty irq_eoi() for chained irq handlers Cc: Anup Patel , Palmer Dabbelt , Marc Zyngier , tglx@linutronix.de In-Reply-To: <20230328035223.1480939-8-apatel@ventanamicro.com> References: <20230328035223.1480939-8-apatel@ventanamicro.com> MIME-Version: 1.0 Message-ID: <168095071647.404.805771641857569861.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the irq/irqchip-next branch of irqchip: Commit-ID: f8415f2def181c63486e93c511b82692e0914d9e Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/f8415f2def181c63486e93c511b82692e0914d9e Author: Anup Patel AuthorDate: Tue, 28 Mar 2023 09:22:23 +05:30 Committer: Marc Zyngier CommitterDate: Sat, 08 Apr 2023 11:26:24 +01:00 irqchip/riscv-intc: Add empty irq_eoi() for chained irq handlers We add empty irq_eoi() in RISC-V INTC driver for child irqchip drivers (such as PLIC, SBI IPI, CLINT, APLIC, IMSIC, etc) which implement chained handlers for parent per-HART local interrupts. This hels us avoid unnecessary mask/unmask of per-HART local interrupts at the time of handling interrupts. Signed-off-by: Anup Patel Acked-by: Palmer Dabbelt Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230328035223.1480939-8-apatel@ventanamicro.com --- drivers/irqchip/irq-riscv-intc.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/irqchip/irq-riscv-intc.c b/drivers/irqchip/irq-riscv-intc.c index 784d256..f229e3e 100644 --- a/drivers/irqchip/irq-riscv-intc.c +++ b/drivers/irqchip/irq-riscv-intc.c @@ -46,10 +46,27 @@ static void riscv_intc_irq_unmask(struct irq_data *d) csr_set(CSR_IE, BIT(d->hwirq)); } +static void riscv_intc_irq_eoi(struct irq_data *d) +{ + /* + * The RISC-V INTC driver uses handle_percpu_devid_irq() flow + * for the per-HART local interrupts and child irqchip drivers + * (such as PLIC, SBI IPI, CLINT, APLIC, IMSIC, etc) implement + * chained handlers for the per-HART local interrupts. + * + * In the absence of irq_eoi(), the chained_irq_enter() and + * chained_irq_exit() functions (used by child irqchip drivers) + * will do unnecessary mask/unmask of per-HART local interrupts + * at the time of handling interrupts. To avoid this, we provide + * an empty irq_eoi() callback for RISC-V INTC irqchip. + */ +} + static struct irq_chip riscv_intc_chip = { .name = "RISC-V INTC", .irq_mask = riscv_intc_irq_mask, .irq_unmask = riscv_intc_irq_unmask, + .irq_eoi = riscv_intc_irq_eoi, }; static int riscv_intc_domain_map(struct irq_domain *d, unsigned int irq,