From patchwork Mon Jul 15 10:51:54 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: 13733320 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 58633C3DA5D for ; Mon, 15 Jul 2024 10:55:41 +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=Fiz76iyxthGD8lyFazZQyC/+upIjMp0g5/Lug4L7ers=; b=kM6CrBhc0cKbKciCOxUc+ax0v8 kJlxl/zWzkh8/qIK8kC7toP/bTE11JneZxaReRA2J7dk01l4c1Aige8XxZ+ilA7xyM3C7Fn0Q/fsS JKq9ubD3PIAs731ShbdN7YlWCdO8V8jbw/xTM4o7Os3pAarr0tOO4WtGTCRy4m/AU4F6uscLviGjx rkD4rJovnL91oFpbZVwThrVgJ6go7ANLJkMIFIJwvAqmYlFZz0lGn0kwy6bSF7s2mU4At5xCIURrS c7mS/DCWFoyzSvQ9Si7pDOswqy7pmmgmqo5TtSs8KwDvy36TgOVKpRC08CBWOfbMkEvoDdLUV68Nm TqmdsdSQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sTJMf-00000006mLf-0F7I; Mon, 15 Jul 2024 10:55:29 +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 1sTJJp-00000006lU9-2K1U for linux-arm-kernel@lists.infradead.org; Mon, 15 Jul 2024 10:52:34 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 0882560EBB; Mon, 15 Jul 2024 10:52:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8AFB6C4AF0E; Mon, 15 Jul 2024 10:52:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721040752; bh=1n3czihuhBZzxRluYcQ3ZKP+cOmNrEajTc3eGyMd/ow=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Oq9SAE9Tr4+ORs4Yi0jDsUdLmJQ8xmkadxSN83U4MGabo7kFb2PNWxFnj0x+/yWk9 cEqXBrIDDkeSPph9XhFhUsMEbZbUgkDeYsaGTmVpLKFx3Kpl5XI+iSQD4YITNe3K5w d/gv07S32UIynt0n3OBQgiu1VN/ikpMf5KM6zFVs4mRQcuJXOkSpUCANyG9jMmBfYI CllvP6VpxT+DPPxLa8HslgeC05GoaLaZrzlZYrbaTx6QlLpGUPKMKUM80zYemfgUJW oomQhMUX9NcXYOXhCfGvXz4hG3ji4ZU7pzKH0MSnIO6r/9wV6+QLenBifDYiJlL9o2 xWtBk6ZnAu2qQ== 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?= Cc: =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH 11/13] irqchip/armada-370-xp: Iterate only valid bits of the per-CPU interrupt cause register Date: Mon, 15 Jul 2024 12:51:54 +0200 Message-ID: <20240715105156.18388-12-kabel@kernel.org> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240715105156.18388-1-kabel@kernel.org> References: <20240715105156.18388-1-kabel@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240715_035233_668840_2FC2AF8D X-CRM114-Status: GOOD ( 12.72 ) 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 Use MPIC_PER_CPU_IRQS_NR (29) bound instead of BITS_PER_LONG (32) when iterating the bits of the per-CPU interrupt cause register, since there are only 29 per-CPU interrupts. The top 3 bits are always zero anyway, so this may save a couple of cycles in the interrupt handler. Signed-off-by: Marek BehĂșn --- drivers/irqchip/irq-armada-370-xp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c index 78d9c7699972..1db9160da20a 100644 --- a/drivers/irqchip/irq-armada-370-xp.c +++ b/drivers/irqchip/irq-armada-370-xp.c @@ -683,7 +683,7 @@ static void mpic_handle_cascade_irq(struct irq_desc *desc) cause = readl_relaxed(mpic->per_cpu + MPIC_PPI_CAUSE); cpuid = cpu_logical_map(smp_processor_id()); - for_each_set_bit(i, &cause, BITS_PER_LONG) { + for_each_set_bit(i, &cause, MPIC_PER_CPU_IRQS_NR) { irqsrc = readl_relaxed(mpic->base + MPIC_INT_SOURCE_CTL(i)); /* Check if the interrupt is not masked on current CPU.