From patchwork Fri Jun 16 11:25:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 109057 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1274487vqr; Fri, 16 Jun 2023 04:38:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ64f76mwklUrwda8GPnHpOO50FmOP7EzJ56chgTcwlMrF69VnogQww9pLNb5OfFdD49S5KF X-Received: by 2002:a17:90a:31a:b0:24e:4b1c:74d2 with SMTP id 26-20020a17090a031a00b0024e4b1c74d2mr1531442pje.32.1686915527972; Fri, 16 Jun 2023 04:38:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686915527; cv=none; d=google.com; s=arc-20160816; b=qN8K0aTdjjax92OpmTPrzeiy9Zemqxud7KmmYbZdLKHYdWPTyzmfDFXNd5gTfACZKA 8U3HOnjxLIZtFiUktHMqh628b2mQAuk2Eqe3sZFgHYU+atJDl/DktxYXcxws8F8cg5pl TwTNB4dZvswyhKwWRig0vQnMbTj2Eo9s1+NmCFkaLdONhB4mUfA190glZQ8qVdSwdL5K 3gq0GCI9Tw7EGlSLIaAxczm1OSB9SPDvK0r2lJD5STVq7b8POGUrOJHC7s1QqNVYCyq/ ffHzGYW1biGZUkOZ5cgatFfVonG70cuLqkYi/k8oueWjtUX668/oskVgka9r+T7pg9vd 793Q== 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=jEUn0/f9FVUChE7Kl1tLCWJPDi1svyiHRZIFyQJfrAI=; b=jv8Lffoay0lhORnJ3XU3Y/HVAqHsWoFR74BSG1RygdaCNcrqX1iFEYgiHE/oTtABUg PeuG2pFTkXWp5TbecOQCBBj0ZMI9mmlIgZyIKk3PrL3WfocRahX8BH+aTFBc0HGU4SgA ckAhIVhmF+GozDWnxeK4/BrLZeFdYDSM/j2/qslr9oAW/04PBhfD3w+rm7zG9NQufp1m AD3AroTF0sbf5pNXWy1b5qB8Znpa8P+VdL5q0J04g/f95NDprH88mz2NE9fulkLa45Ys h3PUfO0f1vzVuWM2ImiIvqhyBtIGElo7JfZd8y/FiVrI9IkpXct8ROmYNcv3QvAmu4Ax euZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=u0p1fVB9; dkim=neutral (no key) header.i=@linutronix.de; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mi12-20020a17090b4b4c00b002563251c8e7si1525264pjb.128.2023.06.16.04.38.36; Fri, 16 Jun 2023 04:38:47 -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=u0p1fVB9; dkim=neutral (no key) header.i=@linutronix.de; 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 S1344232AbjFPLZb (ORCPT + 99 others); Fri, 16 Jun 2023 07:25:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235046AbjFPLZ2 (ORCPT ); Fri, 16 Jun 2023 07:25:28 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8F511FF5 for ; Fri, 16 Jun 2023 04:25:27 -0700 (PDT) Date: Fri, 16 Jun 2023 11:25:24 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1686914725; 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=jEUn0/f9FVUChE7Kl1tLCWJPDi1svyiHRZIFyQJfrAI=; b=u0p1fVB9n4LnPERCTGO+VZ1CcyV9aPXOGxpUi/ox6KqsoQZohb6CTQrTVHfWQxRixZd/Cw ljrlKBQk1KBet1qOZ4k0fikonbbWyeMpZ0kThQdrfCHva/Ff4Myp3vI1CAi5bhPs/YzSZg 3XAhaW9n3Z5/V2uzcYs8qd1BmDP9BKtcerIIzMmaOKQiRCtHcCLlaUr08XypguQ1+xAXX+ grzPkt2PPcNvXowtNFCblpcMxwrSM9h2UHklqt2iQH/8gR8G1nTxg/UXgw3Rq6ID8PrrX9 VHymYMV8t2M9GwyON0NBc00L6vHsBVIemx901k0FwyNY2P7kJDGJq1wPX6xSKQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1686914725; 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=jEUn0/f9FVUChE7Kl1tLCWJPDi1svyiHRZIFyQJfrAI=; b=MYj3kp6Q27WnBrL6hJmIYYl7z9plCfRjRUTsawRabe5C7OipIYt9tjDpfxsIYHbXSxl1dB oZt3IM8/cTnyHlBQ== From: "irqchip-bot for James Gowans" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-kernel@vger.kernel.org Subject: [irqchip: irq/irqchip-next] irqchip/gic-v3-its: Enable RESEND_WHEN_IN_PROGRESS for LPIs Cc: Marc Zyngier , James Gowans , Thomas Gleixner , KarimAllah Raslan , Yipeng Zou , Zhang Jianhua In-Reply-To: <20230608120021.3273400-4-jgowans@amazon.com> References: <20230608120021.3273400-4-jgowans@amazon.com> MIME-Version: 1.0 Message-ID: <168691472458.404.8158933098572478728.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768137248311552675?= X-GMAIL-MSGID: =?utf-8?q?1768859136829952522?= The following commit has been merged into the irq/irqchip-next branch of irqchip: Commit-ID: 8f4b589595d01f882d63d21efe15af4a5ad7c59b Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/8f4b589595d01f882d63d21efe15af4a5ad7c59b Author: James Gowans AuthorDate: Thu, 08 Jun 2023 14:00:21 +02:00 Committer: Marc Zyngier CommitterDate: Fri, 16 Jun 2023 12:23:40 +01:00 irqchip/gic-v3-its: Enable RESEND_WHEN_IN_PROGRESS for LPIs GICv3 LPIs are impacted by an architectural design issue: they do not have a global active state and as such a given LPI can be delivered to a new CPU after an affinity change while the previous instance of the same LPI handler has not yet completed on the original CPU. If LPIs had an active state, this second LPI would not be delivered until the first CPU deactivated the initial LPI, just like SPIs. To solve this issue, use the newly introduced IRQD_RESEND_WHEN_IN_PROGRESS flag, ensuring that we do not lose an LPI being delivered during that window by getting the GIC to resend it. This workaround gets enabled for all LPIs, including the VPE doorbells. Suggested-by: Marc Zyngier Signed-off-by: James Gowans Cc: Thomas Gleixner Cc: Marc Zyngier Cc: KarimAllah Raslan Cc: Yipeng Zou Cc: Zhang Jianhua [maz: massaged commit message] Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230608120021.3273400-4-jgowans@amazon.com --- drivers/irqchip/irq-gic-v3-its.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 0ec2b1e..1994541 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -3585,6 +3585,7 @@ static int its_irq_domain_alloc(struct irq_domain *domain, unsigned int virq, irqd = irq_get_irq_data(virq + i); irqd_set_single_target(irqd); irqd_set_affinity_on_activate(irqd); + irqd_set_resend_when_in_progress(irqd); pr_debug("ID:%d pID:%d vID:%d\n", (int)(hwirq + i - its_dev->event_map.lpi_base), (int)(hwirq + i), virq + i); @@ -4523,6 +4524,7 @@ static int its_vpe_irq_domain_alloc(struct irq_domain *domain, unsigned int virq irq_domain_set_hwirq_and_chip(domain, virq + i, i, irqchip, vm->vpes[i]); set_bit(i, bitmap); + irqd_set_resend_when_in_progress(irq_get_irq_data(virq + i)); } if (err) {