From patchwork Mon Aug 24 10:23:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 11732773 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CEAC81510 for ; Mon, 24 Aug 2020 10:24:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B329321741 for ; Mon, 24 Aug 2020 10:24:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598264677; bh=xAjRigESCgC2LNLqnsyL+GzSgONSHYDPspre3j7tOII=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=KMH7VcU7zrCVzzzA54qxRnegiz7UGrV83fcAI3R6yNRgtw3TqvkA6LKUjierbeQSw yJopw/Od+us9fCfNT/bvM/s0M8uVQ06X2bDF726hAw1HM1kT7OHbRrxx6vjK7rLCqP OPeclHWarwAQDPm60eF+lGHd6iUXZ5vyuskXxCqE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726700AbgHXKYh (ORCPT ); Mon, 24 Aug 2020 06:24:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:50182 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726037AbgHXKXx (ORCPT ); Mon, 24 Aug 2020 06:23:53 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 21A5B2074D; Mon, 24 Aug 2020 10:23:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598264632; bh=xAjRigESCgC2LNLqnsyL+GzSgONSHYDPspre3j7tOII=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J25la+3RmUfVBtUsg8713IDbUZhsr8ofbKDLNJnlTxSR58mhvmd3EF5So6WI1wrej Sd5KQT89KJZY19BiAp8Kt4yBJB9UY0l1YOAqmtLx8PkF06sXq9slpioZO6KgUHbloM /u4cZAhalpiR0G0rxIQbIiUaufsZNlNlAJ0swL0A= Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kA9dm-006BQc-Ho; Mon, 24 Aug 2020 11:23:50 +0100 From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Cc: Bjorn Helgaas , Gregory Clement , Jason Cooper , Laurentiu Tudor , Thomas Gleixner , Valentin Schneider Subject: [PATCH 1/9] irqchip/gic-v2, v3: Implement irq_chip->irq_retrigger() Date: Mon, 24 Aug 2020 11:23:09 +0100 Message-Id: <20200824102317.1038259-2-maz@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200824102317.1038259-1-maz@kernel.org> References: <20200824102317.1038259-1-maz@kernel.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, bhelgaas@google.com, gregory.clement@bootlin.com, jason@lakedaemon.net, laurentiu.tudor@nxp.com, tglx@linutronix.de, valentin.schneider@arm.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org From: Valentin Schneider While digging around IRQCHIP_EOI_IF_HANDLED and irq/resend.c, it has come to my attention that the IRQ resend situation seems a bit precarious for the GIC(s). When marking an IRQ with IRQS_PENDING, handle_fasteoi_irq() will bail out and issue an irq_eoi(). Should the IRQ in question be re-enabled, check_irq_resend() will trigger a SW resend, which will go through the flow handler again and issue *another* irq_eoi() on the *same* IRQ activation. This is something the GIC spec clearly describes as a bad idea: any EOI must match a previous ACK. Implement irq_chip.irq_retrigger() for the GIC chips by setting the GIC pending bit of the relevant IRQ. After being called by check_irq_resend(), this will eventually trigger a *new* interrupt which we will handle as usual. Signed-off-by: Valentin Schneider Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20200730170321.31228-2-valentin.schneider@arm.com --- drivers/irqchip/irq-gic-v3.c | 7 +++++++ drivers/irqchip/irq-gic.c | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 324f280ff606..b507bc7c5cda 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -1207,6 +1207,11 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val, #define gic_smp_init() do { } while(0) #endif +static int gic_retrigger(struct irq_data *data) +{ + return !gic_irq_set_irqchip_state(data, IRQCHIP_STATE_PENDING, true); +} + #ifdef CONFIG_CPU_PM static int gic_cpu_pm_notifier(struct notifier_block *self, unsigned long cmd, void *v) @@ -1242,6 +1247,7 @@ static struct irq_chip gic_chip = { .irq_eoi = gic_eoi_irq, .irq_set_type = gic_set_type, .irq_set_affinity = gic_set_affinity, + .irq_retrigger = gic_retrigger, .irq_get_irqchip_state = gic_irq_get_irqchip_state, .irq_set_irqchip_state = gic_irq_set_irqchip_state, .irq_nmi_setup = gic_irq_nmi_setup, @@ -1258,6 +1264,7 @@ static struct irq_chip gic_eoimode1_chip = { .irq_eoi = gic_eoimode1_eoi_irq, .irq_set_type = gic_set_type, .irq_set_affinity = gic_set_affinity, + .irq_retrigger = gic_retrigger, .irq_get_irqchip_state = gic_irq_get_irqchip_state, .irq_set_irqchip_state = gic_irq_set_irqchip_state, .irq_set_vcpu_affinity = gic_irq_set_vcpu_affinity, diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c index a27ba2cc1dce..e92ee2b6d7a5 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c @@ -347,6 +347,11 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val, } #endif +static int gic_retrigger(struct irq_data *data) +{ + return !gic_irq_set_irqchip_state(data, IRQCHIP_STATE_PENDING, true); +} + static void __exception_irq_entry gic_handle_irq(struct pt_regs *regs) { u32 irqstat, irqnr; @@ -417,6 +422,7 @@ static const struct irq_chip gic_chip = { .irq_unmask = gic_unmask_irq, .irq_eoi = gic_eoi_irq, .irq_set_type = gic_set_type, + .irq_retrigger = gic_retrigger, .irq_get_irqchip_state = gic_irq_get_irqchip_state, .irq_set_irqchip_state = gic_irq_set_irqchip_state, .flags = IRQCHIP_SET_TYPE_MASKED | From patchwork Mon Aug 24 10:23:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 11732775 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F0FDA16B1 for ; Mon, 24 Aug 2020 10:24:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C90BA20FC3 for ; Mon, 24 Aug 2020 10:24:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598264684; bh=C3YTLiTEJrWGnbRCgydH4Jhh5WgGVJ9rPOEaMGjkFBo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=xgMPY/Oyak8A9im6vgiMTkksYowTSmcz8eKmO+8oQwMee8SbhBN362MSkAx3hELNM kxi86I1SLJ5myYcZ0QRLNj7UZpcFzXjalXznPqKHF6pd3LT8zipw2TYk/ByDUob54A iEyhQfU2x5gZMBCT8W2Pi6OlSI5rM2iHB0wKzAGk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727021AbgHXKYh (ORCPT ); Mon, 24 Aug 2020 06:24:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:50208 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726483AbgHXKXx (ORCPT ); Mon, 24 Aug 2020 06:23:53 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AD6292075B; Mon, 24 Aug 2020 10:23:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598264632; bh=C3YTLiTEJrWGnbRCgydH4Jhh5WgGVJ9rPOEaMGjkFBo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N00I6fphgD0Z14HF7FvDHj7L1K0/1d/gVI3mkDIxMrhi9ow+9ekc/wIc+XWUkjubQ kM1M5QXZCN8KEYaoccd4niRlTKE5uIJqlAwzqIO7gZpizpaXs3mDVvzFLkaM5c3VIW y/t28V7i7BYnOEAZPKfZcu5784lUO0AwLH6fhmoI= Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kA9dn-006BQc-5k; Mon, 24 Aug 2020 11:23:51 +0100 From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Cc: Bjorn Helgaas , Gregory Clement , Jason Cooper , Laurentiu Tudor , Thomas Gleixner , Valentin Schneider Subject: [PATCH 2/9] irqchip/git-v3-its: Implement irq_retrigger callback for device-triggered LPIs Date: Mon, 24 Aug 2020 11:23:10 +0100 Message-Id: <20200824102317.1038259-3-maz@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200824102317.1038259-1-maz@kernel.org> References: <20200824102317.1038259-1-maz@kernel.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, bhelgaas@google.com, gregory.clement@bootlin.com, jason@lakedaemon.net, laurentiu.tudor@nxp.com, tglx@linutronix.de, valentin.schneider@arm.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Signed-off-by: Marc Zyngier --- drivers/irqchip/irq-gic-v3-its.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 95f097448f97..2808545a963e 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -1720,6 +1720,11 @@ static int its_irq_set_irqchip_state(struct irq_data *d, return 0; } +static int its_irq_retrigger(struct irq_data *d) +{ + return !its_irq_set_irqchip_state(d, IRQCHIP_STATE_PENDING, true); +} + /* * Two favourable cases: * @@ -1971,6 +1976,7 @@ static struct irq_chip its_irq_chip = { .irq_set_affinity = its_set_affinity, .irq_compose_msi_msg = its_irq_compose_msi_msg, .irq_set_irqchip_state = its_irq_set_irqchip_state, + .irq_retrigger = its_irq_retrigger, .irq_set_vcpu_affinity = its_irq_set_vcpu_affinity, }; From patchwork Mon Aug 24 10:23:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 11732755 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 425D516B1 for ; Mon, 24 Aug 2020 10:24:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1DE33207D3 for ; Mon, 24 Aug 2020 10:24:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598264642; bh=qQLRqcw1hna/ly45S3xl2gW2vdko3+2aJQbithHj/G4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=sqt9hHEH9uGFRSA/PLsuk7XyiHjSWwz7DiIEQZatV5aG8DQTU6O/tEmv9mU/AI7+D 0uj07HwbGmBJyDVBTanmRq81pqJECihZYshxVsVoGsh3sOrUNR/cZC58vjJ42m1YLx kVtkJ/SEz4Qk7xpvrsN8cvMXIBQU5wYK2WW4+bgI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726664AbgHXKX5 (ORCPT ); Mon, 24 Aug 2020 06:23:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:50244 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726531AbgHXKXx (ORCPT ); Mon, 24 Aug 2020 06:23:53 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5138D207D3; Mon, 24 Aug 2020 10:23:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598264633; bh=qQLRqcw1hna/ly45S3xl2gW2vdko3+2aJQbithHj/G4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PsaAJmFc/7WLwZYJnL+pXjeECv3gSO7mWkS5ODgcAbOelXBC3jIZbUQTcH6SrnL/F yCfH35wLPg01Qv2aAqzS2hH/NrNmZjB2AP5BYVq4Jdeixk6ZBOG0bwb05LzXxsUqBf RP2SLsnnZjk/Z7rcqTcUXpHvd/WDuJ+s7MxSJewU= Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kA9dn-006BQc-Px; Mon, 24 Aug 2020 11:23:51 +0100 From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Cc: Bjorn Helgaas , Gregory Clement , Jason Cooper , Laurentiu Tudor , Thomas Gleixner , Valentin Schneider Subject: [PATCH 3/9] PCI/MSI: Provide default retrigger callback Date: Mon, 24 Aug 2020 11:23:11 +0100 Message-Id: <20200824102317.1038259-4-maz@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200824102317.1038259-1-maz@kernel.org> References: <20200824102317.1038259-1-maz@kernel.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, bhelgaas@google.com, gregory.clement@bootlin.com, jason@lakedaemon.net, laurentiu.tudor@nxp.com, tglx@linutronix.de, valentin.schneider@arm.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Signed-off-by: Marc Zyngier Acked-by: Bjorn Helgaas --- drivers/pci/msi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 30ae4ffda5c1..c4d31ce2d951 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c @@ -1446,6 +1446,8 @@ static void pci_msi_domain_update_chip_ops(struct msi_domain_info *info) chip->irq_mask = pci_msi_mask_irq; if (!chip->irq_unmask) chip->irq_unmask = pci_msi_unmask_irq; + if (!chip->irq_retrigger) + chip->irq_retrigger = irq_chip_retrigger_hierarchy; } /** From patchwork Mon Aug 24 10:23:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 11732763 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2425B1510 for ; Mon, 24 Aug 2020 10:24:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0D1962075B for ; Mon, 24 Aug 2020 10:24:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598264663; bh=MZFjgsLYkCgUSZ+eDoB4SWUCZ/E6VZDG7o5MltWKPh4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=xNCrgL5mkC9/XaCVp71xtJz2iVAar4idy9c2vv53MwUW/H01XwXzo37LNzlUWIxDh l1b0tDWmKU7KUS3bZCnAHY+Kro4LylTTdt2JuGGBdNcFOa9U8t8XJBkMlFwnc+XdCf FBepoXAtnFhOm9xxPgMstO283tXIs+8sXzK4R6FE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726719AbgHXKYC (ORCPT ); Mon, 24 Aug 2020 06:24:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:50320 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726024AbgHXKX4 (ORCPT ); Mon, 24 Aug 2020 06:23:56 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 15F7920FC3; Mon, 24 Aug 2020 10:23:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598264636; bh=MZFjgsLYkCgUSZ+eDoB4SWUCZ/E6VZDG7o5MltWKPh4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XwrFuLRs8OANxBLjIe/lPXfhQcBwSje/mZrkMOSAw2NsPnMhEM6+tuokPXzgGWj6M 0o3ymmRezMB8hBexKZVNSSUliP0swAPgbTkFzDcKQ32rpUOcAy+uzoRuRR25rzofW1 /U8w+XPv8sB2ZCccH/j9xeH7HCcUYLPWvDEkuyhg= Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kA9dq-006BQc-DW; Mon, 24 Aug 2020 11:23:54 +0100 From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Cc: Bjorn Helgaas , Gregory Clement , Jason Cooper , Laurentiu Tudor , Thomas Gleixner , Valentin Schneider Subject: [PATCH 4/9] platform-msi: Provide default retrigger callback Date: Mon, 24 Aug 2020 11:23:12 +0100 Message-Id: <20200824102317.1038259-5-maz@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200824102317.1038259-1-maz@kernel.org> References: <20200824102317.1038259-1-maz@kernel.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, bhelgaas@google.com, gregory.clement@bootlin.com, jason@lakedaemon.net, laurentiu.tudor@nxp.com, tglx@linutronix.de, valentin.schneider@arm.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Signed-off-by: Marc Zyngier --- drivers/base/platform-msi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/base/platform-msi.c b/drivers/base/platform-msi.c index c4a17e5edf8b..0a043936b259 100644 --- a/drivers/base/platform-msi.c +++ b/drivers/base/platform-msi.c @@ -101,6 +101,8 @@ static void platform_msi_update_chip_ops(struct msi_domain_info *info) chip->irq_set_affinity = msi_domain_set_affinity; if (!chip->irq_write_msi_msg) chip->irq_write_msi_msg = platform_msi_write_msg; + if (!chip->irq_retrigger) + chip->irq_retrigger = irq_chip_retrigger_hierarchy; if (WARN_ON((info->flags & MSI_FLAG_LEVEL_CAPABLE) && !(chip->flags & IRQCHIP_SUPPORTS_LEVEL_MSI))) info->flags &= ~MSI_FLAG_LEVEL_CAPABLE; From patchwork Mon Aug 24 10:23:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 11732757 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AF5721510 for ; Mon, 24 Aug 2020 10:24:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8A2012075B for ; Mon, 24 Aug 2020 10:24:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598264642; bh=GZdA5HCIlfgbKxXzpIFDaTeBnffKtFhol+GS3YOjvgI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=lg57mPxmGpUeK+nDVl2QyTU1+RcY8waD+DAiW0qt1logosq2N63ueDyv466OjxGsk dh9ySqVK01fR9J0Aj+JCtOd/kO3qHTWfz5bi7yGVQdLauhDDeygU04Mo9IV+05UYNM 0cF+GPfaaBOe+JfxxBeFSiMig6VdmpQvs0ZhTpfQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726709AbgHXKYA (ORCPT ); Mon, 24 Aug 2020 06:24:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:50400 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726635AbgHXKX5 (ORCPT ); Mon, 24 Aug 2020 06:23:57 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A212222B47; Mon, 24 Aug 2020 10:23:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598264636; bh=GZdA5HCIlfgbKxXzpIFDaTeBnffKtFhol+GS3YOjvgI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2FByOjxou4XMr/sefw8Uwt573lXr+Ji0tlM+ZED8MxqIUhRFhoYbQlrq22IsH1Ben dlX4VHMlYfNvYdxfQKWxKTEhNRgAI+XJ/Wc5QHA9y4G1oy+IDYn7Et9W118N2AncJA DMFY1bWdsw8vvXBpCuhpOv+M+NXlhcKvm6hZHZs0= Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kA9dr-006BQc-5Y; Mon, 24 Aug 2020 11:23:55 +0100 From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Cc: Bjorn Helgaas , Gregory Clement , Jason Cooper , Laurentiu Tudor , Thomas Gleixner , Valentin Schneider Subject: [PATCH 5/9] fsl-msi: Provide default retrigger callback Date: Mon, 24 Aug 2020 11:23:13 +0100 Message-Id: <20200824102317.1038259-6-maz@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200824102317.1038259-1-maz@kernel.org> References: <20200824102317.1038259-1-maz@kernel.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, bhelgaas@google.com, gregory.clement@bootlin.com, jason@lakedaemon.net, laurentiu.tudor@nxp.com, tglx@linutronix.de, valentin.schneider@arm.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Signed-off-by: Marc Zyngier --- drivers/bus/fsl-mc/fsl-mc-msi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/bus/fsl-mc/fsl-mc-msi.c b/drivers/bus/fsl-mc/fsl-mc-msi.c index 8edadf05cbb7..5306ba7dea3e 100644 --- a/drivers/bus/fsl-mc/fsl-mc-msi.c +++ b/drivers/bus/fsl-mc/fsl-mc-msi.c @@ -144,6 +144,8 @@ static void fsl_mc_msi_update_chip_ops(struct msi_domain_info *info) */ if (!chip->irq_write_msi_msg) chip->irq_write_msi_msg = fsl_mc_msi_write_msg; + if (!chip->irq_retrigger) + chip->irq_retrigger = irq_chip_retrigger_hierarchy; } /** From patchwork Mon Aug 24 10:23:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 11732767 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EE99F16B1 for ; Mon, 24 Aug 2020 10:24:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CCE7921741 for ; Mon, 24 Aug 2020 10:24:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598264674; bh=sggu6pj/oQ8QePbPrz42wiG5AT6WR9prGNVAkCslxNk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=As1tLmb+AY7qoILClXU0nPCZ2mkOcpkwvBaqZELPOKxXhRX8wfdK9rmc/I1OdTANx tQEaYNdLRsJrmnByIW9o3qb3dLDlVVsdIKYvTOIr6t+0A3Fbi8C2WzKMgVDfV+lEVj 8+pasJDwhEoqAg0ZXPtbhEpSlODHMpgigcCF7dHI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726887AbgHXKYX (ORCPT ); Mon, 24 Aug 2020 06:24:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:50428 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726661AbgHXKX5 (ORCPT ); Mon, 24 Aug 2020 06:23:57 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4117C208E4; Mon, 24 Aug 2020 10:23:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598264637; bh=sggu6pj/oQ8QePbPrz42wiG5AT6WR9prGNVAkCslxNk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KQaDRLWwBXdR8XCUc55k/6hIf/bzMFN1R9QStWUY3umdmN5WbSSkC291L29y82Pph gprxFXog9c0904g8yYeNemapsdEAxI1s4Foq7GUqBrDuEAC/1DkS+1/vli5lLiZ3+N cOcRwrBs2uqJkMsR//PTbaxWcYBBl/sfsbIlSXtY= Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kA9dr-006BQc-OP; Mon, 24 Aug 2020 11:23:55 +0100 From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Cc: Bjorn Helgaas , Gregory Clement , Jason Cooper , Laurentiu Tudor , Thomas Gleixner , Valentin Schneider Subject: [PATCH 6/9] irqchip/mbigen: Use hierarchy retrigger helper Date: Mon, 24 Aug 2020 11:23:14 +0100 Message-Id: <20200824102317.1038259-7-maz@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200824102317.1038259-1-maz@kernel.org> References: <20200824102317.1038259-1-maz@kernel.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, bhelgaas@google.com, gregory.clement@bootlin.com, jason@lakedaemon.net, laurentiu.tudor@nxp.com, tglx@linutronix.de, valentin.schneider@arm.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Signed-off-by: Marc Zyngier --- drivers/irqchip/irq-mbigen.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/irqchip/irq-mbigen.c b/drivers/irqchip/irq-mbigen.c index ff7627b57772..8af35225b46d 100644 --- a/drivers/irqchip/irq-mbigen.c +++ b/drivers/irqchip/irq-mbigen.c @@ -142,6 +142,7 @@ static struct irq_chip mbigen_irq_chip = { .irq_eoi = mbigen_eoi_irq, .irq_set_type = mbigen_set_type, .irq_set_affinity = irq_chip_set_affinity_parent, + .irq_retrigger = irq_chip_retrigger_hierarchy, }; static void mbigen_write_msg(struct msi_desc *desc, struct msi_msg *msg) From patchwork Mon Aug 24 10:23:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 11732765 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 43A371510 for ; Mon, 24 Aug 2020 10:24:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2213220738 for ; Mon, 24 Aug 2020 10:24:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598264664; bh=UPvZFIB7IJHrWz6+r8r9NMtbtlF6iARp2n92VLsqWtk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ESJ9bdqMsOJtf26ShWBtZhYeVKdxdM0EaRtTeVucv4pWquEnfvAsj4VK2HST8JAU/ aQU+fah0UY7Tnhrbel0S/oZ1/g4QOC0hnQ0X7wy1MiOa/a94OaskWD/U5d+gDanF5j JzxSiuX2T1355WHNYCql5MHiCvi/ACaNTC+HXvhs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726026AbgHXKYX (ORCPT ); Mon, 24 Aug 2020 06:24:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:50464 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726666AbgHXKX6 (ORCPT ); Mon, 24 Aug 2020 06:23:58 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D817A20738; Mon, 24 Aug 2020 10:23:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598264638; bh=UPvZFIB7IJHrWz6+r8r9NMtbtlF6iARp2n92VLsqWtk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eJ6A8a03PfAc+c0+LwVBnuIRpRuqTwm2bV0Cqeulef4ZDj0QqEFtKhNsbDtnTGBj0 +iW8mCnueV5gw6EMbyjRaB7oj0FB4IuwsujHEeaQH5xQYSZKZfLTOBnMHEf6NGzaT4 ZD0zOpaLSTxo7NBt9Af/VaTT1qyQbsvh9ML+N9E8= Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kA9ds-006BQc-B0; Mon, 24 Aug 2020 11:23:56 +0100 From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Cc: Bjorn Helgaas , Gregory Clement , Jason Cooper , Laurentiu Tudor , Thomas Gleixner , Valentin Schneider Subject: [PATCH 7/9] irqchip/mvebu-icu: Use hierarchy retrigger helper Date: Mon, 24 Aug 2020 11:23:15 +0100 Message-Id: <20200824102317.1038259-8-maz@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200824102317.1038259-1-maz@kernel.org> References: <20200824102317.1038259-1-maz@kernel.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, bhelgaas@google.com, gregory.clement@bootlin.com, jason@lakedaemon.net, laurentiu.tudor@nxp.com, tglx@linutronix.de, valentin.schneider@arm.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Signed-off-by: Marc Zyngier --- drivers/irqchip/irq-mvebu-icu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/irqchip/irq-mvebu-icu.c b/drivers/irqchip/irq-mvebu-icu.c index 91adf771f185..02f4cc899824 100644 --- a/drivers/irqchip/irq-mvebu-icu.c +++ b/drivers/irqchip/irq-mvebu-icu.c @@ -136,6 +136,7 @@ static struct irq_chip mvebu_icu_nsr_chip = { .irq_eoi = irq_chip_eoi_parent, .irq_set_type = irq_chip_set_type_parent, .irq_set_affinity = irq_chip_set_affinity_parent, + .irq_retrigger = irq_chip_retrigger_hierarchy, }; static struct irq_chip mvebu_icu_sei_chip = { @@ -145,6 +146,7 @@ static struct irq_chip mvebu_icu_sei_chip = { .irq_unmask = irq_chip_unmask_parent, .irq_set_type = irq_chip_set_type_parent, .irq_set_affinity = irq_chip_set_affinity_parent, + .irq_retrigger = irq_chip_retrigger_hierarchy, }; static int From patchwork Mon Aug 24 10:23:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 11732771 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 124FB1510 for ; Mon, 24 Aug 2020 10:24:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E388F20738 for ; Mon, 24 Aug 2020 10:24:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598264677; bh=ZspAYrgKDTmBNHy/ywqplMs3if9rKgSyP7iTSWSHNgY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=cDe0LwnBhoUr26HdnwJ6y8D2xLKA/FAYB0CjAWtT91X05ABJCBAXF0vFNbug8zBL7 6sRmN7ldTanNZicTk8xJvzEjUwdDEBQk8UNhQ42XKP7wnvG21ih9tpw5HNrH+/mvml bGcwYMOGF+7cekbyoLblcT+I1eqObP2QN2W4PPQA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726788AbgHXKYX (ORCPT ); Mon, 24 Aug 2020 06:24:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:50492 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726700AbgHXKX7 (ORCPT ); Mon, 24 Aug 2020 06:23:59 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 739322075B; Mon, 24 Aug 2020 10:23:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598264638; bh=ZspAYrgKDTmBNHy/ywqplMs3if9rKgSyP7iTSWSHNgY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CXq/tFSh10d4vDMd+ALSikOHYrTpsiDB51uTg6Nn2FqMGlUH27FvW+vqS4aAmvgMB 0UQJjd/nqySHqgVtuiKuljYqx0vb8MWop4u0yQ3Woex2LSavoT2mjKlLx3MYUrdxGZ aURtHtVy9mnInPTUZ/h3spL+tmxjH0zi70A3pdXM= Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kA9ds-006BQc-Tj; Mon, 24 Aug 2020 11:23:57 +0100 From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Cc: Bjorn Helgaas , Gregory Clement , Jason Cooper , Laurentiu Tudor , Thomas Gleixner , Valentin Schneider Subject: [PATCH 8/9] irqchip/mvebu-sei: Use hierarchy retrigger helper Date: Mon, 24 Aug 2020 11:23:16 +0100 Message-Id: <20200824102317.1038259-9-maz@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200824102317.1038259-1-maz@kernel.org> References: <20200824102317.1038259-1-maz@kernel.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, bhelgaas@google.com, gregory.clement@bootlin.com, jason@lakedaemon.net, laurentiu.tudor@nxp.com, tglx@linutronix.de, valentin.schneider@arm.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Signed-off-by: Marc Zyngier --- drivers/irqchip/irq-mvebu-sei.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/irqchip/irq-mvebu-sei.c b/drivers/irqchip/irq-mvebu-sei.c index 18832ccc8ff8..4fc258649785 100644 --- a/drivers/irqchip/irq-mvebu-sei.c +++ b/drivers/irqchip/irq-mvebu-sei.c @@ -133,6 +133,7 @@ static struct irq_chip mvebu_sei_ap_irq_chip = { .irq_unmask = irq_chip_unmask_parent, .irq_set_affinity = irq_chip_set_affinity_parent, .irq_set_type = mvebu_sei_ap_set_type, + .irq_retrigger = irq_chip_retrigger_hierarchy, }; static void mvebu_sei_cp_compose_msi_msg(struct irq_data *data, @@ -162,6 +163,7 @@ static struct irq_chip mvebu_sei_cp_irq_chip = { .irq_set_affinity = irq_chip_set_affinity_parent, .irq_set_type = mvebu_sei_cp_set_type, .irq_compose_msi_msg = mvebu_sei_cp_compose_msi_msg, + .irq_retrigger = irq_chip_retrigger_hierarchy, }; static int mvebu_sei_domain_alloc(struct irq_domain *domain, unsigned int virq, From patchwork Mon Aug 24 10:23:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 11732759 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7143E1510 for ; Mon, 24 Aug 2020 10:24:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 58D2B20738 for ; Mon, 24 Aug 2020 10:24:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598264644; bh=qXuDFnBsvXIaArgVMjXhFFyxN3x1ZY0+hd+ygcXKUNU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=YdrapUEWqkiloMVqyoNLdSnBr1nKbHjxOOUXiXJFNjntFFfSrj7cM4DqOW+y2mtg6 3WJIsBqavYyZv4uoVEV4YoOGDRpN6dy3sruJ8u6Xt5AOCUoUc7WyszjanMwdBmgNpd wADXcOOHNXU3ppeFU1KgPCxJ15wv7/iu09RceLTc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726703AbgHXKYC (ORCPT ); Mon, 24 Aug 2020 06:24:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:50518 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726701AbgHXKYA (ORCPT ); Mon, 24 Aug 2020 06:24:00 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 171DA2074D; Mon, 24 Aug 2020 10:23:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598264639; bh=qXuDFnBsvXIaArgVMjXhFFyxN3x1ZY0+hd+ygcXKUNU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iiPJdcFYB44QuROyS9nOXXZBvpQjEwHM5Dtb9Nl7n1WV7lutLIT4F1y/0aHHvfJC9 GdDtt2i3lV3omjn2/uxyStueATytz/2wBAGJPW/12te8miaSPLhTOPcdVSWqaBxlgP +MKvGCv8uOU1O/LwEKUbY8F1om3ICj847ak9W9t4= Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kA9dt-006BQc-H7; Mon, 24 Aug 2020 11:23:57 +0100 From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Cc: Bjorn Helgaas , Gregory Clement , Jason Cooper , Laurentiu Tudor , Thomas Gleixner , Valentin Schneider Subject: [PATCH 9/9] irqchip/gic-v2, v3: Prevent SW resends entirely Date: Mon, 24 Aug 2020 11:23:17 +0100 Message-Id: <20200824102317.1038259-10-maz@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200824102317.1038259-1-maz@kernel.org> References: <20200824102317.1038259-1-maz@kernel.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, bhelgaas@google.com, gregory.clement@bootlin.com, jason@lakedaemon.net, laurentiu.tudor@nxp.com, tglx@linutronix.de, valentin.schneider@arm.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org From: Valentin Schneider The GIC irqchips can now use a HW resend when a retrigger is invoked by check_irq_resend(). However, should the HW resend fail, check_irq_resend() will still attempt to trigger a SW resend, which is still a bad idea for the GICs. Prevent this from happening by setting IRQD_HANDLE_ENFORCE_IRQCTX on all GIC IRQs. Technically per-cpu IRQs do not need this, as their flow handlers never set IRQS_PENDING, but this aligns all IRQs wrt context enforcement: this also forces all GIC IRQ handling to happen in IRQ context (as defined by in_irq()). Signed-off-by: Valentin Schneider Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20200730170321.31228-3-valentin.schneider@arm.com --- drivers/irqchip/irq-gic-v3.c | 5 ++++- drivers/irqchip/irq-gic.c | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index b507bc7c5cda..4e9387aafed8 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -1279,6 +1279,7 @@ static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hw) { struct irq_chip *chip = &gic_chip; + struct irq_data *irqd = irq_desc_get_irq_data(irq_to_desc(irq)); if (static_branch_likely(&supports_deactivate_key)) chip = &gic_eoimode1_chip; @@ -1296,7 +1297,7 @@ static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq, irq_domain_set_info(d, irq, hw, chip, d->host_data, handle_fasteoi_irq, NULL, NULL); irq_set_probe(irq); - irqd_set_single_target(irq_desc_get_irq_data(irq_to_desc(irq))); + irqd_set_single_target(irqd); break; case LPI_RANGE: @@ -1310,6 +1311,8 @@ static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq, return -EPERM; } + /* Prevents SW retriggers which mess up the ACK/EOI ordering */ + irqd_set_handle_enforce_irqctx(irqd); return 0; } diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c index e92ee2b6d7a5..b59bcef69bf3 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c @@ -975,6 +975,7 @@ static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hw) { struct gic_chip_data *gic = d->host_data; + struct irq_data *irqd = irq_desc_get_irq_data(irq_to_desc(irq)); if (hw < 32) { irq_set_percpu_devid(irq); @@ -984,8 +985,11 @@ static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq, irq_domain_set_info(d, irq, hw, &gic->chip, d->host_data, handle_fasteoi_irq, NULL, NULL); irq_set_probe(irq); - irqd_set_single_target(irq_desc_get_irq_data(irq_to_desc(irq))); + irqd_set_single_target(irqd); } + + /* Prevents SW retriggers which mess up the ACK/EOI ordering */ + irqd_set_handle_enforce_irqctx(irqd); return 0; }