From patchwork Thu Jul 11 16:08:58 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: 13730838 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 801FEC3DA49 for ; Thu, 11 Jul 2024 16:09:59 +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=R+Ofa6woHbWPrIniq6hYqo89KID+TX99GpCooXPjX0g=; b=NZG8AxiEwO6kMQ83hiyiJCqLjp x8WMNyhCIX7YTpd+napPYcLi6IY/+DZDGiu1MKLi7C5JK7CORuws6UQ17SqutXrIdS4r1eJq1d8wF LA1DVgQD7ch2yu8vULVQPlC1R99vq/XvypZkJgkPRtXzP1z90UKH/Rl+SaNIGcJcgG4DYbgYoTlVS 3kz2NeC05FtRp7I88hzE+Dc8L5qkiszJANF8Ljz7kMIGSiN3p0Yxorbg3AO11CuwgVJqodlA5dc48 V5ngVKdHojHQOax4uHNLl0Xirw5dFM5HJIdaJKYfHs1TgJDkL1m81H4cb8DZ3kF+esle1Fyl2OW4W lvjJ5jJA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRwMe-0000000Ecrb-0Ftr; Thu, 11 Jul 2024 16:09:48 +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 1sRwM8-0000000EccZ-0Bkx for linux-arm-kernel@lists.infradead.org; Thu, 11 Jul 2024 16:09:17 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 6350461D62; Thu, 11 Jul 2024 16:09:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E58DFC116B1; Thu, 11 Jul 2024 16:09:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720714155; bh=Yhqn8PgtMd6k88iUg8Ydt6hqL7KAalQ4pH8RtPIMvok=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OAaEBR6GPgYyWZigut88XT4lVbMskjse+PnulltCp84+/3Yog2bkUfVpDUmWFJbdU p4g+KnnYM6StmdJSfXhqXxHrXnu63m9nz2ZzR1LfI1zbaZJ7bbsbpsMNq1iBj47uy0 Dy7vm8SCqgIdodleSL+lnVxtX9Y5PkRr16gPhkNS+W89Hr51IojUd+Vf8kiwB8gWpt YZwuloaI4NVNL/r6AkH2JczF7B00g3zItUP+ugryiQSPnOPG/wlT8f4Rx88jCmOR4j RtSQ+UpDPaqkdD5kjzjURLR0Nu2TfquUPc+EaqAd6sXxWEDziHwO4MqAptFGy18BuN Xnllrc9ExmuMg== 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 01/10] irqchip/armada-370-xp: Use consistent variable names for hwirqs Date: Thu, 11 Jul 2024 18:08:58 +0200 Message-ID: <20240711160907.31012-2-kabel@kernel.org> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240711160907.31012-1-kabel@kernel.org> References: <20240711160907.31012-1-kabel@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240711_090916_208204_924E755C X-CRM114-Status: GOOD ( 20.42 ) 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 consistent variable names for hwirqs: when iterating, use "i", otherwise use "hwirq". Signed-off-by: Marek Behún --- drivers/irqchip/irq-armada-370-xp.c | 56 ++++++++++++++--------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c index be1c3721f980..a710a325f81a 100644 --- a/drivers/irqchip/irq-armada-370-xp.c +++ b/drivers/irqchip/irq-armada-370-xp.c @@ -117,7 +117,7 @@ #define MPIC_SW_TRIG_INT 0x04 #define MPIC_INT_SET_ENABLE 0x30 #define MPIC_INT_CLEAR_ENABLE 0x34 -#define MPIC_INT_SOURCE_CTL(irq) (0x100 + (irq) * 4) +#define MPIC_INT_SOURCE_CTL(hwirq) (0x100 + (hwirq) * 4) #define MPIC_INT_SOURCE_CPU_MASK GENMASK(3, 0) #define MPIC_INT_IRQ_FIQ_MASK(cpuid) ((BIT(0) | BIT(8)) << (cpuid)) @@ -199,9 +199,9 @@ static inline unsigned int msi_doorbell_end(void) PCI_MSI_FULL_DOORBELL_END; } -static inline bool mpic_is_percpu_irq(irq_hw_number_t irq) +static inline bool mpic_is_percpu_irq(irq_hw_number_t hwirq) { - return irq <= MPIC_MAX_PER_CPU_IRQS; + return hwirq <= MPIC_MAX_PER_CPU_IRQS; } /* @@ -530,11 +530,11 @@ static void mpic_smp_cpu_init(void) static void mpic_reenable_percpu(void) { /* Re-enable per-CPU interrupts that were enabled before suspend */ - for (unsigned int irq = 0; irq < MPIC_MAX_PER_CPU_IRQS; irq++) { + for (unsigned int i = 0; i < MPIC_MAX_PER_CPU_IRQS; i++) { struct irq_data *data; unsigned int virq; - virq = irq_linear_revmap(mpic_domain, irq); + virq = irq_linear_revmap(mpic_domain, i); if (!virq) continue; @@ -586,20 +586,20 @@ static struct irq_chip mpic_irq_chip = { }; static int mpic_irq_map(struct irq_domain *h, unsigned int virq, - irq_hw_number_t hw) + irq_hw_number_t hwirq) { /* IRQs 0 and 1 cannot be mapped, they are handled internally */ - if (hw <= 1) + if (hwirq <= 1) return -EINVAL; mpic_irq_mask(irq_get_irq_data(virq)); - if (!mpic_is_percpu_irq(hw)) - writel(hw, per_cpu_int_base + MPIC_INT_CLEAR_MASK); + if (!mpic_is_percpu_irq(hwirq)) + writel(hwirq, per_cpu_int_base + MPIC_INT_CLEAR_MASK); else - writel(hw, main_int_base + MPIC_INT_SET_ENABLE); + writel(hwirq, main_int_base + MPIC_INT_SET_ENABLE); irq_set_status_flags(virq, IRQ_LEVEL); - if (mpic_is_percpu_irq(hw)) { + if (mpic_is_percpu_irq(hwirq)) { irq_set_percpu_devid(virq); irq_set_chip_and_handler(virq, &mpic_irq_chip, handle_percpu_devid_irq); @@ -654,15 +654,15 @@ static inline void mpic_handle_ipi_irq(void) {} static void mpic_handle_cascade_irq(struct irq_desc *desc) { struct irq_chip *chip = irq_desc_get_chip(desc); - unsigned long irqmap, irqn, irqsrc, cpuid; + unsigned long irqmap, i, irqsrc, cpuid; chained_irq_enter(chip, desc); irqmap = readl_relaxed(per_cpu_int_base + MPIC_PPI_CAUSE); cpuid = cpu_logical_map(smp_processor_id()); - for_each_set_bit(irqn, &irqmap, BITS_PER_LONG) { - irqsrc = readl_relaxed(main_int_base + MPIC_INT_SOURCE_CTL(irqn)); + for_each_set_bit(i, &irqmap, BITS_PER_LONG) { + irqsrc = readl_relaxed(main_int_base + MPIC_INT_SOURCE_CTL(i)); /* Check if the interrupt is not masked on current CPU. * Test IRQ (0-1) and FIQ (8-9) mask bits. @@ -670,12 +670,12 @@ static void mpic_handle_cascade_irq(struct irq_desc *desc) if (!(irqsrc & MPIC_INT_IRQ_FIQ_MASK(cpuid))) continue; - if (irqn == 0 || irqn == 1) { + if (i == 0 || i == 1) { mpic_handle_msi_irq(); continue; } - generic_handle_domain_irq(mpic_domain, irqn); + generic_handle_domain_irq(mpic_domain, i); } chained_irq_exit(chip, desc); @@ -683,26 +683,26 @@ static void mpic_handle_cascade_irq(struct irq_desc *desc) static void __exception_irq_entry mpic_handle_irq(struct pt_regs *regs) { - u32 irqstat, irqnr; + u32 irqstat, i; do { irqstat = readl_relaxed(per_cpu_int_base + MPIC_CPU_INTACK); - irqnr = FIELD_GET(MPIC_CPU_INTACK_IID_MASK, irqstat); + i = FIELD_GET(MPIC_CPU_INTACK_IID_MASK, irqstat); - if (irqnr > 1022) + if (i > 1022) break; - if (irqnr > 1) { - generic_handle_domain_irq(mpic_domain, irqnr); + if (i > 1) { + generic_handle_domain_irq(mpic_domain, i); continue; } /* MSI handling */ - if (irqnr == 1) + if (i == 1) mpic_handle_msi_irq(); /* IPI Handling */ - if (irqnr == 0) + if (i == 0) mpic_handle_ipi_irq(); } while (1); } @@ -719,24 +719,24 @@ static void mpic_resume(void) bool src0, src1; /* Re-enable interrupts */ - for (irq_hw_number_t irq = 0; irq < mpic_domain->hwirq_max; irq++) { + for (irq_hw_number_t i = 0; i < mpic_domain->hwirq_max; i++) { struct irq_data *data; unsigned int virq; - virq = irq_linear_revmap(mpic_domain, irq); + virq = irq_linear_revmap(mpic_domain, i); if (!virq) continue; data = irq_get_irq_data(virq); - if (!mpic_is_percpu_irq(irq)) { + if (!mpic_is_percpu_irq(i)) { /* Non per-CPU interrupts */ - writel(irq, per_cpu_int_base + MPIC_INT_CLEAR_MASK); + writel(i, per_cpu_int_base + MPIC_INT_CLEAR_MASK); if (!irqd_irq_disabled(data)) mpic_irq_unmask(data); } else { /* Per-CPU interrupts */ - writel(irq, main_int_base + MPIC_INT_SET_ENABLE); + writel(i, main_int_base + MPIC_INT_SET_ENABLE); /* * Re-enable on the current CPU, mpic_reenable_percpu() From patchwork Thu Jul 11 16:08:59 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: 13730839 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 19F15C3DA49 for ; Thu, 11 Jul 2024 16:10:17 +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=j0ymRB3MAJ/0c+oytcVIK9+/4/XL+N4wcXVY2Losd6s=; b=aXOnFx+2l8xqXkXohcnJv5pHjh pQSRC1vS4Mgf0PPni3US8LHeBzRdUJMQTtC5QHlUnJ9Wg4/T7UowxMo/oRWFpNiQjD88DzylcBTgC 9fZjc4sT/jeOFF0rOatl/XkO00Dy4kA8HNQjWp6LmspWejI3GNPfO9o3KCG4LwiL5MZMxUupYBmM3 jq9bbyzj3roJ3lf5z6madKNqPEl+iQeYfN2Hs4vyisZNlPbBLrmpl+YHIf/Qy5iIK8HsjJIgx+RnR HiKTsP+vN8tQxcQVDkl+gBuespOcpN+Qa7KfNNLowWsSu8rueUNSFvMc4iyWcj8qFAf3zyqrtvxQE jtUO+PRQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRwMu-0000000Ecy4-1g4Y; Thu, 11 Jul 2024 16:10:04 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRwMA-0000000Ecdw-2rtX for linux-arm-kernel@lists.infradead.org; Thu, 11 Jul 2024 16:09:20 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 04C7A61D5E; Thu, 11 Jul 2024 16:09:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8556FC116B1; Thu, 11 Jul 2024 16:09:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720714157; bh=mCVsWvkbdGlVMLDOAfZdIuzjEaoIYCco5psOvSAUSEE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VCf659Ny8F7w7f85Sb4ZM7aJXdqh/xHEQ8CcfXA/sQQh3EAPXocnYox7jNYIa59Rh WDPH4J0t18nfpBqHUPBFWyAnCa6zgUzj9LZL1zIoric7mudt89J5sEx23GHK792kAT r+Bu/ynU+4IYjKmI7Zi+fwzBeIqA2EsI1/C55QPG1TWmTRx20NxsVvxZEygbAy3WT+ kT/QxzPGqDee8Pi21/ZbsP1ybAII0tr7UxVgISnXKFvvihl5ruYZg8P9MkBiSDkYfL hi2WVPICuqQhMh74UXUeW1G1h8OCRQ2Z+WU8KzEwWmVrhFh9ULVFhgmIW73Xel25h4 l4ygPPCy+ipPA== 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 02/10] irqchip/armada-370-xp: Use consistent types when iterating interrupts Date: Thu, 11 Jul 2024 18:08:59 +0200 Message-ID: <20240711160907.31012-3-kabel@kernel.org> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240711160907.31012-1-kabel@kernel.org> References: <20240711160907.31012-1-kabel@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240711_090918_897893_7938DF6E X-CRM114-Status: GOOD ( 16.35 ) 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 When iterating, use either the irq_hw_number_t type or the unsigned int type for the iterator variable, depending on whether the variable represents HW IRQ number or whether it is added to a IRQ number. Signed-off-by: Marek Behún --- drivers/irqchip/irq-armada-370-xp.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c index a710a325f81a..27bceb911912 100644 --- a/drivers/irqchip/irq-armada-370-xp.c +++ b/drivers/irqchip/irq-armada-370-xp.c @@ -289,7 +289,7 @@ static int mpic_msi_alloc(struct irq_domain *domain, unsigned int virq, if (hwirq < 0) return -ENOSPC; - for (int i = 0; i < nr_irqs; i++) { + for (unsigned int i = 0; i < nr_irqs; i++) { irq_domain_set_info(domain, virq + i, hwirq + i, &mpic_msi_bottom_irq_chip, domain->host_data, handle_simple_irq, @@ -438,7 +438,7 @@ static struct irq_chip mpic_ipi_irqchip = { static int mpic_ipi_alloc(struct irq_domain *d, unsigned int virq, unsigned int nr_irqs, void *args) { - for (int i = 0; i < nr_irqs; i++) { + for (unsigned int i = 0; i < nr_irqs; i++) { irq_set_percpu_devid(virq + i); irq_domain_set_info(d, virq + i, i, &mpic_ipi_irqchip, d->host_data, handle_percpu_devid_irq, @@ -461,7 +461,7 @@ static const struct irq_domain_ops mpic_ipi_domain_ops = { static void mpic_ipi_resume(void) { - for (int i = 0; i < IPI_DOORBELL_END; i++) { + for (irq_hw_number_t i = 0; i < IPI_DOORBELL_END; i++) { unsigned int virq = irq_find_mapping(mpic_ipi_domain, i); struct irq_data *d; @@ -511,7 +511,7 @@ static int mpic_set_affinity(struct irq_data *d, const struct cpumask *mask_val, static void mpic_smp_cpu_init(void) { - for (int i = 0; i < mpic_domain->hwirq_max; i++) + for (irq_hw_number_t i = 0; i < mpic_domain->hwirq_max; i++) writel(i, per_cpu_int_base + MPIC_INT_SET_MASK); if (!mpic_is_ipi_available()) @@ -530,7 +530,7 @@ static void mpic_smp_cpu_init(void) static void mpic_reenable_percpu(void) { /* Re-enable per-CPU interrupts that were enabled before suspend */ - for (unsigned int i = 0; i < MPIC_MAX_PER_CPU_IRQS; i++) { + for (irq_hw_number_t i = 0; i < MPIC_MAX_PER_CPU_IRQS; i++) { struct irq_data *data; unsigned int virq; @@ -654,7 +654,8 @@ static inline void mpic_handle_ipi_irq(void) {} static void mpic_handle_cascade_irq(struct irq_desc *desc) { struct irq_chip *chip = irq_desc_get_chip(desc); - unsigned long irqmap, i, irqsrc, cpuid; + unsigned long irqmap, irqsrc, cpuid; + irq_hw_number_t i; chained_irq_enter(chip, desc); @@ -683,7 +684,8 @@ static void mpic_handle_cascade_irq(struct irq_desc *desc) static void __exception_irq_entry mpic_handle_irq(struct pt_regs *regs) { - u32 irqstat, i; + irq_hw_number_t i; + u32 irqstat; do { irqstat = readl_relaxed(per_cpu_int_base + MPIC_CPU_INTACK); @@ -799,7 +801,7 @@ static int __init mpic_of_init(struct device_node *node, nr_irqs = FIELD_GET(MPIC_INT_CONTROL_NUMINT_MASK, readl(main_int_base + MPIC_INT_CONTROL)); - for (int i = 0; i < nr_irqs; i++) + for (irq_hw_number_t i = 0; i < nr_irqs; i++) writel(i, main_int_base + MPIC_INT_CLEAR_ENABLE); mpic_domain = irq_domain_add_linear(node, nr_irqs, &mpic_irq_ops, NULL); From patchwork Thu Jul 11 16:09:00 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: 13730840 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 6FBFAC3DA49 for ; Thu, 11 Jul 2024 16:10:31 +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=rUrgzEKtq3R0UgZi/UDrBmpUssxEVYmozTfcdDYBotk=; b=cm0G/Z09veMvXqLXuWTzv1ntDs chRlbzfCc2ItmZz0uv+e26LBCW8MzYNrDS0imG/cyuO0s7iXHZgrOuEcbW2046ZBXry4YNvobo0K5 qMEIAGzaWWrzKNmt1HVUw32872NsljEfrnhJHEdfkoyKc3fZS8D9awfNwb0+zmFi6U73rkAT3AKyP ZU5aGNrzx/LM1a2VVNv4HmDN0zRvBRAhsTdlCfq/0CV7ZxTAEbZjuNjrz2qpCu60soOnJBA28777N ZffuJCUFHKi9YDWpZWrjWm3o8Vb0xVpG+M4RA7INmc71xSFvRnU9dWgr7LNYr9Xd4KG0OBTe+FwAV mDWhwLVA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRwN9-0000000Ed57-2xHH; Thu, 11 Jul 2024 16:10:20 +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 1sRwME-0000000EcfM-3Gpf for linux-arm-kernel@lists.infradead.org; Thu, 11 Jul 2024 16:09:24 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 233B7CE191B; Thu, 11 Jul 2024 16:09:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25587C32786; Thu, 11 Jul 2024 16:09:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720714160; bh=iNnk8+XxOxkgDvKPldSQOmW8lN0yd3LDKWHE1mK8h+o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CLUToDytUESEbo58qLSmSVo+abwJXz3p615ksgcEmZVzIM/ELmJRSMq+kQt+CM9uU y85RqItGilyO7grNaVR7846Z38p1lCDEzulB9ULW3SidcJFUml2aP0dPSE99PT8kYd C007KqockGsAYYycGjwTceiFVo7hyZI/euQoe/pK2Tw7g/hfr42+xE2kEYqIxK6tBq qnhb7tn3IYQ5GFRjkXRNhu40SbbN/Z3EIuIXrqbMS3SL1Qs/dJFJEBQ+H4JdczAj7M MyWKKU3oYXb8B7ol+dTwevjmWEuA1p/MYiU7OWguGuVCeN3rwFy5kIBu5haPtBFc1p t4tWgXvvM6aVA== 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 03/10] irqchip/armada-370-xp: Use consistent name for struct irq_data variables Date: Thu, 11 Jul 2024 18:09:00 +0200 Message-ID: <20240711160907.31012-4-kabel@kernel.org> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240711160907.31012-1-kabel@kernel.org> References: <20240711160907.31012-1-kabel@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240711_090923_187608_6695B557 X-CRM114-Status: GOOD ( 15.02 ) 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 Always use variable name "d" for struct irq_data *, for consistency. Signed-off-by: Marek Behún --- drivers/irqchip/irq-armada-370-xp.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c index 27bceb911912..9e4fc91fe422 100644 --- a/drivers/irqchip/irq-armada-370-xp.c +++ b/drivers/irqchip/irq-armada-370-xp.c @@ -243,17 +243,17 @@ static struct msi_domain_info mpic_msi_domain_info = { .chip = &mpic_msi_irq_chip, }; -static void mpic_compose_msi_msg(struct irq_data *data, struct msi_msg *msg) +static void mpic_compose_msi_msg(struct irq_data *d, struct msi_msg *msg) { - unsigned int cpu = cpumask_first(irq_data_get_effective_affinity_mask(data)); + unsigned int cpu = cpumask_first(irq_data_get_effective_affinity_mask(d)); msg->address_lo = lower_32_bits(msi_doorbell_addr); msg->address_hi = upper_32_bits(msi_doorbell_addr); - msg->data = BIT(cpu + 8) | (data->hwirq + msi_doorbell_start()); + msg->data = BIT(cpu + 8) | (d->hwirq + msi_doorbell_start()); } -static int mpic_msi_set_affinity(struct irq_data *irq_data, - const struct cpumask *mask, bool force) +static int mpic_msi_set_affinity(struct irq_data *d, const struct cpumask *mask, + bool force) { unsigned int cpu; @@ -265,7 +265,7 @@ static int mpic_msi_set_affinity(struct irq_data *irq_data, if (cpu >= nr_cpu_ids) return -EINVAL; - irq_data_update_effective_affinity(irq_data, cpumask_of(cpu)); + irq_data_update_effective_affinity(d, cpumask_of(cpu)); return IRQ_SET_MASK_OK; } @@ -531,19 +531,19 @@ static void mpic_reenable_percpu(void) { /* Re-enable per-CPU interrupts that were enabled before suspend */ for (irq_hw_number_t i = 0; i < MPIC_MAX_PER_CPU_IRQS; i++) { - struct irq_data *data; + struct irq_data *d; unsigned int virq; virq = irq_linear_revmap(mpic_domain, i); if (!virq) continue; - data = irq_get_irq_data(virq); + d = irq_get_irq_data(virq); if (!irq_percpu_is_enabled(virq)) continue; - mpic_irq_unmask(data); + mpic_irq_unmask(d); } if (mpic_is_ipi_available()) @@ -722,20 +722,20 @@ static void mpic_resume(void) /* Re-enable interrupts */ for (irq_hw_number_t i = 0; i < mpic_domain->hwirq_max; i++) { - struct irq_data *data; + struct irq_data *d; unsigned int virq; virq = irq_linear_revmap(mpic_domain, i); if (!virq) continue; - data = irq_get_irq_data(virq); + d = irq_get_irq_data(virq); if (!mpic_is_percpu_irq(i)) { /* Non per-CPU interrupts */ writel(i, per_cpu_int_base + MPIC_INT_CLEAR_MASK); - if (!irqd_irq_disabled(data)) - mpic_irq_unmask(data); + if (!irqd_irq_disabled(d)) + mpic_irq_unmask(d); } else { /* Per-CPU interrupts */ writel(i, main_int_base + MPIC_INT_SET_ENABLE); @@ -745,7 +745,7 @@ static void mpic_resume(void) * will take care of secondary CPUs when they come up. */ if (irq_percpu_is_enabled(virq)) - mpic_irq_unmask(data); + mpic_irq_unmask(d); } } From patchwork Thu Jul 11 16:09:01 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: 13730841 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 ECCA7C3DA45 for ; Thu, 11 Jul 2024 16:10: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: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=jA4Lorces5G5tvjcmQFJi1TQJkjONPBEqOMcqE4BIm0=; b=bqAZxNXyjjqzXcxX1caplPNPiN lCS0AJlNMCPRfgkYknynWQNA2K6QyZhH4ch50yp/BwKz2fXscFh1b6a1SeC8KX2mhk5G+fqmrgdMR rQKX1ADwFpxEn2SzQ/umqShGUzq4r+zCfPY3i8gAAet7suKb6m/ORfx+RwpgjJW5AkIZKgb3H6XTc Kjvda2/ZwrTzpAnZYVLnCUERHlD8TgyxCPBk7LEantmbeRm4hXHhneQd50yEORIXdW8gmvnz4QODY iQxbUcFCzk1Ylhju3pthg1T9Xglgeltf35P5lKvTYvjENYMb0iwQT793N5E562kFxFiiglIT5opIa mQEFiQcQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRwNP-0000000EdDD-3sbt; Thu, 11 Jul 2024 16:10:35 +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 1sRwMH-0000000Ecfy-1eE7 for linux-arm-kernel@lists.infradead.org; Thu, 11 Jul 2024 16:09:26 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id B9F19CE1927; Thu, 11 Jul 2024 16:09:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BA398C4AF0B; Thu, 11 Jul 2024 16:09:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720714162; bh=gu20sIw0sAsumDGSOtVxTeoFhNXSvRH1Qmhre3Zy49E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u6n10tOcVy7iyyDaSrQhH11Q0ZWMCtByWMNqGbxEWsu1/iQy2l0DDy4moHWpDXy93 Xoz+lSrkNp1WSEXmbGe3d1MpVD9ptRL7GqIIYtTSULQ2FQsfcWgHdrsOq9RALcQBU5 sxTFQYrvYgUlcriOfElLqvbv5bve3vcy6ALXcYyWu9sSnYyLRnCbZbcjkz1cIvrDMa Wegs62WTkl5KXkhwOe7HxmlokyClVoC1QFBfhW60EdYQGF/vaJATvR1wR5cWrwMz9z UnHxats/TMLQ2kI67y+K0W7+sKyrVkDcsdUtujoOD/giWssXq8XNlh3yisDYMDRJVS MBkd0v1hQU4lw== 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 04/10] irqchip/armada-370-xp: Simplify mpic_reenable_percpu() and mpic_resume() Date: Thu, 11 Jul 2024 18:09:01 +0200 Message-ID: <20240711160907.31012-5-kabel@kernel.org> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240711160907.31012-1-kabel@kernel.org> References: <20240711160907.31012-1-kabel@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240711_090925_656931_BEE36530 X-CRM114-Status: GOOD ( 11.71 ) 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 Refactor the mpic_reenable_percpu() and mpic_resume() functions to make them a little bit simpler. Signed-off-by: Marek Behún --- drivers/irqchip/irq-armada-370-xp.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c index 9e4fc91fe422..3fc669cfd494 100644 --- a/drivers/irqchip/irq-armada-370-xp.c +++ b/drivers/irqchip/irq-armada-370-xp.c @@ -531,18 +531,13 @@ static void mpic_reenable_percpu(void) { /* Re-enable per-CPU interrupts that were enabled before suspend */ for (irq_hw_number_t i = 0; i < MPIC_MAX_PER_CPU_IRQS; i++) { + unsigned int virq = irq_linear_revmap(mpic_domain, i); struct irq_data *d; - unsigned int virq; - virq = irq_linear_revmap(mpic_domain, i); - if (!virq) + if (!virq || !irq_percpu_is_enabled(virq)) continue; d = irq_get_irq_data(virq); - - if (!irq_percpu_is_enabled(virq)) - continue; - mpic_irq_unmask(d); } @@ -722,10 +717,9 @@ static void mpic_resume(void) /* Re-enable interrupts */ for (irq_hw_number_t i = 0; i < mpic_domain->hwirq_max; i++) { + unsigned int virq = irq_linear_revmap(mpic_domain, i); struct irq_data *d; - unsigned int virq; - virq = irq_linear_revmap(mpic_domain, i); if (!virq) continue; From patchwork Thu Jul 11 16:09:02 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: 13730842 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 D4C5CC3DA45 for ; Thu, 11 Jul 2024 16:11:00 +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=we8Xy2P02dia0143QbV+/M1Ta6pEF2gHua8A9eOrFFg=; b=govupETECK8JC4hnGklR9NnKod 5c2vvQ24mZ2jpQ+i1f9h1ZfqUqZfTzWkL51J1q+pMlZNBS3sAc909DnH2CY4vWoj55lSKVWLmBoAN F6ihjIP+LW5qI+WCnNP00sFS7UeBhOgjswX6hKOZ/prtDEXVDukdeIruoBwbQ6qJwSCKP8pa0+odw VZnx8Z/vxqxDaDQMPGf6LGpj8KNPJzmx26yeqfIMquEJNwVxIdbq0ezCsj6uiHXaKNAc5dvkOyFN0 B6kNYsUVrVTIwUuHaZHrKEwW6lfRNMBe3KZIHdvRSmYbONBRzZWPeNWbIS91BKCjqhu+eOuZ86WzT H6IyHZ5w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRwNf-0000000EdIz-3Wrj; Thu, 11 Jul 2024 16:10:51 +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 1sRwMJ-0000000Echg-3u1A for linux-arm-kernel@lists.infradead.org; Thu, 11 Jul 2024 16:09:29 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 4CEABCE191B; Thu, 11 Jul 2024 16:09:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5A5B5C4AF09; Thu, 11 Jul 2024 16:09:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720714165; bh=K5oYkbQbLa9UcV/R6htueBx8aGubNNzhgbszoB7BIcs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KH8VL8VkytSyao+14sON5Aagl8pnR2fFfNcg3nNzZpJYaCVz5kVNLhwVNhQXIetRw eU2XfgHoCzawF1OSvGgA/sKKneD8kgccbJTRy3ssGd7Wv3/XsXFZFMEg8+xtbUIJ1E XSa8ytFDBTCFwY/4XZqme1WYKEDM0yFu+1EDkFyI1MPEtq+6+wepzbTQdQ3534ZZMn Oskjh5AWqWZHTAsgVSXhMcjQQcw3sCLtrzrgrI+JrF5p6Dgl3fOYL8r0zRY1eH6b/N RSdO4Bme8UqUThkWWYzZo4Q0JCiS4YKeKSOCgg37vgO/W1yPKeiLbWI0v+zdY58A70 sJV467oFJunOg== 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 05/10] irqchip/armada-370-xp: Drop unneeded curly brackets Date: Thu, 11 Jul 2024 18:09:02 +0200 Message-ID: <20240711160907.31012-6-kabel@kernel.org> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240711160907.31012-1-kabel@kernel.org> References: <20240711160907.31012-1-kabel@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240711_090928_174849_B8F75FCF X-CRM114-Status: GOOD ( 11.04 ) 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 Drop unneeded curly brackets in mpic_msi_alloc(). Signed-off-by: Marek Behún --- drivers/irqchip/irq-armada-370-xp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c index 3fc669cfd494..3d4f32f340f6 100644 --- a/drivers/irqchip/irq-armada-370-xp.c +++ b/drivers/irqchip/irq-armada-370-xp.c @@ -289,12 +289,11 @@ static int mpic_msi_alloc(struct irq_domain *domain, unsigned int virq, if (hwirq < 0) return -ENOSPC; - for (unsigned int i = 0; i < nr_irqs; i++) { + for (unsigned int i = 0; i < nr_irqs; i++) irq_domain_set_info(domain, virq + i, hwirq + i, &mpic_msi_bottom_irq_chip, domain->host_data, handle_simple_irq, NULL, NULL); - } return 0; } From patchwork Thu Jul 11 16:09:03 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: 13730843 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 D1C57C3DA45 for ; Thu, 11 Jul 2024 16:11:19 +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=TVSUjsfQXyKcRvF/d1HpkjjG4gBwykUrZcFgVAus7eY=; b=vygGA443mdlwz7c1AuGhftvR+s p0JU/OKvdtoyy4Lv1Hb7fV4J9sWoZCQmAs/O4ihvjNJkhHwvJ4VfzbUXP+myGgpnrAv84d0NfW9TQ zlckJZuEa/h8EoDG8a2DP49qXOP0DFBAS3jFcrkXe/ls4bHWfIFxRnzpoUHqURauJFumiK2D8mNEH f4n4QY144OF2QCnLQhFBuUapD7usQFPGRLK08xmYkfto1344yggu8GH8SaAQUqej96PiMYs+dEqOk FLpxQsaJreeif/7vk5Ah5xcMlkNeIqPxXUA9MOWrikdYms+u7quyZBM4Pl0MG6sUcs1AFwoGuRR5+ 6FCT9cmw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRwNv-0000000EdP3-0fY4; Thu, 11 Jul 2024 16:11:07 +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 1sRwMM-0000000EcjE-32Pv for linux-arm-kernel@lists.infradead.org; Thu, 11 Jul 2024 16:09:32 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id F1824CE17E3; Thu, 11 Jul 2024 16:09:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF595C4AF07; Thu, 11 Jul 2024 16:09:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720714168; bh=lSODCFznkq3J4DlldpZPTg2NXwbeoeA3V3C+o4D4YrI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q0377hzNU6OwpDcP67iHqp1ah8ESKtZcXINti57UNA18FoSc9DP9g7FKzBw5XEgxy dmtqWqtANQLACpZfJUzbRTKD7x2BzR21KIvwVqLzEHFU3OrUOBBhFbxuNmairsH79a CIJZdWG+g8ovKAD9wx/pfXYcwRBQ5sD3ik9eV3Y0wvHUUcPDQO00G6hEXhzNpozPMK TIyU5kH+z5/ip9zaeziQQIvIU0DEaI2td5ZlZjIkBUQpELKHcck7wfdz0ePg5Wixx4 Xq8HWNhPn9vxCkp5zLIUZuMLRDBHFcy/RK6AVw3e9Uii3wDEBEq/JRX2A1L/y0FFjr Wpso56Ws9KoRA== 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 06/10] irqchip/armada-370-xp: Drop redundant continue Date: Thu, 11 Jul 2024 18:09:03 +0200 Message-ID: <20240711160907.31012-7-kabel@kernel.org> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240711160907.31012-1-kabel@kernel.org> References: <20240711160907.31012-1-kabel@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240711_090930_961477_CB771474 X-CRM114-Status: UNSURE ( 9.80 ) X-CRM114-Notice: Please train this message. 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 Drop redundant continue from mpic_handle_irq(). Signed-off-by: Marek Behún --- drivers/irqchip/irq-armada-370-xp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c index 3d4f32f340f6..5f8bb693a0b1 100644 --- a/drivers/irqchip/irq-armada-370-xp.c +++ b/drivers/irqchip/irq-armada-370-xp.c @@ -688,10 +688,8 @@ static void __exception_irq_entry mpic_handle_irq(struct pt_regs *regs) if (i > 1022) break; - if (i > 1) { + if (i > 1) generic_handle_domain_irq(mpic_domain, i); - continue; - } /* MSI handling */ if (i == 1) From patchwork Thu Jul 11 16:09:04 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: 13730844 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 8E212C3DA45 for ; Thu, 11 Jul 2024 16:11:31 +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=RchFNrrsOeUdisuF9G8k0TL4L75OZKmWP+Iu1tONN+k=; b=PJ5EIKdl5e3yyz8g9zqozjMWW+ V5Iatbblt9334BCX1cjDIoWSilRIL6QUUF6DlGgWojN+QkoIBgt3uwRfA75zwDM5kZLvlLI/mNHCO jJuOYS/MhI4d3XPbJkP7vLQjyGq7ap+HE4Ew5lDoxL+kM6VRx4HAp/iSMe3KhiAz4i5ae6lM/SUzx PXBRjh4uCUNUrQn6rs6hks0MOdGZvq+PhqudXmymA10bC60Q5Sa/pYcYms0QOxKs9FXzG95YNB8nA LY9NLqo31qzUxkoTJZi/XkkneFo9Nv94d6PzCLSh3hmElXw4LUa+Kqs3eZ0zwbOHVW0QbUKgwq/7c B8t6ZtFA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRwOA-0000000EdUd-2iYZ; Thu, 11 Jul 2024 16:11:22 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRwMN-0000000Ecjz-3Bmp for linux-arm-kernel@lists.infradead.org; Thu, 11 Jul 2024 16:09:33 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 1845361CC4; Thu, 11 Jul 2024 16:09:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 99471C32786; Thu, 11 Jul 2024 16:09:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720714170; bh=F8F5Cp/PAHsHjQGF5lCpGnenX3KIpTLb90GG1/RZ1y0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cIXKCGEaGT09SuNumcIUNz1tbSjmSF7+BAnt4iUXjwUBWYIVjJ+USKsm5nq76GoVQ s45kPObleY9YDB22L6rNrIp/YuFqnOkKFpFwVgVnZQp6/whphSE5LKVqkI3GDO68Fm kdnqF23q0h+YF5p6mallEDtVkk3lnkUVQ9S3ZiNsHETODv4kTT80dekjHM534QDqTy 7SSiFE7SzXHjfvb+oICKRSGb7wdA5IH3BJ2VCT8OlY9VOYdIYChu/AGvH0Tz7NAQZ7 r8C2VUxPW50LM2CkHccpOpkiZZ2xiWY6j4FoH9xiEvsIHs28FV/6e1FFiEr3CD3bya ypbER/gb6nQqQ== 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 07/10] irqchip/armada-370-xp: Rename variable for consistency Date: Thu, 11 Jul 2024 18:09:04 +0200 Message-ID: <20240711160907.31012-8-kabel@kernel.org> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240711160907.31012-1-kabel@kernel.org> References: <20240711160907.31012-1-kabel@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240711_090931_889680_B5BDC787 X-CRM114-Status: GOOD ( 11.97 ) 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 Rename the variable holding the cause register to "cause" in mpic_handle_cascade_irq(). Signed-off-by: Marek Behún --- drivers/irqchip/irq-armada-370-xp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c index 5f8bb693a0b1..2021b7e47a93 100644 --- a/drivers/irqchip/irq-armada-370-xp.c +++ b/drivers/irqchip/irq-armada-370-xp.c @@ -648,15 +648,15 @@ static inline void mpic_handle_ipi_irq(void) {} static void mpic_handle_cascade_irq(struct irq_desc *desc) { struct irq_chip *chip = irq_desc_get_chip(desc); - unsigned long irqmap, irqsrc, cpuid; + unsigned long cause, irqsrc, cpuid; irq_hw_number_t i; chained_irq_enter(chip, desc); - irqmap = readl_relaxed(per_cpu_int_base + MPIC_PPI_CAUSE); + cause = readl_relaxed(per_cpu_int_base + MPIC_PPI_CAUSE); cpuid = cpu_logical_map(smp_processor_id()); - for_each_set_bit(i, &irqmap, BITS_PER_LONG) { + for_each_set_bit(i, &cause, BITS_PER_LONG) { irqsrc = readl_relaxed(main_int_base + MPIC_INT_SOURCE_CTL(i)); /* Check if the interrupt is not masked on current CPU. From patchwork Thu Jul 11 16:09:05 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: 13730845 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 3119CC3DA45 for ; Thu, 11 Jul 2024 16:11:50 +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=dwunz+2YYHpIwhTpOY8Cb9QXleywbmzBBJ9cSgyW0CI=; b=iinEpD0TMRa92Kw6o2IKVLkiro YAIjkERPBdvmz8g1ASHq7pXEh1IMAictVQpdW0aPtpREFV6xSahn2NFXWejEzEepyjwuI0sh5Cw6y l8DEOvAFX3opLL6Gv0hsKyiSSV6j/ZoamSTDzhlgILj8AnaKYvwBC77CJKFKQSiHn9Hkkw/xypTo+ dELRU8YrHKCWMUFqbjm2YBwXF+v0Fp3x/IK0cjQ3ThLrOpoRilyYSCZBq1wedgP57SQxtvTQlcLVr fGgD72HvzeuXpj+IpIKOSHwrSXw00D9Hqo1XW62RyrlJdg67JGkP4bF9Ixa+sH6PqbRlm2754nAN7 1ABsyNvg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRwOP-0000000EdaX-3qdt; Thu, 11 Jul 2024 16:11:37 +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 1sRwMR-0000000Ecle-3UtS for linux-arm-kernel@lists.infradead.org; Thu, 11 Jul 2024 16:09:37 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 3769ACE0E77; Thu, 11 Jul 2024 16:09:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3A860C32786; Thu, 11 Jul 2024 16:09:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720714173; bh=acyKlHBZhYxlowH8omCW+TK7I7gwGCSaajYh38zuPlk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MpYv0P81fxUYqQmTe4Iq7yaMT0HC9YtY6NKdH7LWw739b7VxydLe+Q+ZpdvE0WaJy LlblZi+oSMeYxtOMU1Pu+iUhMCsADdD81qPhM8p5kry9DeuNnRUF+r+s5SUj9cdEga +qlI69Nvi/sxbNKtfwsEWYaAUDr8Z/0MKoNJ/drJUW3nvf+NTf+owP9Ikwt4/KAbDG xra0Uy0DH3XE6HcFARV1jF4w8aioDqY8XCGGjYJ7HpJOPzmxy1gYeosW6cB9kJPahP 8Cca854+axy00fTJORSNviHOvq1DQaTmPIXStYgwSaj5BwuHJPdxhwyridkIcb1b23 at6u7fHelcR4g== 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 08/10] irqchip/armada-370-xp: Use u32 type instead of unsigned long where possieble Date: Thu, 11 Jul 2024 18:09:05 +0200 Message-ID: <20240711160907.31012-9-kabel@kernel.org> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240711160907.31012-1-kabel@kernel.org> References: <20240711160907.31012-1-kabel@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240711_090936_073128_1162D415 X-CRM114-Status: GOOD ( 12.28 ) 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 For consistency across the driver, use the u32 type instead of unsigned long for holding register values and return value of cpu_logical_map(). One exception is when the variable is referenced for passing into for_each_set_bit(), in which case it has to be unsigned long. Signed-off-by: Marek Behún --- drivers/irqchip/irq-armada-370-xp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c index 2021b7e47a93..2c8272fe7150 100644 --- a/drivers/irqchip/irq-armada-370-xp.c +++ b/drivers/irqchip/irq-armada-370-xp.c @@ -365,7 +365,7 @@ static inline int mpic_msi_init(struct device_node *node, static void mpic_perf_init(void) { - unsigned long cpuid; + u32 cpuid; /* * This Performance Counter Overflow interrupt is specific for @@ -404,8 +404,8 @@ static void mpic_ipi_unmask(struct irq_data *d) static void mpic_ipi_send_mask(struct irq_data *d, const struct cpumask *mask) { - unsigned long map = 0; unsigned int cpu; + u32 map = 0; /* Convert our logical CPU mask into a physical one. */ for_each_cpu(cpu, mask) @@ -648,7 +648,8 @@ static inline void mpic_handle_ipi_irq(void) {} static void mpic_handle_cascade_irq(struct irq_desc *desc) { struct irq_chip *chip = irq_desc_get_chip(desc); - unsigned long cause, irqsrc, cpuid; + unsigned long cause; + u32 irqsrc, cpuid; irq_hw_number_t i; chained_irq_enter(chip, desc); From patchwork Thu Jul 11 16:09:06 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: 13730846 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 896F0C3DA45 for ; Thu, 11 Jul 2024 16: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=wQhdapamluBAfc8XGnRa3MW4EtqflamJ15me40OhWOo=; b=T9ex5qURUpTxqNF1RH5cbtLatS cT5Y12wrENRxVcaR+LL/+otCOmdSTCBTy0lDT5gZoFP1fOswcM4m6uwd63V9GgSaCp6BWtSZbpkP2 OQhhr6cgH9WuDxd2iGopPq9hgfL7km+0k/2VP3JwPeoZ0MvWi6Kozm6eGZi7F7f9LcUIDd7ZiWZVX 9XEzZfQBQzuE3v+wmjyMiD1Nzdc0iPhGwqSNFefLGJ8ZMLid/nCGqwxMwHL5r7RvHTidifm6lmCmH 9SWRDUrEA5eBj3pKca3UccIySExeh2H09TkWDHQidVUyiAOYe2zHI3A8dpTqyhoey0U4mGB8/exlg poPnugsw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRwOg-0000000EdjC-0dcE; Thu, 11 Jul 2024 16:11:54 +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 1sRwMS-0000000EcmW-3PTf for linux-arm-kernel@lists.infradead.org; Thu, 11 Jul 2024 16:09:38 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 5231D61D61; Thu, 11 Jul 2024 16:09:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CF03DC4AF07; Thu, 11 Jul 2024 16:09:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720714176; bh=csVsCA8RqdrodTpKAa/5SnRiGJhJusByv19pah2IBYk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b+hAy3UtSa9zUr2w3XXR58383a7qe3EunqE7I61rHQaO1jBgOKWpUyApF9cFllQcc cFyrTOKkCIEsB9u5fChgZhxOPwV15q41w/mN/UJE9TNmOTx8imhbfN3GBlV9TnIp2q ibHaGp57UYTAlM4RHfO10bUrtoF9vMgFsYNTFTkKenL/kJcC6nXiFUGFJ8f+Uxjchm zfuPKYj8G56qpi6LMIqTICBJHJngKz8Ibr/mA/beUqwFMnvp47g2UWThKy58y3gSiX rYi422bjF71i05HmgBZV2O1C+W7+9Oh5pXCB42bWwvvLHUqSixtuQFTrudtripWC0T CatgMNXfmF/6A== 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 09/10] irqchip/armada-370-xp: Refactor initial memory regions mapping Date: Thu, 11 Jul 2024 18:09:06 +0200 Message-ID: <20240711160907.31012-10-kabel@kernel.org> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240711160907.31012-1-kabel@kernel.org> References: <20240711160907.31012-1-kabel@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240711_090936_960807_57FEB23B X-CRM114-Status: GOOD ( 16.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 Refactor the initial memory regions mapping: - put into its own function - return error numbers on failure - use WARN_ON() instead of BUG_ON() Signed-off-by: Marek Behún --- drivers/irqchip/irq-armada-370-xp.c | 62 ++++++++++++++++++++--------- 1 file changed, 44 insertions(+), 18 deletions(-) diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c index 2c8272fe7150..dccc69aa2bf4 100644 --- a/drivers/irqchip/irq-armada-370-xp.c +++ b/drivers/irqchip/irq-armada-370-xp.c @@ -12,6 +12,7 @@ #include #include +#include #include #include #include @@ -766,29 +767,54 @@ static struct syscore_ops mpic_syscore_ops = { .resume = mpic_resume, }; +static int __init mpic_map_region(struct device_node *np, int index, + void __iomem **base, phys_addr_t *phys_base) +{ + struct resource res; + int err; + + err = of_address_to_resource(np, index, &res); + if (WARN_ON(err)) + goto fail; + + if (WARN_ON(!request_mem_region(res.start, resource_size(&res), + np->full_name))) { + err = -EBUSY; + goto fail; + } + + *base = ioremap(res.start, resource_size(&res)); + if (WARN_ON(!*base)) { + err = -ENOMEM; + goto fail; + } + + if (phys_base) + *phys_base = res.start; + + return 0; + +fail: + pr_err("%pOF: Unable to map resource %d: %pE\n", np, index, + ERR_PTR(err)); + + return err; +} + static int __init mpic_of_init(struct device_node *node, struct device_node *parent) { - struct resource main_int_res, per_cpu_int_res; + phys_addr_t phys_base; unsigned int nr_irqs; + int err; - BUG_ON(of_address_to_resource(node, 0, &main_int_res)); - BUG_ON(of_address_to_resource(node, 1, &per_cpu_int_res)); - - BUG_ON(!request_mem_region(main_int_res.start, - resource_size(&main_int_res), - node->full_name)); - BUG_ON(!request_mem_region(per_cpu_int_res.start, - resource_size(&per_cpu_int_res), - node->full_name)); - - main_int_base = ioremap(main_int_res.start, - resource_size(&main_int_res)); - BUG_ON(!main_int_base); + err = mpic_map_region(node, 0, &main_int_base, &phys_base); + if (err) + return err; - per_cpu_int_base = ioremap(per_cpu_int_res.start, - resource_size(&per_cpu_int_res)); - BUG_ON(!per_cpu_int_base); + err = mpic_map_region(node, 1, &per_cpu_int_base, NULL); + if (err) + return err; nr_irqs = FIELD_GET(MPIC_INT_CONTROL_NUMINT_MASK, readl(main_int_base + MPIC_INT_CONTROL)); @@ -810,7 +836,7 @@ static int __init mpic_of_init(struct device_node *node, mpic_perf_init(); mpic_smp_cpu_init(); - mpic_msi_init(node, main_int_res.start); + mpic_msi_init(node, phys_base); if (parent_irq <= 0) { irq_set_default_host(mpic_domain); From patchwork Thu Jul 11 16:09:07 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: 13730847 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 E5FC0C3DA49 for ; Thu, 11 Jul 2024 16:12:21 +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=bFeNY905BSFjiCOL6cj+sxh/6fLlgKG18n6BnTNCFNI=; b=dgCIzVpWtW6SnQBvvRGprg4X2G V5RsbUxM2JjqBftfo6ZlU8F8L61ERl7sKCo5XoV/HHOqJOjbbo4kBsc00oqFs0E5k5/5vknljWKYX QEE5ZukZQ4RxRlEOebx6eVnQi4Oi1vpH+NEBGCEU6qCte1A7S5epLRBGWR80eU5X5Wg1fGhBuZfcV IZzYIpK9BaOXE/gsF/iceBd2kNXa4Ok+UihD+5Vp5qVJulGFwNh5sQGtDSS1ZF3paEsIlmzc+4D4G 32osO5bQYF07bRA+xF6SGpGORCukq8oxXsGcmkmlhTB0j5tYaOUM0UGuXm0DwBejuE13EAMy8MQ/q CgCuKuNQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRwOv-0000000EdqV-1uVw; Thu, 11 Jul 2024 16:12:09 +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 1sRwMX-0000000Ecnf-0J13 for linux-arm-kernel@lists.infradead.org; Thu, 11 Jul 2024 16:09:42 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 74004CE191E; Thu, 11 Jul 2024 16:09:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 735F0C4AF09; Thu, 11 Jul 2024 16:09:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720714178; bh=9Tx07jhlw6n2lniOC+Pet+fG35liDdMYp1X5CKPy9cc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ln1NDCuz5DCR2KoVesAyIIQ43d0Sn/ttl0N0yrbG/1Nl95nO/r4IhkJr7lgYeFvMQ YLu/eMG5Ay0XYyMs+FLz2nkmfuQGokyCJ3ZSBqQlC16w3i5iNUCXqVu7a36mdJnGk4 XeQS3GK2/FF0SG3FN+gyAV1IzIkN9v//VWWjjf1KCdgPhk8Cex3L1PxBHWR/KStrIX q5SRjgSIATgPsrAvTI2XfwqITo6wJHKTca6SqTCTMwLjSCW74z26Wh6k/fvlmukecI ukzxa22sNvvzADTQY35j8LCa69T2j/a52abN4kuH4LmjGggc2kpmlb4+s/kn1mf9DK rGGHLnrPJrz+g== 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 10/10] irqchip/armada-370-xp: Print error and return error code on initialization failure Date: Thu, 11 Jul 2024 18:09:07 +0200 Message-ID: <20240711160907.31012-11-kabel@kernel.org> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240711160907.31012-1-kabel@kernel.org> References: <20240711160907.31012-1-kabel@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240711_090941_537371_84620183 X-CRM114-Status: GOOD ( 12.46 ) 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 Print error and return error code on main / IPI / MSI domain initialization failure. Use WARN_ON() instead of BUG_ON(). Signed-off-by: Marek Behún --- drivers/irqchip/irq-armada-370-xp.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c index dccc69aa2bf4..c93fab8ac2e4 100644 --- a/drivers/irqchip/irq-armada-370-xp.c +++ b/drivers/irqchip/irq-armada-370-xp.c @@ -473,7 +473,7 @@ static void mpic_ipi_resume(void) } } -static __init void mpic_ipi_init(struct device_node *node) +static __init int mpic_ipi_init(struct device_node *node) { int base_ipi; @@ -481,15 +481,17 @@ static __init void mpic_ipi_init(struct device_node *node) IPI_DOORBELL_END, &mpic_ipi_domain_ops, NULL); if (WARN_ON(!mpic_ipi_domain)) - return; + return -ENOMEM; irq_domain_update_bus_token(mpic_ipi_domain, DOMAIN_BUS_IPI); base_ipi = irq_domain_alloc_irqs(mpic_ipi_domain, IPI_DOORBELL_END, NUMA_NO_NODE, NULL); if (WARN_ON(!base_ipi)) - return; + return -ENOMEM; set_smp_ipi_range(base_ipi, IPI_DOORBELL_END); + + return 0; } static int mpic_set_affinity(struct irq_data *d, const struct cpumask *mask_val, @@ -823,7 +825,11 @@ static int __init mpic_of_init(struct device_node *node, writel(i, main_int_base + MPIC_INT_CLEAR_ENABLE); mpic_domain = irq_domain_add_linear(node, nr_irqs, &mpic_irq_ops, NULL); - BUG_ON(!mpic_domain); + if (!mpic_domain) { + pr_err("%pOF: Unable to add IRQ domain\n", node); + return -ENOMEM; + } + irq_domain_update_bus_token(mpic_domain, DOMAIN_BUS_WIRED); /* @@ -836,13 +842,22 @@ static int __init mpic_of_init(struct device_node *node, mpic_perf_init(); mpic_smp_cpu_init(); - mpic_msi_init(node, phys_base); + err = mpic_msi_init(node, phys_base); + if (err) { + pr_err("%pOF: Unable to initialize MSI domain\n", node); + return err; + } if (parent_irq <= 0) { irq_set_default_host(mpic_domain); set_handle_irq(mpic_handle_irq); #ifdef CONFIG_SMP - mpic_ipi_init(node); + err = mpic_ipi_init(node); + if (err) { + pr_err("%pOF: Unable to initialize IPI domain\n", node); + return err; + } + cpuhp_setup_state_nocalls(CPUHP_AP_IRQ_ARMADA_XP_STARTING, "irqchip/armada/ipi:starting", mpic_starting_cpu, NULL);