Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ACPI / i915: Fix incorrect <acpi/acpi.h> inclusions via <linux/acpi_io.h>

To avoid build problems and breaking dependencies between ACPI header
files, <acpi/acpi.h> should not be included directly by code outside
of the ACPI core subsystem. However, that is possible if
<linux/acpi_io.h> is included, because that file contains
a direct inclusion of <acpi/acpi.h>.

For this reason, remove the direct <acpi/acpi.h> inclusion from
<linux/acpi_io.h>, move that file from include/linux/ to include/acpi/
and make <linux/acpi.h> include it for CONFIG_ACPI set along with the
other ACPI header files. Accordingly, Remove the inclusions of
<linux/acpi_io.h> from everywhere.

Of course, that causes the contents of the new <acpi/acpi_io.h> file
to be available for CONFIG_ACPI set only, so intel_opregion.o that
depends on it should also depend on CONFIG_ACPI (and it really should
not be compiled for CONFIG_ACPI unset anyway).

References: https://01.org/linuxgraphics/sites/default/files/documentation/acpi_igd_opregion_spec.pdf
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
[rjw: Subject and changelog]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Lv Zheng and committed by
Rafael J. Wysocki
27d50c82 c099eacb

+4 -11
-1
drivers/acpi/apei/apei-base.c
··· 34 34 #include <linux/module.h> 35 35 #include <linux/init.h> 36 36 #include <linux/acpi.h> 37 - #include <linux/acpi_io.h> 38 37 #include <linux/slab.h> 39 38 #include <linux/io.h> 40 39 #include <linux/kref.h>
-1
drivers/acpi/apei/apei-internal.h
··· 8 8 9 9 #include <linux/cper.h> 10 10 #include <linux/acpi.h> 11 - #include <linux/acpi_io.h> 12 11 13 12 struct apei_exec_context; 14 13
-1
drivers/acpi/apei/ghes.c
··· 33 33 #include <linux/module.h> 34 34 #include <linux/init.h> 35 35 #include <linux/acpi.h> 36 - #include <linux/acpi_io.h> 37 36 #include <linux/io.h> 38 37 #include <linux/interrupt.h> 39 38 #include <linux/timer.h>
-1
drivers/acpi/nvs.c
··· 12 12 #include <linux/mm.h> 13 13 #include <linux/slab.h> 14 14 #include <linux/acpi.h> 15 - #include <linux/acpi_io.h> 16 15 17 16 /* ACPI NVS regions, APEI may use it */ 18 17
-1
drivers/acpi/osl.c
··· 39 39 #include <linux/workqueue.h> 40 40 #include <linux/nmi.h> 41 41 #include <linux/acpi.h> 42 - #include <linux/acpi_io.h> 43 42 #include <linux/efi.h> 44 43 #include <linux/ioport.h> 45 44 #include <linux/list.h>
-1
drivers/gpu/drm/gma500/opregion.c
··· 22 22 * 23 23 */ 24 24 #include <linux/acpi.h> 25 - #include <linux/acpi_io.h> 26 25 #include "psb_drv.h" 27 26 #include "psb_intel_reg.h" 28 27
+1 -2
drivers/gpu/drm/i915/Makefile
··· 38 38 intel_ringbuffer.o \ 39 39 intel_overlay.o \ 40 40 intel_sprite.o \ 41 - intel_opregion.o \ 42 41 intel_sideband.o \ 43 42 intel_uncore.o \ 44 43 dvo_ch7xxx.o \ ··· 50 51 51 52 i915-$(CONFIG_COMPAT) += i915_ioc32.o 52 53 53 - i915-$(CONFIG_ACPI) += intel_acpi.o 54 + i915-$(CONFIG_ACPI) += intel_acpi.o intel_opregion.o 54 55 55 56 i915-$(CONFIG_DRM_I915_FBDEV) += intel_fbdev.o 56 57
+2 -1
drivers/gpu/drm/i915/i915_drv.h
··· 2336 2336 2337 2337 /* intel_opregion.c */ 2338 2338 struct intel_encoder; 2339 - extern int intel_opregion_setup(struct drm_device *dev); 2340 2339 #ifdef CONFIG_ACPI 2340 + extern int intel_opregion_setup(struct drm_device *dev); 2341 2341 extern void intel_opregion_init(struct drm_device *dev); 2342 2342 extern void intel_opregion_fini(struct drm_device *dev); 2343 2343 extern void intel_opregion_asle_intr(struct drm_device *dev); ··· 2346 2346 extern int intel_opregion_notify_adapter(struct drm_device *dev, 2347 2347 pci_power_t state); 2348 2348 #else 2349 + static inline int intel_opregion_setup(struct drm_device *dev) { return 0; } 2349 2350 static inline void intel_opregion_init(struct drm_device *dev) { return; } 2350 2351 static inline void intel_opregion_fini(struct drm_device *dev) { return; } 2351 2352 static inline void intel_opregion_asle_intr(struct drm_device *dev) { return; }
-1
drivers/gpu/drm/i915/intel_opregion.c
··· 28 28 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 29 29 30 30 #include <linux/acpi.h> 31 - #include <linux/acpi_io.h> 32 31 #include <acpi/video.h> 33 32 34 33 #include <drm/drmP.h>
+1
include/linux/acpi.h
··· 42 42 #include <acpi/acpi_bus.h> 43 43 #include <acpi/acpi_drivers.h> 44 44 #include <acpi/acpi_numa.h> 45 + #include <acpi/acpi_io.h> 45 46 #include <asm/acpi.h> 46 47 47 48 static inline acpi_handle acpi_device_handle(struct acpi_device *adev)
-1
include/linux/acpi_io.h include/acpi/acpi_io.h
··· 2 2 #define _ACPI_IO_H_ 3 3 4 4 #include <linux/io.h> 5 - #include <acpi/acpi.h> /* FIXME: inclusion should be removed */ 6 5 7 6 static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys, 8 7 acpi_size size)