From patchwork Thu Jun 20 07:37:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 13704917 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 26A78C2BA18 for ; Thu, 20 Jun 2024 07:37:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To: From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=6dlKFdQ6efrdTQL7n/pqXsusfdVJGIpgAR2nleO4k00=; b=oRmwwJDFWDfT+NY8AsnRckMxY0 wJhy4g1CFpp+wN6pmjsptraTy0olq3RsnQE9vpMS2ya3rw9nSe4GZnnB11G8q0RATlHVTcZn2ZFCr xdlWRJClwmSV7gyCHnwLNR1k3G3XI5Dcm+dOMqNpWL/tyycQOeNlwkCXrJYLwi3nged5DrhfhXPbF zeM2NYbfl28IqBkIGUttgy9BOuAsLN1c4umuKb20dAaVqNwx0fpmTIJGPMXYQ1Wv5MGVwXkKBrWvX ZiUPI8qcOWvg0FLdzSc8ykwIBHVG9IC2Hz+O8QlUamnQLOBeOw7c+E5wFQpGtns3D/FiVFLLe5KrK PkjX5EmQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sKCMZ-000000040eH-2Mln; Thu, 20 Jun 2024 07:37:43 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sKCMM-000000040ZD-0SMc for linux-arm-kernel@lists.infradead.org; Thu, 20 Jun 2024 07:37:32 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 2780FCE2392; Thu, 20 Jun 2024 07:37:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4FA3FC4AF07; Thu, 20 Jun 2024 07:37:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718869047; bh=dZrLVKTdPiccjRN/nS6wrH8xra7iqcEJWj9cQdWfU3Y=; h=From:To:Subject:Date:In-Reply-To:References:From; b=TwUlI6LUTvgP/4jvAZ6dmmi8D1DxbAhxLigXnM+CPkwMd+6pyOWvtufQlpVEJb0Vg icJiChJ36CT+NTOPXPFYzxZXM8HpfSJh/waGxRuAMJWCAwcUJ8c96+wwb9Ggx3a0Gw hX/ojD8tfcqOaA5uwrl80Oy/3JD7KNSryLOl6Osbx69B39vcjCilOC59z6Z4KJRaHz tZpUlhwfUjtLgy7s+wI16BLTyDbzPA5lBlW2qb7I3xIySInDkP1woIc4d1tu1gvUP+ sUM3B92Zfg4Mqcl5cVc+kxEJOhmb+MUcbXC6jhpzD1vCEgrj/ZTvgkr0qtaBw3YS8k 5smwr+E4EesZA== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, arm@kernel.org, Andy Shevchenko , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH v2 3/4] irqchip/armada-370-xp: Do not touch IPI registers on platforms without IPI Date: Thu, 20 Jun 2024 09:37:14 +0200 Message-ID: <20240620073715.13560-4-kabel@kernel.org> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240620073715.13560-1-kabel@kernel.org> References: <20240620073715.13560-1-kabel@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240620_003730_842982_86742F53 X-CRM114-Status: GOOD ( 14.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Pali Rohár On platforms where IPI is not available in the MPIC, the IPI registers instead represent an additional set of MSI interrupt registers (currently unused by the driver). Do not touch these registers on platforms where IPI is not available in the MPIC. Signed-off-by: Pali Rohár [ refactored, changed commit message ] Signed-off-by: Marek Behún Reviewed-by: Andrew Lunn --- drivers/irqchip/irq-armada-370-xp.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c index ea95e327f672..aca64de4e3f8 100644 --- a/drivers/irqchip/irq-armada-370-xp.c +++ b/drivers/irqchip/irq-armada-370-xp.c @@ -508,6 +508,9 @@ static void armada_xp_mpic_smp_cpu_init(void) for (i = 0; i < nr_irqs; i++) writel(i, per_cpu_int_base + ARMADA_370_XP_INT_SET_MASK_OFFS); + if (!is_ipi_available()) + return; + /* Disable all IPIs */ writel(0, per_cpu_int_base + ARMADA_370_XP_IN_DRBEL_MSK_OFFS); @@ -758,7 +761,7 @@ static void armada_370_xp_mpic_resume(void) /* Reconfigure doorbells for IPIs and MSIs */ writel(doorbell_mask_reg, per_cpu_int_base + ARMADA_370_XP_IN_DRBEL_MSK_OFFS); - if (doorbell_mask_reg & IPI_DOORBELL_MASK) + if (is_ipi_available() && (doorbell_mask_reg & IPI_DOORBELL_MASK)) writel(0, per_cpu_int_base + ARMADA_370_XP_INT_CLEAR_MASK_OFFS); if (doorbell_mask_reg & PCI_MSI_DOORBELL_MASK) writel(1, per_cpu_int_base + ARMADA_370_XP_INT_CLEAR_MASK_OFFS); @@ -809,13 +812,18 @@ static int __init armada_370_xp_mpic_of_init(struct device_node *node, BUG_ON(!armada_370_xp_mpic_domain); irq_domain_update_bus_token(armada_370_xp_mpic_domain, DOMAIN_BUS_WIRED); + /* + * Initialize parent_irq before calling any other functions, since it is + * used to distinguish between IPI and non-IPI platforms. + */ + parent_irq = irq_of_parse_and_map(node, 0); + /* Setup for the boot CPU */ armada_xp_mpic_perf_init(); armada_xp_mpic_smp_cpu_init(); armada_370_xp_msi_init(node, main_int_res.start); - parent_irq = irq_of_parse_and_map(node, 0); if (parent_irq <= 0) { irq_set_default_host(armada_370_xp_mpic_domain); set_handle_irq(armada_370_xp_handle_irq);