* pm-cpufreq:
intel_pstate: skip the driver if ACPI has power mgmt option
cpufreq: ondemand: Remove redundant return statement
cpufreq: move freq change notifications to cpufreq core
cpufreq: distinguish drivers that do asynchronous notifications
cpufreq/intel_pstate: Add static declarations to internal functions
cpufreq: arm_big_little: reconfigure switcher behavior at run time
cpufreq: arm_big_little: add in-kernel switching (IKS) support
ARM: vexpress/TC2: register vexpress-spc cpufreq device
cpufreq: arm_big_little: add vexpress SPC interface driver
ARM: vexpress/TC2: add cpu clock support
ARM: vexpress/TC2: add support for CPU DVFS
* pm-cpuidle:
ARM: EXYNOS: Remove incorrect __init annotation from cpuidle driver
ARM: EXYNOS: Use dev_err() instead of printk() for cpuidle driver
intel_idle: use CPU_TASKS_FROZEN instead of a numeric constant
cpuidle: remove cpuidle_unregister_governor()
cpuidle: don't call poll_idle_init() for every cpu
cpuidle: use drv instead of cpuidle_driver in show_current_driver()
cpuidle: call cpuidle_get_driver() from after taking cpuidle_driver_lock
cpuidle: replace multiline statements with single line in cpuidle_idle_call()
cpuidle: reduce code duplication inside cpuidle_idle_call()
cpuidle: merge two if() statements for checking error cases
cpuidle: rearrange __cpuidle_register_device() to keep minimal exit points
cpuidle: rearrange code in __cpuidle_driver_init()
cpuidle: make __cpuidle_driver_init() return void
cpuidle: make __cpuidle_device_init() return void
cpuidle: Fix comments in cpuidle core
cpuidle: fix indentation of cpumask
It turned out other systems also share the same problem with bug 63111
so I made a patch to catch initial brightness level 0 problem. With that
patch applied, we do not need to place HP 250 G1 in DMI table.
References: https://bugzilla.kernel.org/show_bug.cgi?id=63111 Signed-off-by: Aaron Lu <aaron.lu@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Aaron Lu [Wed, 6 Nov 2013 01:07:10 +0000 (09:07 +0800)]
ACPI / video: Quirk initial backlight level 0
Some firmware doesn't initialize initial backlight level to a proper
value and _BQC will return 0 on first time evaluation. We used to be
able to detect such incorrect value with our code logic, as value 0
normally isn't a valid value in _BCL. But with the introduction of Win8,
firmware begins to fill _BCL with values from 0 to 100, now 0 becomes
a valid value but that value will make user's screen black. This patch
test initial _BQC for value 0, if such a value is returned, do not use
it.
References: https://bugzilla.kernel.org/show_bug.cgi?id=64031
References: https://bugzilla.kernel.org/show_bug.cgi?id=61231
References: https://bugzilla.kernel.org/show_bug.cgi?id=63111 Reported-by: Qingshuai Tian <qingshuai.tian@intel.com> Tested-by: Aaron Lu <aaron.lu@intel.com> # on "Idealpad u330p" Reported-and-tested-by: <erno@iki.fi> # on "Acer Aspire V5-573G" Reported-and-tested-by: Kirill Tkhai <tkhai@yandex.ru> # on "HP 250 G1" Signed-off-by: Aaron Lu <aaron.lu@intel.com> Cc: All applicable <stable@vger.kernel.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Adrian Huang [Thu, 31 Oct 2013 15:24:05 +0000 (23:24 +0800)]
intel_pstate: skip the driver if ACPI has power mgmt option
Do not load the Intel pstate driver if the platform firmware
(ACPI BIOS) supports the power management alternatives.
The ACPI BIOS indicates that the OS control mode can be used
if the _PSS (Performance Supported States) is defined in ACPI
table. For the OS control mode, the Intel pstate driver will be
loaded.
HP BIOS has several power management modes (firmware, OS-control and
so on). For the OS control mode in HP BIOS, the Intel p-state driver
will be loaded. When the customer chooses the firmware power
management in HP BIOS, the Intel p-state driver will be ignored.
I put hw_vendor_info vendor_info in case other vendors (Dell, Lenovo...)
have their firmware power management. Vendors should make sure their
firmware power management works properly, and they can go for adding
their vendor info to the variable.
I have verified the patch on HP ProLiant servers. The patch worked
correctly.
Signed-off-by: Adrian Huang <adrianhuang0701@gmail.com>
[rjw: Fixed up !CONFIG_ACPI build]
[Linda Knippers: As Adrian has recently left HP, I retested the
updated patch on an HP ProLiant server and verified that it is
behaving correctly. When the BIOS is configured for OS control for
power management, the intel_pstate driver loads as expected. When
the BIOS is configured to provide the power management, the
intel_pstate driver does not load and we get the pcc_cpufreq driver
instead.] Signed-off-by: Linda Knippers <linda.knippers@hp.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Lv Zheng [Thu, 31 Oct 2013 01:31:24 +0000 (09:31 +0800)]
ACPICA: Add __init for ACPICA initializers/finalizers.
This patch adds __init to the ACPICA documented initializers:
acpi_initialize_tables()
acpi_initialize_subsystem()
acpi_load_tables()
acpi_enable_subsystem()
acpi_initialize_objects()
and to acpi_reallocate_root_table(), acpi_find_root_pointer() which
are also meant to be called only during initialization.
This patch adds __init to the ACPICA documented finalizer:
acpi_terminate()
as this finalizer is only called in __init function now.
This change helps to reduce source code differences between
ACPICA upstream and Linux.
[rjw: Changelog] Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Lv Zheng [Thu, 31 Oct 2013 01:31:18 +0000 (09:31 +0800)]
ACPICA: Cleanup asmlinkage for ACPICA APIs.
Add an asmlinkage wrapper around acpi_enter_sleep_state() to prevent
an empty stub from being called by assmebly code for ACPI_REDUCED_HARDWARE
set.
As arch/x86/kernel/acpi/wakeup_xx.S is only compiled when CONFIG_ACPI=y
and there are no users of ACPI_HARDWARE_REDUCED, currently this is in
fact not a real issue, but a cleanup to reduce source code differences
between Linux and ACPICA upstream.
[rjw: Changelog] Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Lv Zheng [Thu, 31 Oct 2013 01:31:00 +0000 (09:31 +0800)]
ACPICA: Fix cached object deletion code.
Function acpi_ut_delete_caches() is meant to be used to implement
ACPI_ALLOCATE()/ACPI_FREE() mechanisms in ACPICA, so it should call
acpi_os_free() rather than ACPI_FREE(). Linux is not affected by this
issue as it uses kmem_cache instead of the ACPICA local cache, but
the change helps to reduce source code differences between Linux and
ACPICA upstream.
[rjw: Changelog] Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Lv Zheng [Thu, 31 Oct 2013 01:30:53 +0000 (09:30 +0800)]
ACPICA: Remove dead AOPOBJ_INVALID check.
Reversion commit 7cb7f45c7fee (Revert "ACPICA: Remove obsolete
acpi_os_validate_address interface") restored a piece of dead code
related to an obselete AOPOBJ_INVALID flag. Remove that code again.
This helps to reduce source code differences between Linux and ACPICA
upstream.
[rjw: Changelog] Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Lv Zheng [Thu, 31 Oct 2013 01:30:48 +0000 (09:30 +0800)]
ACPICA: Cleanup useless memset invocations.
This patch removes unnecessary memset() invocations where
kmem_cache_zalloc() is used for allocating memory. It also helps to
reduce source code differences between ACPICA upstream and Linux.
[rjw: Changelog] Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Lv Zheng [Thu, 31 Oct 2013 01:30:28 +0000 (09:30 +0800)]
ACPICA: Add new statistics interface.
This patch ports new counters and statistics interface, already
implemented in ACPICA upstream, to Linux. That helps to reduce
source code differences between Linux and ACPICA upstream.
[rjw: Changelog] Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Lv Zheng [Thu, 31 Oct 2013 01:30:22 +0000 (09:30 +0800)]
ACPICA: Update DMAR table definitions.
This patch updates DMAR table header definitions as such enhancement
has been made in ACPICA upstream already. It ports that change to
the Linux source to reduce source code differences between Linux and
ACPICA upstream.
Build test done on x86-64 machine with the following configs enabled:
CONFIG_DMAR_TABLE
CONFIG_IRQ_REMAP
CONFIG_INTEL_IOMMU
This patch does not affect the generation of the Linux kernel binary.
[rjw: Changelog] Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Lv Zheng [Thu, 31 Oct 2013 01:30:16 +0000 (09:30 +0800)]
ACPICA: Update RSDP table definitions.
This patch updates RSDP table header definitions as such enhancement
has been made in ACPICA upstream already. It ports that change to
the Linux source to reduce source code differences between Linux and
ACPICA upstream.
This patch does not affect the generation of the Linux kernel binary.
[rjw: Changelog] Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Lv Zheng [Thu, 31 Oct 2013 01:30:10 +0000 (09:30 +0800)]
ACPICA: Update namespace dump code.
This patch merges namespace dump code updates from ACPICA upstream to
reduce the source code differences between Linux and ACPICA upstream. No
functional changes as currently nsdumpdv.c is not used by Linux.
This patch does not affect the generation of the Linux kernel binary.
Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Lv Zheng [Thu, 31 Oct 2013 01:30:04 +0000 (09:30 +0800)]
ACPICA: Update check for setting the ANOBJ_IS_EXTERNAL flag.
The ANOBJ_IS_EXTERNAL flag is only used by an ACPICA utilities - iASL.
No functional change for the Linux kernel should results from applying
this patch, but it helps to reduce source code differences between
the kernel and ACPICA upstream.
[rjw: Subject and changelog] Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Lv Zheng [Thu, 31 Oct 2013 01:29:49 +0000 (09:29 +0800)]
ACPICA: Update default space handlers.
This patch adds code that is already in ACPICA upstream, so applying
it can help to reduce the source code differences between Linux and
ACPICA upstream.
This code fragment is only useful for ACPICA utilities and no
functional changes to the Linux kernel should result from it.
[rjw: Changelog] Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Lv Zheng [Tue, 29 Oct 2013 01:30:41 +0000 (09:30 +0800)]
ACPICA: Update aclinux.h for new OSL override mechanism.
The new ACPICA OSL override mechanism is used to solve these issues
for the Linux OSL:
1. Linux can implement OSL using a macro.
2. Linux can implement OSL using an inlined function.
3. Linux can leave OSL not implemented for __KERNEL__ undefined code
fragments.
4. Linux can add sparse declarators (__iomem) to OSL.
5. Linux can add memory tuning declarators (__init/__exit) to OSL.
This patch also moves Linux specific OSL to aclinux.h which has not been
maintained in the ACPICA code base. Lv Zheng.
Known issue:
From ACPICA's perspective, actypes.h should be included after inclusion
of acenv.h. But currently in Linux, aclinux.h included by acenv.h has
included actypes.h to find ACPICA types for inline functions. This is a
known and existing issue and currently there is no real problem caused
by this issue for Linux kernel build. Thus this issue is not covered by
this cleanup commit.
Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Lv Zheng [Tue, 29 Oct 2013 01:30:35 +0000 (09:30 +0800)]
ACPICA: Add support to allow host OS to redefine individual OSL prototypes.
This change enables the host OS to redefine OSL prototypes found in the
acpiosxf.h file. This allows the host OS to implement OSL interfaces with
a macro or inlined function. Further, it allows the host OS to add any
additional required modifiers such as __iomem, __init, __exit, etc.,
as necessary on a per-interface basis. Enables maximum flexibility
for the OSL interfaces. Lv Zheng.
Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Bob Moore [Tue, 29 Oct 2013 01:30:29 +0000 (09:30 +0800)]
ACPICA: Simplify configuration of global ACPI_REDUCED_HARDWARE macro.
Surround definition of this with a #ifndef so that the kernel
can define it elsewhere if desired.
Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Lv Zheng [Tue, 29 Oct 2013 01:30:22 +0000 (09:30 +0800)]
ACPICA: Fix indentation issues for macro invocations.
During the automatic translation of the upstream ACPICA source code
into Linux kernel source code some extra white spaces are added by
the "indent" program at the beginning of each line which is an
invocation of a macro and there is no ";" at the end of the line.
For this reason, a new mode has been added to the translation scripts
to remove the extra spaces inserted before invoking such macros and add
an empty line between the invocations of such macros (like the other
function declarations). This new mode is executed after executing
"indent" during the Linux release process. Consequently, some
existing ACPICA source code in the Linux kernel tree needs to be
adjusted to allow the new scripts to work correctly.
The affected macros and files are:
1. ACPI_HW_DEPENDENT_RETURN (acpixf.h/acdebug.h/acevents.h):
This macro is used as a wrapper for hardware dependent APIs to offer
a stub when the reduced hardware is configured during compilation.
2. ACPI_EXPORT_SYMBOL (utglobal.c):
This macro is used by Linux to export symbols to be found by Linux
modules. All such invocations are well formatted except those
exported as global variables.
This can help to reduce the source code differences between Linux
and upstream ACPICA, and also help to automate the release process.
No functional or binary generation changes should result from it.
Lv Zheng.
[rjw: Changelog] Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Lv Zheng [Tue, 29 Oct 2013 01:30:16 +0000 (09:30 +0800)]
ACPICA: Prevent possible build issues for use of ACPI_PRINTF_LIKE macro
The following build error:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CC arch/x86/kernel/setup.o
In file included from include/acpi/acpi.h:64:0,
from include/linux/iscsi_ibft.h:24,
from arch/x86/kernel/setup.c:43:
include/acpi/acpixf.h:543:1: error: expected ',' or ';' before '{' token
include/acpi/acpixf.h:540:1: warning: 'acpi_error' declared 'static' but never defined [-Wunused-function]
make[2]: *** [arch/x86/kernel/setup.o] Error 1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
can be triggerred by the following stub function (if implemented):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
static inline void ACPI_INTERNAL_VAR_XFACE
acpi_error(const char *module_name,
u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3)
{
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This patch changes the position of ACPI_PRINTF_LIKE(x) to follow the
style of __printf(x, x+1) used in Linux to prevent such issues from
happening. Lv Zheng.
Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Lv Zheng [Tue, 29 Oct 2013 01:30:10 +0000 (09:30 +0800)]
ACPICA: Deploy ACPI_EXPORT_SYMBOL_INIT for main ACPICA initialization interfaces.
This changes can reduce source code differences between Linux and ACPICA
upstream to help improving the release automation.
The side effect of applying this patch in Linux is:
1. Some ACPICA initialization/termination APIs are no longer exported in
Linux, these include:
acpi_load_tables
acpi_initialize_subsystem
acpi_enable_subsystem
acpi_initialize_objects
acpi_terminate
2. This patch does not affect the following APIs as they are currently not
marked with ACPI_EXPORT_SYMBOL in Linux:
acpi_reallocate_root_table
acpi_initialize_tables
Such functions should not be exported as they are internal to ACPI
subsystem in Linux, and will only be invoked inside of ACPI subsystem's
initialization routines marked with __init and termination routines marked
with __exit. While on other OSPMs, such functions may still need to be
exported.
Thus this patch adds the configurability for ACPICA, so that it leaves
OSPMs to determine if the __init/__exit marked functions should be exported
or not. Lv Zheng.
Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Lv Zheng [Tue, 29 Oct 2013 01:30:02 +0000 (09:30 +0800)]
ACPICA: Linuxize: Change indentation of C labels.
It is reported by kernel build test systems that all ACPICA source
files in the kernel tree have incorrect label indentation. This
patch changes default indent option used in the release process to
fix this bug. Lv Zheng.
Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Bob Moore [Tue, 29 Oct 2013 01:29:57 +0000 (09:29 +0800)]
ACPICA: Clarify ACPI_FREE_BUFFER usage.
Add a comment to clarify reason for using ACPI_FREE_BUFFER directly
instead of ACPI_FREE.
In addition to that, change one instance in which ACPI_FREE_BUFFER()
should be used instead of ACPI_FREE().
[rjw: Subject and changelog] Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Lv Zheng [Tue, 29 Oct 2013 01:29:51 +0000 (09:29 +0800)]
ACPICA: Add EXPORT_ACPI_INTERFACES macro to external interface modules.
For Linux, there are no functional changes/binary generation differences
introduced by this patch.
This change adds a new macro to all files that contain external ACPICA
interfaces. It can be detected and used by the host (via the host-specific
header) for any special processing required for such modules. Lv Zheng.
Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This is replicated over all cpufreq drivers today and there doesn't exists a
good enough reason why this shouldn't be moved to cpufreq core instead.
There are few special cases though, like exynos5440, which doesn't do everything
on the call to ->target_index() routine and call some kind of bottom halves for
doing this work, work/tasklet/etc..
They may continue doing notification from their own code as flag:
CPUFREQ_ASYNC_NOTIFICATION is already set for them.
All drivers are also modified in this patch to avoid breaking 'git bisect', as
double notification would happen otherwise.
Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no> Acked-by: Jesper Nilsson <jesper.nilsson@axis.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Russell King <linux@arm.linux.org.uk> Acked-by: Stephen Warren <swarren@nvidia.com> Tested-by: Andrew Lunn <andrew@lunn.ch> Tested-by: Nicolas Pitre <nicolas.pitre@linaro.org> Reviewed-by: Lan Tianyu <tianyu.lan@intel.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Viresh Kumar [Tue, 29 Oct 2013 13:26:06 +0000 (18:56 +0530)]
cpufreq: distinguish drivers that do asynchronous notifications
There are few special cases like exynos5440 which doesn't send POSTCHANGE
notification from their ->target() routine and call some kind of bottom halves
for doing this work, work/tasklet/etc.. From which they finally send POSTCHANGE
notification.
Its better if we distinguish them from other cpufreq drivers in some way so that
core can handle them specially. So this patch introduces another flag:
CPUFREQ_ASYNC_NOTIFICATION, which will be set by such drivers.
This also changes exynos5440-cpufreq.c and powernow-k8 in order to set this
flag.
Acked-by: Amit Daniel Kachhap <amit.daniel@samsung.com> Acked-by: Kukjin Kim <kgene.kim@samsung.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Dirk Brandewie [Wed, 30 Oct 2013 15:38:32 +0000 (08:38 -0700)]
cpufreq/intel_pstate: Add static declarations to internal functions
Fixes warnings reported by kbuild test robot
sparse warnings: (new ones prefixed by >>)
drivers/cpufreq/intel_pstate.c:729:6: sparse: symbol 'copy_pid_params' was not declared. Should it be static?
drivers/cpufreq/intel_pstate.c:739:6: sparse: symbol 'copy_cpu_funcs' was not declared. Should it be static?
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Nicolas Pitre [Wed, 30 Oct 2013 19:44:41 +0000 (15:44 -0400)]
cpufreq: arm_big_little: reconfigure switcher behavior at run time
The b.L switcher can be turned on/off at run time. It is therefore
necessary to change the cpufreq driver behavior accordingly.
The driver must be unregistered/registered with the cpufreq core
to reconfigure freq tables for the virtual or actual CPUs. This is
accomplished via the b.L switcher notifier callback.
Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Viresh Kumar [Wed, 30 Oct 2013 19:44:40 +0000 (15:44 -0400)]
cpufreq: arm_big_little: add in-kernel switching (IKS) support
This patch adds IKS (In Kernel Switcher) support to cpufreq driver.
This creates a combined freq table for A7-A15 CPU pairs. A7 frequencies
are virtualized and scaled down to half the actual frequencies to
approximate a linear scale across the combined A7+A15 range. When the
requested frequency change crosses the A7-A15 boundary a cluster switch
is invoked.
Based on earlier work from Sudeep KarkadaNagesha.
Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Nicolas Pitre <nico@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Jingoo Han [Mon, 21 Oct 2013 01:53:03 +0000 (10:53 +0900)]
ARM: EXYNOS: Remove incorrect __init annotation from cpuidle driver
When platform_driver_probe() is not used, bind/unbind via sysfs is
enabled. Thus, __init annotation should be removed from probe().
Also, this patch fixes section mismatch warning.
Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Bob Moore [Tue, 29 Oct 2013 01:29:45 +0000 (09:29 +0800)]
ACPICA: Hardcode access width for the reset register.
The ACPI spec requires the reset register width to be 8, so we
now hardcode it and ignore the FADT value. This provides/maintains
compatibility with other ACPI implementations that have allowed
BIOS code with bad register width values to go unnoticed.
Matthew Garett, Bob Moore, Lv Zheng.
Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Lv Zheng [Tue, 29 Oct 2013 01:29:40 +0000 (09:29 +0800)]
ACPICA: Fix possible memory leaks in the GPE handling.
This change fixes potential memory leaks in the error paths of the GPE
handling code. Lv Zheng.
Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Bob Moore [Tue, 29 Oct 2013 01:29:34 +0000 (09:29 +0800)]
ACPICA: Predefine name macros: Sort list.
Sort the method names in acnames.h.
Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Lv Zheng [Tue, 29 Oct 2013 01:29:27 +0000 (09:29 +0800)]
ACPICA: Cleanup memory allocation macros and configurability.
In the common case, the ACPI_ALLOCATE and related macros now resolve
directly to their respective acpi_os* OSL interfaces. Two options:
1) The ACPI_ALLOCATE_ZEROED macro defaults to a simple local implementation
by default, unless overridden by the USE_NATIVE_ALLOCATE_ZEROED define.
2) For ACPI execution simulation environment (AcpiExec) which is not
shipped with the Linux kernel, the macros can optionally be resolved to
the local interfaces that track each allocation (used to immediately
detect memory leaks).
Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Bob Moore [Tue, 29 Oct 2013 01:29:21 +0000 (09:29 +0800)]
ACPICA: Add safe versions of common string functions.
This change adds and deploys "safe" versions of strcpy and strcat that
ensure that the target buffer does not overflow. These safe functions
are only helpful for processing user input and command lines. For most
ACPICA code however, the required buffer length is precisely calculated
before buffer allocation, so the use of these functions is unnecessary.
ACPICA BZ 1043.
This change only applies to the ACPICA utilities and the debugger, none
of which are not shipped with the kernel yet, so the kernel's behavior
remains unchanged after it.
References: https://bugs.acpica.org/show_bug.cgi?id=1043 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Bob Moore [Tue, 29 Oct 2013 01:29:16 +0000 (09:29 +0800)]
ACPICA: Fix a macro for the hardware-reduced case
This fix repairs a version of a macro that is used for the hardware
reduced case only. It adds a return statement to the macro definition
so that the translation into the Linux kernel source will not completely
delete the second line of the macro because it thinks that it is an empty
block. It actually clarifies the use of the macro anyway.
Reported-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Bob Moore [Tue, 29 Oct 2013 01:29:09 +0000 (09:29 +0800)]
ACPICA: Add history/line-editing for Unix/Linux systems.
The original upstream ACPICA change added full history and limited
line editing to the debugger:
This change adds full history and limited line editing for Unix and
Linux systems. It does not use readline() because of portability issues.
Instead it uses the POSIX termio interface to put the terminal in raw
input mode so that the various special keys can be trapped (such as
up-arrow and down-arrow for history support).
Since the debugger is not shipped in the kernel, it only is necessary
to update one header file to keep the kernel source in sync with the
upstream.
[rjw: Changelog] Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Bob Moore [Tue, 29 Oct 2013 01:29:04 +0000 (09:29 +0800)]
ACPICA: Add a check for a null node during namespace walk.
Mostly for consistency. ACPICA BZ 1042.
Actually, currently no one is experiencing problem without this check
as the obj_handle is guaranteed to be valid.
References: https://bugs.acpica.org/show_bug.cgi?id=1042 Reported-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This change increases the default width for the length of tables from
5 to 6, to improve alignment/readability on systems with large tables.
These are being seen more frequently, especially large DSDTs (greater
than 1 MB).
Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tomasz Nowicki [Tue, 29 Oct 2013 01:28:49 +0000 (09:28 +0800)]
ACPICA: Ensure that debug output is immediately disabled on termination.
Set the global debug flag to "no output" when the debugger is shutdown.
ACPICA BZ 1011. Tomasz Nowicki.
Since the debugger is not shipped in the Linux kernel upstream, this
change doesn't affect Linux kernel's behavior.
References: https://bugs.acpica.org/show_bug.cgi?id=1011 Signed-off-by: Tomasz Nowicki <tomasz.nowicki@linaro.org> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Viresh Kumar [Thu, 3 Oct 2013 15:56:55 +0000 (21:26 +0530)]
cpuidle: remove cpuidle_unregister_governor()
cpuidle_unregister_governor() and cpuidle_replace_governor() aren't
used anymore and can be removed. They were used by cpufreq governors
earlier, but since the governors can't be compiled as modules any
more, these two functions aren't necessary.
Suggested-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Viresh Kumar [Thu, 3 Oct 2013 15:56:54 +0000 (21:26 +0530)]
cpuidle: don't call poll_idle_init() for every cpu
poll_idle_init() just initializes drv->states[0] and so that is
required to be done only once for each driver. Currently, it is
called from cpuidle_enable_device() which is called for every CPU
that the driver supports. That is not required, so move it to a
better place and call it from __cpuidle_register_driver() so that
the initialization is carried out only once.
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Viresh Kumar [Thu, 3 Oct 2013 15:56:51 +0000 (21:26 +0530)]
cpuidle: use drv instead of cpuidle_driver in show_current_driver()
Instances of "struct cpuidle_driver *" are consistently named as "drv"
in the cpuidle core except in show_current_driver().
Make that function use variable naming consistent with the rest of the
code.
[rjw: Changelog] Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Viresh Kumar [Thu, 3 Oct 2013 15:56:50 +0000 (21:26 +0530)]
cpuidle: call cpuidle_get_driver() from after taking cpuidle_driver_lock
There are a few cpuidle_get_driver() calls that aren't made under
cpuidle_driver_lock which is incorrect.
Fix them by calling cpuidle_get_driver() after taking cpuidle_driver_lock.
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
We are doing this twice in cpuidle_idle_call() routine:
drv->states[next_state].flags & CPUIDLE_FLAG_TIMER_STOP
Would be better if we actually store this in a local variable and
use that. That reduces code duplication and likely makes this piece
of code run faster (in case the compiler wasn't able to optimize it
earlier)
[rjw: Cast the result of bitwise AND to bool explicitly using !!] Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Viresh Kumar [Thu, 3 Oct 2013 15:56:47 +0000 (21:26 +0530)]
cpuidle: merge two if() statements for checking error cases
Two checks cpuidle_idle_call() cause the same error code to be
returned if they fail, so merge them for clarity.
[rjw: Changelog] Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Viresh Kumar [Thu, 3 Oct 2013 15:56:45 +0000 (21:26 +0530)]
cpuidle: rearrange code in __cpuidle_driver_init()
This is trivial patch that just reorders a few statements in
__cpuidle_driver_init() routine so that we don't need both 'continue'
and 'break' in the for loop. Functionally it shouldn't change anything.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
The TC2(i.e. CA15_A7) Versatile Express has external Cortex M3 based
power controller which is responsible for CPU DVFS and SPC provides
the interface for the same.
This patch adds a tiny interface driver to check if OPPs are
initialised by SPC platform code and register the arm_big_little
cpufreq driver.
Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com> Acked-by: Nicolas Pitre <nico@linaro.org> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
On TC2, the cpu clocks are controlled by the external M3 microcontroller
and SPC provides the interface between the CPU and the power controller.
The generic cpufreq drivers use the clock APIs to get the cpu clocks.
This patch add virtual spc clocks for all the cpus to control the cpu
operating frequency via the clock framework.
Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com> Acked-by: Nicolas Pitre <nico@linaro.org> Acked-by: Pawel Moll <Pawel.Moll@arm.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
SPC(Serial Power Controller) on TC2 also controls the CPU performance
operating points which is essential to provide CPU DVFS. The M3
microcontroller provides two sets of eight performance values, one set
for each cluster (CA15 or CA7). Each of this value contains the
frequency(kHz) and voltage(mV) at that performance level. It expects
these performance level to be passed through the SPC PERF_LVL registers.
This patch adds support to populate these performance levels from M3,
build the mapping to CPU OPPs at the boot and then use it to get and
set the CPU performance level runtime.
Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com> Acked-by: Nicolas Pitre <nico@linaro.org> Acked-by: Pawel Moll <Pawel.Moll@arm.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPI / processor: Do not request ACPI cpufreq module directly
Function acpi_processor_load_module() used by the ACPI processor
driver can only really work if the acpi-cpufreq module is available
when acpi_processor_start() is executed which usually is not the case
for systems loading the processor driver module from an initramfs.
Moreover, that used to be a hackish workaround for module autoloading
issues, but udev loads acpi-cpufreq just fine nowadays, so that
function isn't really necessary any more. For this reason, drop
acpi_processor_load_module() entirely.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* pm-cpufreq: (167 commits)
cpufreq: create per policy rwsem instead of per CPU cpu_policy_rwsem
intel_pstate: Add Baytrail support
intel_pstate: Refactor driver to support CPUs with different MSR layouts
cpufreq: Implement light weight ->target_index() routine
PM / OPP: rename header to linux/pm_opp.h
PM / OPP: rename data structures to dev_pm equivalents
PM / OPP: rename functions to dev_pm_opp*
cpufreq / governor: Remove fossil comment
cpufreq: exynos4210: Use the common clock framework to set APLL clock rate
cpufreq: exynos4x12: Use the common clock framework to set APLL clock rate
cpufreq: Detect spurious invocations of update_policy_cpu()
cpufreq: pmac64: enable cpufreq on iMac G5 (iSight) model
cpufreq: pmac64: provide cpufreq transition latency for older G5 models
cpufreq: pmac64: speed up frequency switch
cpufreq: highbank-cpufreq: Enable Midway/ECX-2000
exynos-cpufreq: fix false return check from "regulator_set_voltage"
speedstep-centrino: Remove unnecessary braces
acpi-cpufreq: Add comment under ACPI_ADR_SPACE_SYSTEM_IO case
cpufreq: arm-big-little: use clk_get instead of clk_get_sys
cpufreq: exynos: Show a list of available frequencies
...
* pm-cpuidle:
ARM: AT91: DT: pm: Select ram controller standby based on DT
ARM: AT91: pm: Factorize standby function
ARM: at91: cpuidle: Move driver to drivers/cpuidle
ARM: at91: cpuidle: Convert to platform driver
ARM: ux500: cpuidle: fix section mismatch
ARM: zynq: cpuidle: convert to platform driver
ARM: zynq: cpuidle: Remove useless compatibility string
drivers: cpuidle: rename ARM big.LITTLE driver config and makefile entries
ARM: EXYNOS: convert cpuidle driver to be a platform driver
intel_idle: mark some functions with __init tag
intel_idle: mark states tables with __initdata tag
intel_idle: shrink states tables
* powercap:
PowerCap: Convert class code to use dev_groups
PowerCap: Introduce Intel RAPL power capping driver
bitops: Introduce BIT_ULL
x86 / msr: add 64bit _on_cpu access functions
PowerCap: Add to drivers Kconfig and Makefile
PowerCap: Add class driver
PowerCap: Documentation
* acpi-assorted:
ACPI: Add Toshiba NB100 to Vista _OSI blacklist
ACPI / osl: remove an unneeded NULL check
ACPI / platform: add ACPI ID for a Broadcom GPS chip
ACPI: improve acpi_extract_package() utility
ACPI / LPSS: fix UART Auto Flow Control
ACPI / platform: Add ACPI IDs for Intel SST audio device
x86 / ACPI: fix incorrect placement of __initdata tag
ACPI / thermal: convert printk(LEVEL...) to pr_<lvl>
ACPI / sysfs: make GPE sysfs attributes only accept correct values
ACPI / EC: Convert all printk() calls to dynamic debug function
ACPI / button: Using input_set_capability() to mark device's event capability
ACPI / osl: implement acpi_os_sleep() with msleep()
* acpi-video:
ACPI: Add Toshiba NB100 to Vista _OSI blacklist
ACPI / video: Ignore BIOS initial backlight value for HP 250 G1
ACPI / video: Add Lenovo IdeaPad Yoga 13 to acpi video detect blacklist
thinkpad-acpi: fix handle locate for video and query of _BCL
ACPI / video: Do not register backlight if win8 and native interface exists
ACPI / video: seperate backlight control and event interface
backlight: introduce backlight_device_registered
ACPI: add missing win8 OSI comment to blacklist
ACPI: update win8 OSI blacklist
* acpi-pm:
spi: attach/detach SPI device to the ACPI power domain
i2c: attach/detach I2C client device to the ACPI power domain
ACPI / PM: allow child devices to ignore parent power state
* acpica:
MAINTAINERS / ACPICA: Add ACPICA information to MAINTAINERS
ACPICA: Update version to 20130823.
ACPICA: SCI Handlers: Update handler interface, eliminate unnecessary argument.
ACPICA: Cleanup exception codes.
ACPICA: Tables: Cleanup RSDP signature codes.
ACPICA: Tables: Cleanup table checksum verification code.
ACPICA: Debugger: Add new command to display full namespace pathnames.
ACPICA: Operation region support: Never free the handler "context" pointer.
ACPICA: Add support for host-installed SCI handlers.
ACPICA: Validate start object for acpi_walk_namespace.
ACPICA: Debugger: Prevent possible command line buffer overflow, kernel behavior is not affected.
ACPICA: Linux-specific header: enable "aarch64" 64-bit build.
ACPICA: Debug output: small formatting update, no functional change.
ACPICA: acpi_read: On error, do not modify the return value target location.
ACPICA: Improve error message for "too many parent prefixes" condition.
* acpi-conversion:
ACPI / AC: Remove AC's proc directory.
ideapad_laptop: convert ideapad device/driver to platform bus
ideapad_laptop: remove ideapad_handle and ideapad_priv
ideapad_laptop: convert internal function calls to use ideapad_private as parameter
ideapad_laptop: introduce struct acpi_device pointer to ideapad_private structure
ideapad_laptop: introduce #ifdef CONFIG_PM_SLEEP for PM specific code
ACPI / AC: convert ACPI ac driver to platform bus
* acpi-hotplug:
ACPI / memhotplug: Use defined marco METHOD_NAME__STA
ACPI / hotplug: Use kobject_init_and_add() instead of _init() and _add()
ACPI / hotplug: Don't set kobject parent pointer explicitly
ACPI / hotplug: Set kobject name via kobject_add(), not kobject_set_name()
hotplug, powerpc, x86: Remove cpu_hotplug_driver_lock()
hotplug / x86: Disable ARCH_CPU_PROBE_RELEASE on x86
hotplug / x86: Add hotplug lock to missing places
hotplug / x86: Fix online state in cpu0 debug interface