]> git.hungrycats.org Git - linux/commitdiff
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:11:07 +0000 (18:11 +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>
23 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/io_apic.c
arch/x86/kernel/apic/msi.c
arch/x86/kernel/apic/vector.c
arch/x86/kernel/fpu/core.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/smpboot.c
arch/x86/kernel/time.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/i915_pmu.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 fe1607fe420c6dc496377678b5b6132502eb5e46..0459169ab5892336175a212513457d584313276e 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 b4527cacd087c82e4b579793e3a969a91bb7529c..9895632507a7e53cff61a4a08662b463d7af8791 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 f2e4e002eeb7dac71c011e31854db6e1751bb9aa..4c3bd1527b93c710cb84f9f58608d5a1a1175229 100644 (file)
@@ -56,6 +56,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 3982f79d2377c6d5b8542590d56872fa4675be89..ff0d14cd9e827ef78b1ee4c8fdcebf08c56dfe71 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 ce503c99f5c4cd67fddb5fafdda7e3e64b8e7690..72a94401f9e03487f37dea32f762afe524db0578 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 b708f597eee3ab558777947f9bf8e66839eda752..9f38b4140c270aabb1bed7937f1911839f8d63e7 100644 (file)
@@ -11,6 +11,7 @@
  * published by the Free Software Foundation.
  */
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/seq_file.h>
 #include <linux/init.h>
 #include <linux/compiler.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 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 86c4439f9d74963b7d9317e6a487ed0d7c085765..519649ddf1001d423c5b0a7e02a42f7ca92e2a06 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 2c3a1b4294eb40d202b4e14435cf3682b9f34d5e..7f6cffaa5322936b951952b0a5b3044fe704866c 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 328d027d829d215ef3f3732c9b47d55641746746..59b5f2ea7c2f32d8c02181be432262b2df97ea1a 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 772196c1b8c4c58e557c0a36164142d43ecb7deb..a0693b71cfc1cc4bb99af19ed7b9d07bfca80c33 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 3c8b36aac8d96bb7dc0a64ec5d299e90d621fe40..9d1c8faaeb746cc1b66f038f3608c58863e568bc 100644 (file)
@@ -80,6 +80,7 @@
 #include <asm/intel-family.h>
 #include <asm/cpu_device_id.h>
 #include <asm/spec-ctrl.h>
+#include <asm/hw_irq.h>
 
 /* Number of siblings per CPU package */
 int smp_num_siblings = 1;
index 774ebafa97c4395d99b319fe41868f3e89eabc4e..be01328eb755c2277f11e9370d84a480c9b7b302 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 4d418e70587802b05aff3ae49e80db7faf47a64c..fb752d9a3ce969b916df16b98019c6aac0cfe3ef 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 f0519e31543a6506d4eaf3d3213311c81be2ea1c..fbe2a9bee07f9c7919dc5bcce913a8449af79a4f 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <linux/perf_event.h>
 #include <linux/pm_runtime.h>
+#include <linux/irq.h>
 
 #include "i915_drv.h"
 #include "i915_pmu.h"
index 6269750e2b547c3db8969e54c6ab03116a1e112f..b4941101f21a9fed58ce30c960174194afd36860 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 4690814cfc51ae15ffe370b4a577d1edc7369e42..c07e952b94ee6a9a366fde3363c85a5ac353483c 100644 (file)
@@ -43,6 +43,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>