From mboxrd@z Thu Jan 1 00:00:00 1970 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 39246C27C79 for ; Wed, 19 Jun 2024 14:12:18 +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:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=hOFevSG3lEvxJMtW0TzGg6Y79qrHfixEwz1OH57H5PA=; b=EMecO/8nYdMZqYl6vSm41NnXne ubA4wx8bD97YsUksb70iA9FP1M+QUXEUksrKwT3tPJbByFbWguf73LUogMADHiHlaFKqAh7EhXBR8 p4wpMpQVdnI9aoih4ezfJ3DRxr0a3W0Uk6oHaziSLZA6Ff3BJKwNGh3C/dIxfy0f3vyfSGIp3MrUM 3GEN9kpHzZEOcc2HX2hFkvcRfMPNIZYrF1VJGXNSWvaNdCk7XHAHBNY0LHwBGHXPUeR7cWwEaLdlL yIC5r5b4dFNGA5FRYc328uPxkYfIooUrYSsPGBOPq4+X2o5tWgtHKQ5iCD48i/VR8e82K+/xdtNfs 5wcPF/iA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJw2i-00000001SWW-0JLn; Wed, 19 Jun 2024 14:12:08 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJw2R-00000001SOz-2syF for linux-arm-kernel@lists.infradead.org; Wed, 19 Jun 2024 14:11:54 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id A6351CE1FAD; Wed, 19 Jun 2024 14:11:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3CE9C2BBFC; Wed, 19 Jun 2024 14:11:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718806307; bh=IOV8pA+CU/RrS4OraGshOGNPba3K1YZfvxLKxSO4Xss=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FMGJBjoKc++pE0j59cmObQvXnD/0IGLiO91CLSlKpyH39Djj7+ITsLiwD0tEFCEHE 4y1IEqEvCNzUy73mF7JAlH3Fq6EhYRCqjBAOLKnlvUhuElVJSc662xxp2onG6XpMi/ VJrmKsfwNxQSpG3jQyG1Gefh2hmCcRvdbWuumeYcdvrO+/OPskyQc7xJFNtRYUIxkC 9dSju1J02mT0jKYc6FHY5vYW3CxbfTeIFcLmrZAkskUeVYAKbxYHgb5SKfwehlu0jS FOd5domRRplUwXYM5auCy8buAKouZWtH+oXCLM88Mm1vUZ7HnFA1/L4ru+WF1vPqNF aKs3tr7PjDl/A== From: =?UTF-8?q?Marek=20Beh=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=20J=C3=A4rvinen?= Cc: =?UTF-8?q?Pali=20Roh=C3=A1r?= , =?UTF-8?q?Marek=20Beh=C3=BAn?= Subject: [PATCH 3/4] irqchip/armada-370-xp: Do not touch IPI registers on platforms without IPI Date: Wed, 19 Jun 2024 16:11:33 +0200 Message-ID: <20240619141134.30900-4-kabel@kernel.org> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240619141134.30900-1-kabel@kernel.org> References: <20240619141134.30900-1-kabel@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240619_071152_288059_2F0289A3 X-CRM114-Status: GOOD ( 15.73 ) 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 IPI is not available on platforms where MPIC has a parent irq. On these platforms the IPI registers are used as additional set of MSI interrupts (currently unused by the driver). Do not touch these registers if IPI is not available. Signed-off-by: Pali Rohár [ refactored, changed commit message ] Signed-off-by: Marek Behún --- 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 65f21624263e..0097f7dd36e7 100644 --- a/drivers/irqchip/irq-armada-370-xp.c +++ b/drivers/irqchip/irq-armada-370-xp.c @@ -506,6 +506,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); @@ -755,7 +758,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); @@ -805,13 +808,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); -- 2.44.2