From: Al Stone al.stone@linaro.org
These patches are a bit of all over the place. Each of them cleans up or removes BOZO comments that have been in the ACPI ARM port from the very early days of the port (I inserted the BOZO comments when it was not clear what needed to be done but I could temporarily hack around a problem). Removing each of those had all sorts of different changes needed, from the simplest (the comment turns out to be wrong in hindsight), to stubbing out or even removing functions that make no sense on an ARMv7/v8 platform.
Changes for v2: -- Simplification by using kernel config items to exclude code versus obtuse #ifdef logic
Al Stone (7): ACPI: ARM: make use of an ACPI blob address in FDT /chosen configurable. ACPI: ARM: Clean up a leftover comment that is no longer pertinent. ACPI: ARM: remove x86 acpi_wakeup_address usage when running on ARM ACPI: ARM: remove unnecessary comments ACPI: ARM: cleanup comments and isolate out x86-specific PAD code ACPI: ARM: stub out PCI configuration call for non-PCI systems ACPI: ARM: stub out processor idle routines for use on non-x86 platforms
arch/arm/Kconfig.debug | 11 ++++++ arch/arm/include/asm/acpi.h | 7 ---- arch/arm/include/asm/io.h | 6 +--- arch/arm/include/asm/processor.h | 6 ---- arch/arm64/Kconfig.debug | 11 ++++++ arch/arm64/include/asm/acpi.h | 7 ---- arch/arm64/include/asm/processor.h | 6 ---- drivers/acpi/acpi_pad.c | 15 +++----- drivers/acpi/osl.c | 42 ++++++++++++---------- drivers/acpi/processor_idle.c | 74 +++++++++++++++++++------------------- drivers/acpi/sleep.c | 2 ++ 11 files changed, 91 insertions(+), 96 deletions(-)
From: Al Stone al.stone@linaro.org
Since this is really only a option to be used during kernel development, add the kernel config item ACPI_USE_CHOSEN_NODE to allow a developer access to this when working on a non-UEFI system or if needed to experiment with ACPI table content during driver development.
Signed-off-by: Al Stone al.stone@linaro.org --- arch/arm/Kconfig.debug | 11 +++++++++++ arch/arm64/Kconfig.debug | 11 +++++++++++ drivers/acpi/osl.c | 10 ++++++---- 3 files changed, 28 insertions(+), 4 deletions(-)
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index 0e23bb6..6ef3d7c 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug @@ -1132,4 +1132,15 @@ config PID_IN_CONTEXTIDR additional instructions during context switch. Say Y here only if you are planning to use hardware trace tools with this kernel.
+config ACPI_USE_CHOSEN_NODE + bool "Pass ACPI blob address through /chosen node" + depends on ARM || ARM64 + help + Enabling this allows one to experiment with ACPI tables during + development on non-UEFI systems. If this is enabled, ACPI will + expect to find /chosen/linux,acpi-start in an FDT passed into + the kernel and use the contents of that node as the physical + address of the RSDP in an ACPI table blob. + + endmenu diff --git a/arch/arm64/Kconfig.debug b/arch/arm64/Kconfig.debug index 835c559..483dcce 100644 --- a/arch/arm64/Kconfig.debug +++ b/arch/arm64/Kconfig.debug @@ -23,4 +23,15 @@ config PID_IN_CONTEXTIDR instructions during context switch. Say Y here only if you are planning to use hardware trace tools with this kernel.
+config ACPI_USE_CHOSEN_NODE + bool "Pass ACPI blob address through /chosen node" + depends on ARM || ARM64 + help + Enabling this allows one to experiment with ACPI tables during + development on non-UEFI systems. If this is enabled, ACPI will + expect to find /chosen/linux,acpi-start in an FDT passed into + the kernel and use the contents of that node as the physical + address of the RSDP in an ACPI table blob. + + endmenu diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 0912066..a9b5b11 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -251,13 +251,15 @@ static int __init setup_acpi_rsdp(char *arg) early_param("acpi_rsdp", setup_acpi_rsdp); #endif
-#if defined(CONFIG_ARM) || defined(CONFIG_ARM64) +#ifdef CONFIG_ACPI_USE_CHOSEN_NODE #include <asm/acpi.h> #include <acpi/actbl.h>
void acpi_find_arm_root_pointer(acpi_physical_address *pa) { - /* BOZO: temporarily clunky. + /* This function is for development use only, or in extreme + * cases where UEFI is not yet available for the platform. + * * What we do is, while using u-boot still, is use the values * that have already been retrieved from the FDT node * (/chosen/linux,acpi-start and /chosen/linux,acpi-len) which @@ -307,7 +309,7 @@ void acpi_find_arm_root_pointer(acpi_physical_address *pa)
return; } -#endif +#endif /* CONFIG_ACPI_USE_CHOSEN_NODE */
acpi_physical_address __init acpi_os_get_root_pointer(void) { @@ -329,7 +331,7 @@ acpi_physical_address __init acpi_os_get_root_pointer(void) } else { acpi_physical_address pa = 0;
-#if defined(CONFIG_ARM) || defined(CONFIG_ARM64) +#ifdef CONFIG_ACPI_USE_CHOSEN_NODE acpi_find_arm_root_pointer(&pa); #else acpi_find_root_pointer(&pa);
From: Al Stone al.stone@linaro.org
The comment questioned whether the header file had a typo when it in fact does not.
Signed-off-by: Al Stone al.stone@linaro.org --- arch/arm/include/asm/io.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h index b0f3334..61577dc 100644 --- a/arch/arm/include/asm/io.h +++ b/arch/arm/include/asm/io.h @@ -328,11 +328,7 @@ extern void _memset_io(volatile void __iomem *, int, size_t); */ #define ioremap(cookie,size) __arm_ioremap((cookie), (size), MT_DEVICE) #define ioremap_nocache(cookie,size) __arm_ioremap((cookie), (size), MT_DEVICE) -/* - * BOZO: is this just mis-named as ioremap_cached()? - * renaming it to ioremap_cache() to find out for now. - #define ioremap_cached(cookie,size) __arm_ioremap((cookie), (size), MT_DEVICE_CACHED) - */ +#define ioremap_cached(cookie, size) __arm_ioremap((cookie), (size), MT_DEVICE_CACHED) #define ioremap_cache(cookie,size) __arm_ioremap((cookie), (size), MT_DEVICE_CACHED) #define ioremap_wc(cookie,size) __arm_ioremap((cookie), (size), MT_DEVICE_WC) #define iounmap __arm_iounmap
From: Al Stone al.stone@linaro.org
This code will be handled in a different manner (either PSCI or other kernel code) so is not needed (and indeed is not used) for ARMv7/v8 systems.
Signed-off-by: Al Stone al.stone@linaro.org --- arch/arm/include/asm/acpi.h | 5 ----- arch/arm64/include/asm/acpi.h | 5 ----- 2 files changed, 10 deletions(-)
diff --git a/arch/arm/include/asm/acpi.h b/arch/arm/include/asm/acpi.h index 651a15c..658edf1 100644 --- a/arch/arm/include/asm/acpi.h +++ b/arch/arm/include/asm/acpi.h @@ -109,13 +109,8 @@ extern int acpi_suspend_lowlevel(void);
extern void prefill_possible_map(void);
-/* Physical address to resume after wakeup */ -/* BOZO: was... -#define acpi_wakeup_address ((unsigned long)(real_mode_header->wakeup_start)) -*/ #define acpi_wakeup_address (0)
- static inline void disable_acpi(void) { acpi_disabled = 1; diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h index 8dc632a..5f17424 100644 --- a/arch/arm64/include/asm/acpi.h +++ b/arch/arm64/include/asm/acpi.h @@ -87,13 +87,8 @@ extern int acpi_suspend_lowlevel(void);
extern void prefill_possible_map(void);
-/* Physical address to resume after wakeup */ -/* BOZO: was... -#define acpi_wakeup_address ((unsigned long)(real_mode_header->wakeup_start)) -*/ #define acpi_wakeup_address (0)
- static inline void disable_acpi(void) { acpi_disabled = 1;
From: Al Stone al.stone@linaro.org
Signed-off-by: Al Stone al.stone@linaro.org --- arch/arm/include/asm/processor.h | 6 ------ arch/arm64/include/asm/processor.h | 6 ------ 2 files changed, 12 deletions(-)
diff --git a/arch/arm/include/asm/processor.h b/arch/arm/include/asm/processor.h index abff94a..250cc11 100644 --- a/arch/arm/include/asm/processor.h +++ b/arch/arm/include/asm/processor.h @@ -108,10 +108,6 @@ static inline void prefetch(const void *ptr) #define ARCH_HAS_SPINLOCK_PREFETCH #define spin_lock_prefetch(x) do { } while (0)
-/* - * Not all ARM devices have ACPI, but some do - * BOZO: is this correct? - */ #ifdef CONFIG_ACPI enum idle_boot_override { IDLE_NO_OVERRIDE = 0, IDLE_HALT, IDLE_NOMWAIT, IDLE_POLL, IDLE_FORCE_MWAIT }; @@ -119,8 +115,6 @@ enum idle_boot_override { IDLE_NO_OVERRIDE = 0, IDLE_HALT, IDLE_NOMWAIT, extern unsigned long boot_option_idle_override; #endif
-/* end BOZO */ - #endif
#define HAVE_ARCH_PICK_MMAP_LAYOUT diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h index 53326fd..550e052 100644 --- a/arch/arm64/include/asm/processor.h +++ b/arch/arm64/include/asm/processor.h @@ -155,10 +155,6 @@ static inline void spin_lock_prefetch(const void *x) prefetchw(x); }
-/* - * Not all ARM devices have ACPI, but some do - * BOZO: is this correct? - */ #ifdef CONFIG_ACPI enum idle_boot_override { IDLE_NO_OVERRIDE = 0, IDLE_HALT, IDLE_NOMWAIT, IDLE_POLL, IDLE_FORCE_MWAIT }; @@ -166,8 +162,6 @@ enum idle_boot_override { IDLE_NO_OVERRIDE = 0, IDLE_HALT, IDLE_NOMWAIT, extern unsigned long boot_option_idle_override; #endif
-/* end BOZO */ - #define HAVE_ARCH_PICK_MMAP_LAYOUT
#endif
From: Al Stone al.stone@linaro.org
Remove a bunch of comments left over from some initial prototyping work.
PAD (Processor Aggregator Device) is intended for use on x86 systems for now. Remove it from the ACPI configuration options for ARM.
Signed-off-by: Al Stone al.stone@linaro.org --- drivers/acpi/Kconfig | 2 +- drivers/acpi/acpi_pad.c | 17 ----------------- 2 files changed, 1 insertion(+), 18 deletions(-)
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index eade891..32ec313 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -205,7 +205,7 @@ config ACPI_HOTPLUG_CPU config ACPI_PROCESSOR_AGGREGATOR tristate "Processor Aggregator" depends on ACPI_PROCESSOR - depends on X86 || ARM || ARM64 + depends on X86 help ACPI 4.0 defines processor Aggregator, which enables OS to perform specific processor configuration and control that applies to all diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c index 36d993c..129e052 100644 --- a/drivers/acpi/acpi_pad.c +++ b/drivers/acpi/acpi_pad.c @@ -30,10 +30,7 @@ #include <linux/slab.h> #include <acpi/acpi_bus.h> #include <acpi/acpi_drivers.h> -#ifdef CONFIG_X86 - /* BOZO: abstract out? */ #include <asm/mwait.h> -#endif
#define ACPI_PROCESSOR_AGGREGATOR_CLASS "acpi_pad" #define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator" @@ -50,8 +47,6 @@ static unsigned char lapic_marked_unstable;
static void power_saving_mwait_init(void) { -#ifdef CONFIG_X86 - /* BOZO: abstract out? */ unsigned int eax, ebx, ecx, edx; unsigned int highest_cstate = 0; unsigned int highest_subcstate = 0; @@ -77,9 +72,7 @@ static void power_saving_mwait_init(void) } power_saving_mwait_eax = (highest_cstate << MWAIT_SUBSTATE_SIZE) | (highest_subcstate - 1); -#endif
-#if defined(CONFIG_X86) switch (boot_cpu_data.x86_vendor) { case X86_VENDOR_AMD: case X86_VENDOR_INTEL: @@ -97,7 +90,6 @@ static void power_saving_mwait_init(void) tsc_detected_unstable = 1; lapic_detected_unstable = 1; } -#endif }
static unsigned long cpu_weight[NR_CPUS]; @@ -179,11 +171,8 @@ static int power_saving_thread(void *data)
while (!need_resched()) { if (tsc_detected_unstable && !tsc_marked_unstable) { -#ifdef CONFIG_X86 - /* BOZO: abstract out? */ /* TSC could halt in idle, so notify users */ mark_tsc_unstable("TSC halts in idle"); -#endif tsc_marked_unstable = 1; } if (lapic_detected_unstable && !lapic_marked_unstable) { @@ -202,16 +191,10 @@ static int power_saving_thread(void *data) CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &cpu); stop_critical_timings();
-#ifdef CONFIG_X86 - /* BOZO: abstract out? */ __monitor((void *)¤t_thread_info()->flags, 0, 0); -#endif smp_mb(); -#ifdef CONFIG_X86 - /* BOZO: abstract out? */ if (!need_resched()) __mwait(power_saving_mwait_eax, 1); -#endif
start_critical_timings(); if (lapic_marked_unstable)
From: Al Stone al.stone@linaro.org
Signed-off-by: Al Stone al.stone@linaro.org --- drivers/acpi/osl.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-)
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index a9b5b11..212ae09 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -1075,6 +1075,7 @@ acpi_os_write_memory(acpi_physical_address phys_addr, u64 value, u32 width) return AE_OK; }
+#ifdef CONFIG_PCI acpi_status acpi_os_read_pci_configuration(struct acpi_pci_id * pci_id, u32 reg, u64 *value, u32 width) @@ -1099,23 +1100,23 @@ acpi_os_read_pci_configuration(struct acpi_pci_id * pci_id, u32 reg, return AE_ERROR; }
-#ifdef CONFIG_X86 - /* - * BOZO: probably should not call this function at all - * if there is no PCI... - */ result = raw_pci_read(pci_id->segment, pci_id->bus, PCI_DEVFN(pci_id->device, pci_id->function), reg, size, &value32); -#else - result = 0; - value32 = 0; -#endif *value = value32;
return (result ? AE_ERROR : AE_OK); } +#else +acpi_status +acpi_os_read_pci_configuration(struct acpi_pci_id *pci_id, u32 reg, + u64 *value, u32 width) +{ + return AE_ERROR; +} +#endif
+#ifdef CONFIG_PCI acpi_status acpi_os_write_pci_configuration(struct acpi_pci_id * pci_id, u32 reg, u64 value, u32 width) @@ -1136,17 +1137,20 @@ acpi_os_write_pci_configuration(struct acpi_pci_id * pci_id, u32 reg, return AE_ERROR; }
-#ifdef CONFIG_X86 - /* BOZO: how do we handle not having PCI? */ result = raw_pci_write(pci_id->segment, pci_id->bus, PCI_DEVFN(pci_id->device, pci_id->function), reg, size, value); -#else - result = 0; -#endif
return (result ? AE_ERROR : AE_OK); } +#else +acpi_status +acpi_os_write_pci_configuration(struct acpi_pci_id *pci_id, u32 reg, + u64 value, u32 width) +{ + return AE_ERROR; +} +#endif
static void acpi_os_execute_deferred(struct work_struct *work) {
From: Al Stone al.stone@linaro.org
Most of drivers/acpi/processor_idle.c is x86-centric. So, modify the kernel config so it is not included unless working on an x86 platform.
Signed-off-by: Al Stone al.stone@linaro.org --- drivers/acpi/Kconfig | 3 ++- drivers/acpi/processor_idle.c | 35 ----------------------------------- 2 files changed, 2 insertions(+), 36 deletions(-)
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 32ec313..a876bca 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -175,6 +175,7 @@ config ACPI_PROCESSOR select THERMAL select CPU_IDLE default y + depends on X86 help This driver installs ACPI as the idle handler for Linux and uses ACPI C2 and C3 processor states to save power on systems that @@ -215,7 +216,7 @@ config ACPI_PROCESSOR_AGGREGATOR
config ACPI_THERMAL tristate "Thermal Zone" - depends on ACPI_PROCESSOR + depends on ACPI_PROCESSOR || ARM || ARM64 select THERMAL default y help diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 0ff1927..da9c8bc 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -42,9 +42,7 @@ * asm/acpi.h is not an option, as it would require more include magic. Also * creating an empty asm-ia64/apic.h would just trade pest vs. cholera. */ -#ifdef CONFIG_X86 #include <asm/apic.h> -#endif
#include <acpi/acpi_bus.h> #include <acpi/processor.h> @@ -119,26 +117,17 @@ static struct dmi_system_id processor_power_dmi_table[] = { */ static void acpi_safe_halt(void) { -#ifdef CONFIG_X86 - /* BOZO: abstract out? */ current_thread_info()->status &= ~TS_POLLING; -#endif /* * TS_POLLING-cleared state must be visible before we * test NEED_RESCHED: */ smp_mb(); if (!need_resched()) { -#ifdef CONFIG_X86 - /* BOZO: abstract out? */ safe_halt(); -#endif local_irq_disable(); } -#ifdef CONFIG_X86 - /* BOZO: abstract out? */ current_thread_info()->status |= TS_POLLING; -#endif }
#ifdef ARCH_APICTIMER_STOPS_ON_C3 @@ -809,10 +798,7 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev, return -EINVAL;
if (cx->entry_method != ACPI_CSTATE_FFH) { -#ifdef CONFIG_X86 - /* BOZO: abstract out? */ current_thread_info()->status &= ~TS_POLLING; -#endif /* * TS_POLLING-cleared state must be visible before we test * NEED_RESCHED: @@ -820,10 +806,7 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev, smp_mb();
if (unlikely(need_resched())) { -#ifdef CONFIG_X86 - /* BOZO: abstract out? */ current_thread_info()->status |= TS_POLLING; -#endif return -EINVAL; } } @@ -843,11 +826,8 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
sched_clock_idle_wakeup_event(0);
-#ifdef CONFIG_X86 - /* BOZO: abstract out? */ if (cx->entry_method != ACPI_CSTATE_FFH) current_thread_info()->status |= TS_POLLING; -#endif
lapic_timer_state_broadcast(pr, cx, 0); return index; @@ -886,10 +866,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, }
if (cx->entry_method != ACPI_CSTATE_FFH) { -#ifdef CONFIG_X86 - /* BOZO: abstract out? */ current_thread_info()->status &= ~TS_POLLING; -#endif /* * TS_POLLING-cleared state must be visible before we test * NEED_RESCHED: @@ -897,18 +874,12 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, smp_mb();
if (unlikely(need_resched())) { -#ifdef CONFIG_X86 - /* BOZO: abstract out? */ current_thread_info()->status |= TS_POLLING; -#endif return -EINVAL; } }
-#ifdef CONFIG_X86 - /* BOZO: abstract out? */ acpi_unlazy_tlb(smp_processor_id()); -#endif
/* Tell the scheduler that we are going deep-idle: */ sched_clock_idle_sleep_event(); @@ -951,11 +922,8 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
sched_clock_idle_wakeup_event(0);
-#ifdef CONFIG_X86 - /* BOZO: abstract out? */ if (cx->entry_method != ACPI_CSTATE_FFH) current_thread_info()->status |= TS_POLLING; -#endif
lapic_timer_state_broadcast(pr, cx, 0); return index; @@ -1216,10 +1184,7 @@ int acpi_processor_power_init(struct acpi_processor *pr)
if (!first_run) { dmi_check_system(processor_power_dmi_table); -#ifdef CONFIG_X86 - /* BOZO: abstract out? */ max_cstate = acpi_processor_cstate_check(max_cstate); -#endif if (max_cstate < ACPI_C_STATES_MAX) printk(KERN_NOTICE "ACPI: processor limited to max C-state %d\n",
On 2013-11-23 6:13, al.stone@linaro.org wrote:
From: Al Stone al.stone@linaro.org
Most of drivers/acpi/processor_idle.c is x86-centric. So, modify the
CONFIG_ACPI_PROCESSOR is not only for processor_idle.c, but also for processor_driver.c processor_throttling.c processor_thermal.c processor_perflib.c
here is the Makefile I copied: [...] obj-$(CONFIG_ACPI_PROCESSOR) += processor.o [...] # processor has its own "processor." module_param namespace processor-y := processor_driver.o processor_throttling.o processor-y += processor_idle.o processor_thermal.o processor-$(CONFIG_CPU_FREQ) += processor_perflib.o
So I think it is too much extension for processor_idle.c.
kernel config so it is not included unless working on an x86 platform.
Signed-off-by: Al Stone al.stone@linaro.org
drivers/acpi/Kconfig | 3 ++- drivers/acpi/processor_idle.c | 35 ----------------------------------- 2 files changed, 2 insertions(+), 36 deletions(-)
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 32ec313..a876bca 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -175,6 +175,7 @@ config ACPI_PROCESSOR select THERMAL select CPU_IDLE default y
- depends on X86 help This driver installs ACPI as the idle handler for Linux and uses ACPI C2 and C3 processor states to save power on systems that
@@ -215,7 +216,7 @@ config ACPI_PROCESSOR_AGGREGATOR config ACPI_THERMAL tristate "Thermal Zone"
- depends on ACPI_PROCESSOR
- depends on ACPI_PROCESSOR || ARM || ARM64
I think it depends on the driver of processor_thermal.c and processor_throttling.c, Thermal Zone can not run properly without such drivers.
I have an idea: we don't change the Kconfig, but change the Makefile,
diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile index 0331f91..f91edee 100644 --- a/drivers/acpi/Makefile +++ b/drivers/acpi/Makefile @@ -75,7 +75,8 @@ obj-$(CONFIG_ACPI_BGRT) += bgrt.o
# processor has its own "processor." module_param namespace processor-y := processor_driver.o processor_throttling.o -processor-y += processor_idle.o processor_thermal.o +processor-y += processor_thermal.o +processor-$(CONFIG_X86) += processor_idle.o processor-$(CONFIG_CPU_FREQ) += processor_perflib.o
obj-$(CONFIG_ACPI_PROCESSOR_AGGREGATOR) += acpi_pad.o
is this make sense to you?
Thanks Hanjun
On 2013-11-27 17:27, Hanjun Guo wrote:
On 2013-11-23 6:13, al.stone@linaro.org wrote:
From: Al Stone al.stone@linaro.org
Most of drivers/acpi/processor_idle.c is x86-centric. So, modify the
CONFIG_ACPI_PROCESSOR is not only for processor_idle.c, but also for processor_driver.c processor_throttling.c processor_thermal.c processor_perflib.c
here is the Makefile I copied: [...] obj-$(CONFIG_ACPI_PROCESSOR) += processor.o [...] # processor has its own "processor." module_param namespace processor-y := processor_driver.o processor_throttling.o processor-y += processor_idle.o processor_thermal.o processor-$(CONFIG_CPU_FREQ) += processor_perflib.o
So I think it is too much extension for processor_idle.c.
kernel config so it is not included unless working on an x86 platform.
Signed-off-by: Al Stone al.stone@linaro.org
drivers/acpi/Kconfig | 3 ++- drivers/acpi/processor_idle.c | 35 ----------------------------------- 2 files changed, 2 insertions(+), 36 deletions(-)
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 32ec313..a876bca 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -175,6 +175,7 @@ config ACPI_PROCESSOR select THERMAL select CPU_IDLE default y
- depends on X86 help This driver installs ACPI as the idle handler for Linux and uses ACPI C2 and C3 processor states to save power on systems that
@@ -215,7 +216,7 @@ config ACPI_PROCESSOR_AGGREGATOR config ACPI_THERMAL tristate "Thermal Zone"
- depends on ACPI_PROCESSOR
- depends on ACPI_PROCESSOR || ARM || ARM64
I think it depends on the driver of processor_thermal.c and processor_throttling.c, Thermal Zone can not run properly without such drivers.
I have an idea: we don't change the Kconfig, but change the Makefile,
diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile index 0331f91..f91edee 100644 --- a/drivers/acpi/Makefile +++ b/drivers/acpi/Makefile @@ -75,7 +75,8 @@ obj-$(CONFIG_ACPI_BGRT) += bgrt.o
# processor has its own "processor." module_param namespace processor-y := processor_driver.o processor_throttling.o -processor-y += processor_idle.o processor_thermal.o +processor-y += processor_thermal.o +processor-$(CONFIG_X86) += processor_idle.o
Sorry, it is not ok. other files will refer to the functions in processor_idle.c, forget this idea.
-Hanjun
On 11/27/2013 02:37 AM, Hanjun Guo wrote:
On 2013-11-27 17:27, Hanjun Guo wrote:
On 2013-11-23 6:13, al.stone@linaro.org wrote:
From: Al Stone al.stone@linaro.org
Most of drivers/acpi/processor_idle.c is x86-centric. So, modify the
CONFIG_ACPI_PROCESSOR is not only for processor_idle.c, but also for processor_driver.c processor_throttling.c processor_thermal.c processor_perflib.c
here is the Makefile I copied: [...] obj-$(CONFIG_ACPI_PROCESSOR) += processor.o [...] # processor has its own "processor." module_param namespace processor-y := processor_driver.o processor_throttling.o processor-y += processor_idle.o processor_thermal.o processor-$(CONFIG_CPU_FREQ) += processor_perflib.o
So I think it is too much extension for processor_idle.c.
kernel config so it is not included unless working on an x86 platform.
Signed-off-by: Al Stone al.stone@linaro.org
drivers/acpi/Kconfig | 3 ++- drivers/acpi/processor_idle.c | 35 ----------------------------------- 2 files changed, 2 insertions(+), 36 deletions(-)
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 32ec313..a876bca 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -175,6 +175,7 @@ config ACPI_PROCESSOR select THERMAL select CPU_IDLE default y
- depends on X86 help This driver installs ACPI as the idle handler for Linux and uses ACPI C2 and C3 processor states to save power on systems that
@@ -215,7 +216,7 @@ config ACPI_PROCESSOR_AGGREGATOR
config ACPI_THERMAL tristate "Thermal Zone"
- depends on ACPI_PROCESSOR
- depends on ACPI_PROCESSOR || ARM || ARM64
I think it depends on the driver of processor_thermal.c and processor_throttling.c, Thermal Zone can not run properly without such drivers.
I have an idea: we don't change the Kconfig, but change the Makefile,
diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile index 0331f91..f91edee 100644 --- a/drivers/acpi/Makefile +++ b/drivers/acpi/Makefile @@ -75,7 +75,8 @@ obj-$(CONFIG_ACPI_BGRT) += bgrt.o
# processor has its own "processor." module_param namespace processor-y := processor_driver.o processor_throttling.o -processor-y += processor_idle.o processor_thermal.o +processor-y += processor_thermal.o +processor-$(CONFIG_X86) += processor_idle.o
Sorry, it is not ok. other files will refer to the functions in processor_idle.c, forget this idea.
-Hanjun
Hrm. What I'm trying to avoid is putting #ifdef's around most of the functions in processor_idle.c....
Back to the drawing board....
I have applied this complete series!
G
On Fri, Nov 22, 2013 at 03:13:08PM -0700, al.stone@linaro.org wrote:
From: Al Stone al.stone@linaro.org
These patches are a bit of all over the place. Each of them cleans up or removes BOZO comments that have been in the ACPI ARM port from the very early days of the port (I inserted the BOZO comments when it was not clear what needed to be done but I could temporarily hack around a problem). Removing each of those had all sorts of different changes needed, from the simplest (the comment turns out to be wrong in hindsight), to stubbing out or even removing functions that make no sense on an ARMv7/v8 platform.
Changes for v2: -- Simplification by using kernel config items to exclude code versus obtuse #ifdef logic
Al Stone (7): ACPI: ARM: make use of an ACPI blob address in FDT /chosen configurable. ACPI: ARM: Clean up a leftover comment that is no longer pertinent. ACPI: ARM: remove x86 acpi_wakeup_address usage when running on ARM ACPI: ARM: remove unnecessary comments ACPI: ARM: cleanup comments and isolate out x86-specific PAD code ACPI: ARM: stub out PCI configuration call for non-PCI systems ACPI: ARM: stub out processor idle routines for use on non-x86 platforms
arch/arm/Kconfig.debug | 11 ++++++ arch/arm/include/asm/acpi.h | 7 ---- arch/arm/include/asm/io.h | 6 +--- arch/arm/include/asm/processor.h | 6 ---- arch/arm64/Kconfig.debug | 11 ++++++ arch/arm64/include/asm/acpi.h | 7 ---- arch/arm64/include/asm/processor.h | 6 ---- drivers/acpi/acpi_pad.c | 15 +++----- drivers/acpi/osl.c | 42 ++++++++++++---------- drivers/acpi/processor_idle.c | 74 +++++++++++++++++++------------------- drivers/acpi/sleep.c | 2 ++ 11 files changed, 91 insertions(+), 96 deletions(-)
-- 1.8.3.1
Al Stone (7): ACPI: ARM: make use of an ACPI blob address in FDT /chosen configurable. ACPI: ARM: Clean up a leftover comment that is no longer pertinent. ACPI: ARM: remove x86 acpi_wakeup_address usage when running on ARM ACPI: ARM: remove unnecessary comments ACPI: ARM: clean up comments and disable PAD code for ARM ACPI: ARM: stub out PCI configuration call for non-PCI systems ACPI: ARM: disable x86-specific processor idle code
arch/arm/Kconfig.debug | 11 ++++++++++ arch/arm/include/asm/acpi.h | 5 ----- arch/arm/include/asm/io.h | 6 +----- arch/arm/include/asm/processor.h | 6 ------ arch/arm64/Kconfig.debug | 11 ++++++++++ arch/arm64/include/asm/acpi.h | 5 ----- arch/arm64/include/asm/processor.h | 6 ------ drivers/acpi/Kconfig | 5 +++-- drivers/acpi/acpi_pad.c | 17 --------------- drivers/acpi/osl.c | 42 ++++++++++++++++++++++---------------- drivers/acpi/processor_idle.c | 35 ------------------------------- 11 files changed, 50 insertions(+), 99 deletions(-)
-- 1.8.3.1
Linaro-acpi mailing list Linaro-acpi@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-acpi