Linux-arch Archive on lore.kernel.org
 help / color / Atom feed
From: "Enrico Weigelt, metux IT consult" <info@metux.net>
To: linux-kernel@vger.kernel.org
Cc: mark.rutland@arm.com, alexander.shishkin@linux.intel.com,
	jolsa@redhat.com, namhyung@kernel.org, catalin.marinas@arm.com,
	will@kernel.org, msalter@redhat.com, jacquiot.aurelien@gmail.com,
	gerg@linux-m68k.org, geert@linux-m68k.org,
	tsbogend@alpha.franken.de, James.Bottomley@HansenPartnership.com,
	deller@gmx.de, benh@kernel.crashing.org, paulus@samba.org,
	ysato@users.sourceforge.jp, dalias@libc.org, davem@davemloft.net,
	tglx@linutronix.de, bp@alien8.de, x86@kernel.org, hpa@zytor.com,
	linus.walleij@linaro.org, bgolaszewski@baylibre.com,
	maz@kernel.org, tony@atomide.com, arnd@arndb.de,
	linux-alpha@vger.kernel.org, linux-c6x-dev@linux-c6x.org,
	linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org,
	linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org,
	linux-sh@vger.kernel.org, sparclinux@vger.kernel.org,
	linux-gpio@vger.kernel.org, linux-omap@vger.kernel.org,
	linux-arch@vger.kernel.org
Subject: [PATCH 17/23] arch: arm: use generic irq error counter
Date: Fri, 18 Dec 2020 15:57:40 +0100
Message-ID: <20201218145746.24205-18-info@metux.net> (raw)
In-Reply-To: <20201218145746.24205-1-info@metux.net>

Use the newly introduced irq error counter, that's already maintained
by all callers of ack_bad_irq(), in order to remove duplicate code.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
---
 arch/arm/include/asm/hardirq.h  | 2 +-
 arch/arm/include/asm/hw_irq.h   | 6 ------
 arch/arm/kernel/irq.c           | 6 ++----
 drivers/irqchip/irq-omap-intc.c | 5 ++---
 4 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/arch/arm/include/asm/hardirq.h b/arch/arm/include/asm/hardirq.h
index 706efafbf972..d9ae8998240d 100644
--- a/arch/arm/include/asm/hardirq.h
+++ b/arch/arm/include/asm/hardirq.h
@@ -5,7 +5,7 @@
 #include <asm/irq.h>
 
 #define __ARCH_IRQ_EXIT_IRQS_DISABLED	1
-#define ack_bad_irq ack_bad_irq
+#define ack_bad_irq(irq)
 
 #include <asm-generic/hardirq.h>
 
diff --git a/arch/arm/include/asm/hw_irq.h b/arch/arm/include/asm/hw_irq.h
index 5305c7e33aee..adbbeb11b930 100644
--- a/arch/arm/include/asm/hw_irq.h
+++ b/arch/arm/include/asm/hw_irq.h
@@ -5,12 +5,6 @@
 #ifndef _ARCH_ARM_HW_IRQ_H
 #define _ARCH_ARM_HW_IRQ_H
 
-static inline void ack_bad_irq(int irq)
-{
-	extern unsigned long irq_err_count;
-	irq_err_count++;
-}
-
 #define ARCH_IRQ_INIT_FLAGS	(IRQ_NOREQUEST | IRQ_NOPROBE)
 
 #endif
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
index 698b6f636156..72c3b8ce74db 100644
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -32,7 +32,7 @@
 #include <linux/kallsyms.h>
 #include <linux/proc_fs.h>
 #include <linux/export.h>
-
+#include <asm-generic/irq-err.h>
 #include <asm/hardware/cache-l2x0.h>
 #include <asm/hardware/cache-uniphier.h>
 #include <asm/outercache.h>
@@ -41,8 +41,6 @@
 #include <asm/mach/irq.h>
 #include <asm/mach/time.h>
 
-unsigned long irq_err_count;
-
 int arch_show_interrupts(struct seq_file *p, int prec)
 {
 #ifdef CONFIG_FIQ
@@ -51,7 +49,7 @@ int arch_show_interrupts(struct seq_file *p, int prec)
 #ifdef CONFIG_SMP
 	show_ipi_list(p, prec);
 #endif
-	seq_printf(p, "%*s: %10lu\n", prec, "Err", irq_err_count);
+	seq_printf(p, "%*s: %10lu\n", prec, "Err", irq_err_get());
 	return 0;
 }
 
diff --git a/drivers/irqchip/irq-omap-intc.c b/drivers/irqchip/irq-omap-intc.c
index d360a6eddd6d..2682c6e814c2 100644
--- a/drivers/irqchip/irq-omap-intc.c
+++ b/drivers/irqchip/irq-omap-intc.c
@@ -15,7 +15,7 @@
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/io.h>
-
+#include <asm-generic/irq-err.h>
 #include <asm/exception.h>
 #include <linux/irqchip.h>
 #include <linux/irqdomain.h>
@@ -328,7 +328,6 @@ static int __init omap_init_irq(u32 base, struct device_node *node)
 static asmlinkage void __exception_irq_entry
 omap_intc_handle_irq(struct pt_regs *regs)
 {
-	extern unsigned long irq_err_count;
 	u32 irqnr;
 
 	irqnr = intc_readl(INTC_SIR);
@@ -351,7 +350,7 @@ omap_intc_handle_irq(struct pt_regs *regs)
 	 */
 	if (unlikely((irqnr & SPURIOUSIRQ_MASK) == SPURIOUSIRQ_MASK)) {
 		pr_err_once("%s: spurious irq!\n", __func__);
-		irq_err_count++;
+		irq_err_inc();
 		omap_ack_irq(NULL);
 		return;
 	}
-- 
2.11.0


  parent reply index

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-18 14:57 (repost) cleaning up handling of bad IRQs Enrico Weigelt, metux IT consult
2020-12-18 14:57 ` [PATCH 01/23] kernel: irq: irqdescs: warn on spurious IRQ Enrico Weigelt, metux IT consult
2020-12-18 14:57 ` [PATCH 02/23] arch: alpha: drop misleading warning " Enrico Weigelt, metux IT consult
2020-12-18 14:57 ` [PATCH 03/23] arch: arm: " Enrico Weigelt, metux IT consult
2020-12-18 14:57 ` [PATCH 04/23] arch: c6x: " Enrico Weigelt, metux IT consult
2020-12-18 14:57 ` [PATCH 05/23] arch: ia64: " Enrico Weigelt, metux IT consult
2020-12-18 14:57 ` [PATCH 06/23] arch: mips: " Enrico Weigelt, metux IT consult
2020-12-18 14:57 ` [PATCH 07/23] arch: parisc: " Enrico Weigelt, metux IT consult
2020-12-18 14:57 ` [PATCH 08/23] arch: powerpc: " Enrico Weigelt, metux IT consult
2020-12-18 14:57 ` [PATCH 09/23] arch: s390: " Enrico Weigelt, metux IT consult
2020-12-18 14:57 ` [PATCH 10/23] arch: sh: " Enrico Weigelt, metux IT consult
2020-12-18 14:57 ` [PATCH 11/23] arch: sparc: " Enrico Weigelt, metux IT consult
2020-12-18 14:57 ` [PATCH 12/23] arch: x86: " Enrico Weigelt, metux IT consult
2020-12-18 14:57 ` [PATCH 13/23] arch: generic: " Enrico Weigelt, metux IT consult
2020-12-18 14:57 ` [PATCH 14/23] kernel: generic counter for interrupt errors Enrico Weigelt, metux IT consult
2020-12-18 14:57 ` [PATCH 15/23] arch: mips: use generic irq error counter Enrico Weigelt, metux IT consult
2020-12-18 14:57 ` [PATCH 16/23] arch: alpha: " Enrico Weigelt, metux IT consult
2020-12-18 14:57 ` Enrico Weigelt, metux IT consult [this message]
2020-12-18 14:57 ` [PATCH 18/23] arch: arm64: " Enrico Weigelt, metux IT consult
2020-12-18 14:57 ` [PATCH 19/23] arch: c6x: " Enrico Weigelt, metux IT consult
  -- strict thread matches above, loose matches on Subject: below --
2020-12-18 14:30 cleanup handling of bad IRQs Enrico Weigelt, metux IT consult
2020-12-18 14:31 ` [PATCH 17/23] arch: arm: use generic irq error counter Enrico Weigelt, metux IT consult

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201218145746.24205-18-info@metux.net \
    --to=info@metux.net \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=benh@kernel.crashing.org \
    --cc=bgolaszewski@baylibre.com \
    --cc=bp@alien8.de \
    --cc=catalin.marinas@arm.com \
    --cc=dalias@libc.org \
    --cc=davem@davemloft.net \
    --cc=deller@gmx.de \
    --cc=geert@linux-m68k.org \
    --cc=gerg@linux-m68k.org \
    --cc=hpa@zytor.com \
    --cc=jacquiot.aurelien@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-alpha@vger.kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-c6x-dev@linux-c6x.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-parisc@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    --cc=msalter@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=paulus@samba.org \
    --cc=sparclinux@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tony@atomide.com \
    --cc=tsbogend@alpha.franken.de \
    --cc=will@kernel.org \
    --cc=x86@kernel.org \
    --cc=ysato@users.sourceforge.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-arch Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-arch/0 linux-arch/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-arch linux-arch/ https://lore.kernel.org/linux-arch \
		linux-arch@vger.kernel.org
	public-inbox-index linux-arch

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-arch


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git