x86: Don't include linux/irq.h from asm/hardirq.h
authorNicolai Stange <nstange@suse.de>
Sun, 29 Jul 2018 10:15:33 +0000 (12:15 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Aug 2018 16:12:58 +0000 (18:12 +0200)
commit 447ae316670230d7d29430e2cbf1f5db4f49d14c upstream

The next patch in this series will have to make the definition of
irq_cpustat_t available to entering_irq().

Inclusion of asm/hardirq.h into asm/apic.h would cause circular header
dependencies like

  asm/smp.h
    asm/apic.h
      asm/hardirq.h
        linux/irq.h
          linux/topology.h
            linux/smp.h
              asm/smp.h

or

  linux/gfp.h
    linux/mmzone.h
      asm/mmzone.h
        asm/mmzone_64.h
          asm/smp.h
            asm/apic.h
              asm/hardirq.h
                linux/irq.h
                  linux/irqdesc.h
                    linux/kobject.h
                      linux/sysfs.h
                        linux/kernfs.h
                          linux/idr.h
                            linux/gfp.h

and others.

This causes compilation errors because of the header guards becoming
effective in the second inclusion: symbols/macros that had been defined
before wouldn't be available to intermediate headers in the #include chain
anymore.

A possible workaround would be to move the definition of irq_cpustat_t
into its own header and include that from both, asm/hardirq.h and
asm/apic.h.

However, this wouldn't solve the real problem, namely asm/harirq.h
unnecessarily pulling in all the linux/irq.h cruft: nothing in
asm/hardirq.h itself requires it. Also, note that there are some other
archs, like e.g. arm64, which don't have that #include in their
asm/hardirq.h.

Remove the linux/irq.h #include from x86' asm/hardirq.h.

Fix resulting compilation errors by adding appropriate #includes to *.c
files as needed.

Note that some of these *.c files could be cleaned up a bit wrt. to their
set of #includes, but that should better be done from separate patches, if
at all.

Signed-off-by: Nicolai Stange <nstange@suse.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
26 files changed:
arch/x86/include/asm/dmi.h
arch/x86/include/asm/hardirq.h
arch/x86/include/asm/kvm_host.h
arch/x86/kernel/apic/apic.c
arch/x86/kernel/apic/htirq.c
arch/x86/kernel/apic/io_apic.c
arch/x86/kernel/apic/msi.c
arch/x86/kernel/apic/vector.c
arch/x86/kernel/fpu/core.c
arch/x86/kernel/ftrace.c
arch/x86/kernel/hpet.c
arch/x86/kernel/i8259.c
arch/x86/kernel/idt.c
arch/x86/kernel/irq.c
arch/x86/kernel/irq_32.c
arch/x86/kernel/irq_64.c
arch/x86/kernel/irqinit.c
arch/x86/kernel/kprobes/core.c
arch/x86/kernel/smpboot.c
arch/x86/kernel/time.c
arch/x86/mm/fault.c
arch/x86/mm/pti.c
arch/x86/platform/intel-mid/device_libs/platform_mrfld_wdt.c
arch/x86/xen/enlighten.c
drivers/gpu/drm/i915/intel_lpe_audio.c
drivers/pci/host/pci-hyperv.c

index 0ab2ab27ad1fb59993fb651f69f49df50e857ff9..b825cb201251654f7a085b0b612a0b574979fa2b 100644 (file)
@@ -4,8 +4,8 @@
 
 #include <linux/compiler.h>
 #include <linux/init.h>
+#include <linux/io.h>
 
-#include <asm/io.h>
 #include <asm/setup.h>
 
 static __always_inline __init void *dmi_alloc(unsigned len)
index 261ef5d8c181dffca66c1a0853b3d682d145d55b..486c843273c46fe6c102fdce5997d8d9ed211a80 100644 (file)
@@ -3,7 +3,6 @@
 #define _ASM_X86_HARDIRQ_H
 
 #include <linux/threads.h>
-#include <linux/irq.h>
 
 typedef struct {
        u16          __softirq_pending;
index a41d58822070e88af248dfba03f71cb0f22b5715..c835d4f5911208e15169a239a0c69301af28c6e1 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/tracepoint.h>
 #include <linux/cpumask.h>
 #include <linux/irq_work.h>
+#include <linux/irq.h>
 
 #include <linux/kvm.h>
 #include <linux/kvm_para.h>
index 0a10d3ed77cebc7b911ec7ddc7b632d4ebe43b3f..348fb896b5b4cf5aef79d1473940188b0760e83e 100644 (file)
@@ -34,6 +34,7 @@
 #include <linux/dmi.h>
 #include <linux/smp.h>
 #include <linux/mm.h>
+#include <linux/irq.h>
 
 #include <asm/trace/irq_vectors.h>
 #include <asm/irq_remapping.h>
@@ -56,6 +57,7 @@
 #include <asm/hypervisor.h>
 #include <asm/cpu_device_id.h>
 #include <asm/intel-family.h>
+#include <asm/irq_regs.h>
 
 unsigned int num_processors;
 
index 56ccf9346b08ac4bf3e54e7994074b6c04fb02e8..741de281ed5de06f917c14e6943fc383a0003bda 100644 (file)
@@ -16,6 +16,8 @@
 #include <linux/device.h>
 #include <linux/pci.h>
 #include <linux/htirq.h>
+#include <linux/irq.h>
+
 #include <asm/irqdomain.h>
 #include <asm/hw_irq.h>
 #include <asm/apic.h>
index 3b89b27945fffc8f7c9d8dd28f9ed787158ad833..96a8a68f9c793377c305edf63113cd69c352cf45 100644 (file)
@@ -33,6 +33,7 @@
 
 #include <linux/mm.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/init.h>
 #include <linux/delay.h>
 #include <linux/sched.h>
index 9b18be76442236eab971cab86cbf366f9e1e134f..f10e7f93b0e2c04e7b5f22adbc7ebb574f710281 100644 (file)
@@ -12,6 +12,7 @@
  */
 #include <linux/mm.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/pci.h>
 #include <linux/dmar.h>
 #include <linux/hpet.h>
index 2ce1c708b8ee399db1f856ef8ce8d50cdec66bfb..b958082c74a77f0903c830949f6b3aae667adea9 100644 (file)
@@ -11,6 +11,7 @@
  * published by the Free Software Foundation.
  */
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/init.h>
 #include <linux/compiler.h>
 #include <linux/slab.h>
index f92a6593de1ec651d244d43d16acbd8d49959e4b..2ea85b32421a02d5f3f8e6643757610576841e3c 100644 (file)
@@ -10,6 +10,7 @@
 #include <asm/fpu/signal.h>
 #include <asm/fpu/types.h>
 #include <asm/traps.h>
+#include <asm/irq_regs.h>
 
 #include <linux/hardirq.h>
 #include <linux/pkeys.h>
index 01ebcb6f263e39accb3f8e53ab7eb5372e0726f7..7acb87cb2da83309f86df91dcc239044037ee1e3 100644 (file)
@@ -27,6 +27,7 @@
 
 #include <asm/set_memory.h>
 #include <asm/kprobes.h>
+#include <asm/sections.h>
 #include <asm/ftrace.h>
 #include <asm/nops.h>
 
index 8ce4212e2b8d0f139e543e05e7e284ee25ee856d..afa1a204bc6d69029a2520725b174ba201dd7cd7 100644 (file)
@@ -1,6 +1,7 @@
 #include <linux/clocksource.h>
 #include <linux/clockchips.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/export.h>
 #include <linux/delay.h>
 #include <linux/errno.h>
index 8f5cb2c7060cfc29b46ec24669ec418dfdf0c0df..02abc134367ff0c0d93d2ac2758006a5f0925637 100644 (file)
@@ -5,6 +5,7 @@
 #include <linux/sched.h>
 #include <linux/ioport.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/timex.h>
 #include <linux/random.h>
 #include <linux/init.h>
index 0c5256653d6c5256eef39c5dc6768d49e40889a0..38c3d5790970cfaa3bd0e52018dff7095acf270f 100644 (file)
@@ -8,6 +8,7 @@
 #include <asm/traps.h>
 #include <asm/proto.h>
 #include <asm/desc.h>
+#include <asm/hw_irq.h>
 
 struct idt_data {
        unsigned int    vector;
index aa9d51eea9d0e806e51122421e77d67dd31bb027..3c2326b598208ceb1254468e3dd9a01e23ec0e67 100644 (file)
@@ -10,6 +10,7 @@
 #include <linux/ftrace.h>
 #include <linux/delay.h>
 #include <linux/export.h>
+#include <linux/irq.h>
 
 #include <asm/apic.h>
 #include <asm/io_apic.h>
index c1bdbd3d3232cb83d07bfa4ce604ae0b620c796a..95600a99ae93652dbbd4143c9e538e808911bb24 100644 (file)
@@ -11,6 +11,7 @@
 
 #include <linux/seq_file.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/kernel_stat.h>
 #include <linux/notifier.h>
 #include <linux/cpu.h>
index d86e344f5b3debfed504b72a7c0f83f36fe16387..0469cd078db15c0c26700fc7a50f9c3f8144ff2a 100644 (file)
@@ -11,6 +11,7 @@
 
 #include <linux/kernel_stat.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/seq_file.h>
 #include <linux/delay.h>
 #include <linux/ftrace.h>
index 1e4094eba15e95e6f9b3c6f19de6d748bb894dd1..40f83d0d7b8a3e8da20a46a9f899c39b064d46c4 100644 (file)
@@ -5,6 +5,7 @@
 #include <linux/sched.h>
 #include <linux/ioport.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/timex.h>
 #include <linux/random.h>
 #include <linux/kprobes.h>
index 1e7709337827eec70db413f1b6a21cb532d4970e..65452d555f0514178528bfc13d96c7bbd8d19cab 100644 (file)
@@ -63,6 +63,7 @@
 #include <asm/insn.h>
 #include <asm/debugreg.h>
 #include <asm/set_memory.h>
+#include <asm/sections.h>
 
 #include "common.h"
 
index 60dc95d7d96d6019a713a02dad2dff71bee7382d..6fd12e0a07c999a1604cc33347c5a637eb3bc41e 100644 (file)
@@ -78,6 +78,7 @@
 #include <asm/realmode.h>
 #include <asm/misc.h>
 #include <asm/spec-ctrl.h>
+#include <asm/hw_irq.h>
 
 /* Number of siblings per CPU package */
 int smp_num_siblings = 1;
index 879af864d99afd6c8645f0d74fe71bf6a2bade07..49a5c394f3ed45af7afd9e1841b6833ec120ad90 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <linux/clockchips.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/i8253.h>
 #include <linux/time.h>
 #include <linux/export.h>
index 0133d26f16bea276206888ce4418634d27e38bad..c2faff548f59a575024a62e4291bf567a8939dc3 100644 (file)
@@ -24,6 +24,7 @@
 #include <asm/vsyscall.h>              /* emulate_vsyscall             */
 #include <asm/vm86.h>                  /* struct vm86                  */
 #include <asm/mmu_context.h>           /* vma_pkey()                   */
+#include <asm/sections.h>
 
 #define CREATE_TRACE_POINTS
 #include <asm/trace/exceptions.h>
index ce38f165489b5a13d92091c8671879f30ce44e20..d6f11accd37a0590a7eb3ff22a8aa4ecedb7670b 100644 (file)
@@ -45,6 +45,7 @@
 #include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
 #include <asm/desc.h>
+#include <asm/sections.h>
 
 #undef pr_fmt
 #define pr_fmt(fmt)     "Kernel/User page tables isolation: " fmt
index 4f5fa65a10110344aa3d763fdf5b73a5d6652c0b..2acd6be133755872bad09e920fc0db1cb4911d2d 100644 (file)
@@ -18,6 +18,7 @@
 #include <asm/intel-mid.h>
 #include <asm/intel_scu_ipc.h>
 #include <asm/io_apic.h>
+#include <asm/hw_irq.h>
 
 #define TANGIER_EXT_TIMER0_MSI 12
 
index c9081c6671f0b7a05ecfaaf206e7e1ed2b1f456a..df208af3cd749415c67aa270adb5f225a3d42b37 100644 (file)
@@ -3,6 +3,7 @@
 #endif
 #include <linux/cpu.h>
 #include <linux/kexec.h>
+#include <linux/slab.h>
 
 #include <xen/features.h>
 #include <xen/page.h>
index 3bf65288ffffd51719d0c4e8ce934ccd2d2f59e3..2fdf302ebdad096e39f1bf2e853313ffe14a0caa 100644 (file)
@@ -62,6 +62,7 @@
 
 #include <linux/acpi.h>
 #include <linux/device.h>
+#include <linux/irq.h>
 #include <linux/pci.h>
 #include <linux/pm_runtime.h>
 
index 4523d7e1bcb9c7d66528105306bf3b688c8a1e05..ffc87a956d97460e9e1bca6e3b02c78c65f65b0a 100644 (file)
@@ -53,6 +53,8 @@
 #include <linux/delay.h>
 #include <linux/semaphore.h>
 #include <linux/irqdomain.h>
+#include <linux/irq.h>
+
 #include <asm/irqdomain.h>
 #include <asm/apic.h>
 #include <linux/msi.h>