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 BDB4FC27C53 for ; Wed, 19 Jun 2024 19:27:37 +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:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=dgFSyZgOIhOuwDDWpfHIYkbx5RhY63kSRD/gtxAhwME=; b=SQAjUgEvxJSFmCl2Rc9BSltjpL BoSCxJ94r7XWgt30DaY18ql0TLnT4l3EnS8S+Rmux9wMoRXUaENLlxGxceBs/a7CD15MT7QbJsC0G ehp7Y+7EWeEnNwd6YBCKLBax/w5/Tum09bFM3keOTJSrqF6712xJVQUZ+WprgdogZpa4qJMmywvk2 WSQtPXhh1JSyHK8cBxQ0t5nj1ySR/0M0gJeFsvLFJ76WeDyVfKwlsOjDyFEe083F0lkJihvCqvAKA emRuptHulghvKrWE4AV9vP869Qm3TuH7GS/768YPTErKFlzHR3qF5ejMLJ2HzOjMWbe3cx7Rxhiw0 u7vMTqGQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sK0xs-00000002WJj-3ah4; Wed, 19 Jun 2024 19:27:28 +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 1sK0xm-00000002WHH-2Ybd for linux-arm-kernel@lists.infradead.org; Wed, 19 Jun 2024 19:27:24 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id D60B8CE21DE; Wed, 19 Jun 2024 19:27:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 002F5C2BBFC; Wed, 19 Jun 2024 19:27:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718825240; bh=HQXZmHzIbpZ60pakJDDw8MACfV7frtkVrmH/tpmKSNM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=mcNFBRM/uvfP8oGm/hNm9yfl14mwRp4blQ70jEiOM50OszJQLr5kCHdLSE3aBiSFR weF4zjKhDvfjz18IzLD7Wo8mqUlC8NysuIPwGsOYHAcZtIIEX206UOZQHG2c1Nwn4Q aNf7N4YoD5KYI8mpnASsKHMjbVJH7BSLDgoQdgfDdHR90Ge+/bvnpu3mgjUFo9bPRP 0qbTTSApfTr8JIoGxZCtJ+4pajSZsmlXjZZsj3377DTYHYBYRzXCmNUf7fnQabv3BD nVFU6jGzz4Y935spgJHWhGsGbNZCEO6zMyQ1phYTua9SORd4mw71lRpM78RxjToP8Q +MogzExhSR9/g== Date: Wed, 19 Jun 2024 21:27:14 +0200 From: Marek =?UTF-8?B?QmVow7pu?= To: Andrew Lunn Cc: Gregory Clement , Sebastian Hesselbarth , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, arm@kernel.org, Andy Shevchenko , Hans de Goede , Ilpo =?UTF-8?B?SsOkcnZpbmVu?= , Pali =?UTF-8?B?Um9ow6Fy?= Subject: Re: [PATCH 2/4] irqchip/armada-370-xp: Exit ipi_resume() early if IPI is not used Message-ID: <20240619212714.27e5b8fd@thinkpad> In-Reply-To: <5c5d74f0-36a5-4835-a0cd-772e1bfc2574@lunn.ch> References: <20240619141134.30900-1-kabel@kernel.org> <20240619141134.30900-3-kabel@kernel.org> <5c5d74f0-36a5-4835-a0cd-772e1bfc2574@lunn.ch> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.41; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240619_122723_232458_9B2588FB X-CRM114-Status: GOOD ( 25.70 ) 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 On Wed, 19 Jun 2024 19:11:44 +0200 Andrew Lunn wrote: > On Wed, Jun 19, 2024 at 04:11:32PM +0200, Marek Beh=C3=BAn wrote: > > From: Pali Roh=C3=A1r > >=20 > > Exit ipi_resume() early if IPI is not used. > >=20 > > IPI is used only on systems where the mpic controller does not have a > > parent GIC IRQ (e.g. on Armada XP). > >=20 > > Signed-off-by: Pali Roh=C3=A1r > > [ changed commit message and moved the code change into ipi_resume() ] > > Signed-off-by: Marek Beh=C3=BAn > > --- > > drivers/irqchip/irq-armada-370-xp.c | 10 ++++++++++ > > 1 file changed, 10 insertions(+) > >=20 > > 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 > > =20 > > +static inline bool is_ipi_available(void) > > +{ > > + /* IPI is used only if we do not have parent irq */ > > + return parent_irq <=3D 0; > > +} > > + > > static inline bool is_percpu_irq(irq_hw_number_t irq) > > { > > if (irq <=3D ARMADA_370_XP_MAX_PER_CPU_IRQS) > > @@ -429,6 +436,9 @@ static void ipi_resume(void) > > { > > int i; > > =20 > > + if (!is_ipi_available()) > > + return; =20 >=20 > But of a nitpick, but it seems odd calling ipi_resume() if it does not > exist. I would prefer >=20 > =20 > if (is_ipi_available()) > ipi_resume(); >=20 > At the two places ipi_resume() is called. That is how it was in the original patch, just hardcoded (there was no is_ipi_available() call, instead it was /* comment */ if (parent_irq <=3D 0) ... I guess I was trying to be smart in deduplicating code, and I got too far the other way. I will fix this in v2. Marek