lkml.org 
[lkml]   [2013]   [Dec]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH 3/3] ACPI/IBFT: Fix wrong <acpi/acpi.h> inclusion in iSCSI boot firmware module.
Date
In Linux kernel, ACPICA is wrapped and safely exported by CONFIG_ACPI.  So
all external modules should depend on CONFIG_ACPI rather than using ACPICA
header directly for stubbing. But if we moves <acpi/acpi.h> inclusions
into "#ifdef CONFIG_ACPI", build breakge can help to detect wrong ACPICA
dependent modules.

One of the build breakage is:
drivers/firmware/iscsi_ibft_find.c: In function 'find_ibft_region':
drivers/firmware/iscsi_ibft_find.c:106:12: error: dereferencing pointer to incomplete type
drivers/firmware/iscsi_ibft_find.c:106:12: error: dereferencing pointer to incomplete type
drivers/firmware/iscsi_ibft_find.c:106:12: error: dereferencing pointer to incomplete type

The root cause of this breakage is:
1. iBFT locating is implemented by looking up it in the memory. This is
based on the specification. Specification doesn't mention if it can
appear on a non-ACPI platforms but mentions it is defined in ACPI 3.0b.
The current CONFIG_ISCSI_IBFT_FIND doesn't use ACPI table APIs to locate
the table, thus it doesn't rely on CONFIG_ACPI.

Since ACPI iSCSI Boot Firmware is an ACPI-based mechanism (please refer to
the Doclink below), we can make CONFIG_ISCSI_IBFT_FIND dependent on
CONFIG_ACPI though the locating mechanism can be implemented without using
ACPI table APIs. But please let me know if this is wrong.

Doclink: http://www.microsoft.com/whdc/system/platform/firmware/ibft.mspx
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>
Cc: Peter Jones <pjones@redhat.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
drivers/firmware/Kconfig | 2 +-
include/linux/iscsi_ibft.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig
index 0747872..a6ef6ac 100644
--- a/drivers/firmware/Kconfig
+++ b/drivers/firmware/Kconfig
@@ -110,7 +110,7 @@ config DMI_SYSFS

config ISCSI_IBFT_FIND
bool "iSCSI Boot Firmware Table Attributes"
- depends on X86
+ depends on X86 && ACPI
default n
help
This option enables the kernel to find the region of memory
diff --git a/include/linux/iscsi_ibft.h b/include/linux/iscsi_ibft.h
index 82f9673..605cc5c 100644
--- a/include/linux/iscsi_ibft.h
+++ b/include/linux/iscsi_ibft.h
@@ -21,7 +21,7 @@
#ifndef ISCSI_IBFT_H
#define ISCSI_IBFT_H

-#include <acpi/acpi.h> /* FIXME: inclusion should be removed */
+#include <linux/acpi.h>

/*
* Logical location of iSCSI Boot Format Table.
--
1.7.10


\
 
 \ /
  Last update: 2013-12-04 02:01    [W:0.244 / U:0.512 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site