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 60739C27C53 for ; Wed, 19 Jun 2024 14:12:05 +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=BqsGJV7ziJRYWU672VmHEezeGO1FWZ50e4TV4YLulWA=; b=pZGuXW4hqr6b5kBWS70Z8CFAuA iy7GsnGGO1HpwRHoK6LHDoRsFSIEZxzfi6fUrC/6BDaja4Ef35yW93MDwhgc2PYesYZQjRFYacmFn BgFMH/5/TH2JWjQMjvxVJubKjVSrOFvRzuQXUmmZc7yi0ZrOb/hbSi3xya/XYxr3zbBUqYO8DM6J/ Tap8JymQfeSwdX4dlIfmHJbanYzO7lT7aFImkTUGODbH0u1sEMHDJxy7QJ7UnaGFf7T4ESE7EV1n3 M/5ichs3qQgN/NlbXEMGPkKqzzO/GQuM9FZgc0psOM7QW/BWaRiI73bNvIK6boKDe/rGej2pbTH4D fliLoCgA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJw2V-00000001SRj-0lVn; Wed, 19 Jun 2024 14:11:55 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJw2M-00000001SMn-2A8T for linux-arm-kernel@lists.infradead.org; Wed, 19 Jun 2024 14:11:48 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 993FD61CDF; Wed, 19 Jun 2024 14:11:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 13DE6C32786; Wed, 19 Jun 2024 14:11:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718806305; bh=kBGr9a9MUg3G0YmfdKHBOVqASqNlFW6ClmDlN9ZGsH0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E1JdzbZoQ2iqPLv9q0386ChyzeVwiRVa9hjd1m5VqGXEjr9tqk+Ort9Hxk+QFi4gM snDzm85gFHzGsOniqm487i8lN09ZJHv53BBRDV98i/sOiYyndUcXuquFjI1N2YQnkf XBLf3TvV6A5qtS6QobMyQaK2N9FqUFnED9bUbMrJ+aagbFkahK2BCfrMgOW2cB4qQR KTnFJX27TP94VqgI5H7HfUtp/lEvTBwCADywF4ztrwNWBD2agI5Pv1YR490UGnhNNq +mPIGLzA9LTbDkF3bLJUfPD4dL2O5nIZDWFSrqfP+3+/ipi0BtUpNfleqYtlYqT8mT FwN65GdOCHbKQ== 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 2/4] irqchip/armada-370-xp: Exit ipi_resume() early if IPI is not used Date: Wed, 19 Jun 2024 16:11:32 +0200 Message-ID: <20240619141134.30900-3-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_071146_688737_812E1BE9 X-CRM114-Status: GOOD ( 13.48 ) 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 Exit ipi_resume() early if IPI is not used. IPI is used only on systems where the mpic controller does not have a parent GIC IRQ (e.g. on Armada XP). Signed-off-by: Pali Rohár [ changed commit message and moved the code change into ipi_resume() ] Signed-off-by: Marek Behún --- drivers/irqchip/irq-armada-370-xp.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c index f488c35d9130..65f21624263e 100644 --- a/drivers/irqchip/irq-armada-370-xp.c +++ b/drivers/irqchip/irq-armada-370-xp.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -156,6 +157,12 @@ static DEFINE_MUTEX(msi_used_lock); static phys_addr_t msi_doorbell_addr; #endif +static inline bool is_ipi_available(void) +{ + /* IPI is used only if we do not have parent irq */ + return parent_irq <= 0; +} + static inline bool is_percpu_irq(irq_hw_number_t irq) { if (irq <= ARMADA_370_XP_MAX_PER_CPU_IRQS) @@ -429,6 +436,9 @@ static void ipi_resume(void) { int i; + if (!is_ipi_available()) + return; + for (i = 0; i < IPI_DOORBELL_END; i++) { int irq; -- 2.44.2