19 Sep, 2013

1 commit

  • Commit f837a9b5ab05c52a07108c6f09ca66f2e0aee757 "cpufreq: cpufreq-cpu0:
    remove device tree parsing for cpu nodes" assumed the pdev->dev is set to
    cpu0 device in the platform code. But it actually points to the virtual
    cpufreq-cpu0 platform device which is not present in the device tree.
    Most of the information needed by cpufreq is stored in cpu0 DT node.
    So cpu_dev must point to cpu0 device.

    This patch fixes the wrong assignment to cpu_dev.

    Reported-and-tested-by: Guennadi Liakhovetski
    Cc: Shawn Guo
    Signed-off-by: Sudeep KarkadaNagesha
    Signed-off-by: Rafael J. Wysocki

    Sudeep KarkadaNagesha
     

04 Sep, 2013

1 commit

  • Pull ACPI and power management updates from Rafael Wysocki:

    1) ACPI-based PCI hotplug (ACPIPHP) subsystem rework and introduction
    of Intel Thunderbolt support on systems that use ACPI for signalling
    Thunderbolt hotplug events. This also should make ACPIPHP work in
    some cases in which it was known to have problems. From
    Rafael J Wysocki, Mika Westerberg and Kirill A Shutemov.

    2) ACPI core code cleanups and dock station support cleanups from
    Jiang Liu and Rafael J Wysocki.

    3) Fixes for locking problems related to ACPI device hotplug from
    Rafael J Wysocki.

    4) ACPICA update to version 20130725 includig fixes, cleanups, support
    for more than 256 GPEs per GPE block and a change to make the ACPI
    PM Timer optional (we've seen systems without the PM Timer in the
    field already). One of the fixes, related to the DeRefOf operator,
    is necessary to prevent some Windows 8 oriented AML from causing
    problems to happen. From Bob Moore, Lv Zheng, and Jung-uk Kim.

    5) Removal of the old and long deprecated /proc/acpi/event interface
    and related driver changes from Thomas Renninger.

    6) ACPI and Xen changes to make the reduced hardware sleep work with
    the latter from Ben Guthro.

    7) ACPI video driver cleanups and a blacklist of systems that should
    not tell the BIOS that they are compatible with Windows 8 (or ACPI
    backlight and possibly other things will not work on them). From
    Felipe Contreras.

    8) Assorted ACPI fixes and cleanups from Aaron Lu, Hanjun Guo,
    Kuppuswamy Sathyanarayanan, Lan Tianyu, Sachin Kamat, Tang Chen,
    Toshi Kani, and Wei Yongjun.

    9) cpufreq ondemand governor target frequency selection change to
    reduce oscillations between min and max frequencies (essentially,
    it causes the governor to choose target frequencies proportional
    to load) from Stratos Karafotis.

    10) cpufreq fixes allowing sysfs attributes file permissions to be
    preserved over suspend/resume cycles Srivatsa S Bhat.

    11) Removal of Device Tree parsing for CPU device nodes from multiple
    cpufreq drivers that required some changes related to
    of_get_cpu_node() to be made in a few architectures and in the
    driver core. From Sudeep KarkadaNagesha.

    12) cpufreq core fixes and cleanups related to mutual exclusion and
    driver module references from Viresh Kumar, Lukasz Majewski and
    Rafael J Wysocki.

    13) Assorted cpufreq fixes and cleanups from Amit Daniel Kachhap,
    Bartlomiej Zolnierkiewicz, Hanjun Guo, Jingoo Han, Joseph Lo,
    Julia Lawall, Li Zhong, Mark Brown, Sascha Hauer, Stephen Boyd,
    Stratos Karafotis, and Viresh Kumar.

    14) Fixes to prevent race conditions in coupled cpuidle from happening
    from Colin Cross.

    15) cpuidle core fixes and cleanups from Daniel Lezcano and
    Tuukka Tikkanen.

    16) Assorted cpuidle fixes and cleanups from Daniel Lezcano,
    Geert Uytterhoeven, Jingoo Han, Julia Lawall, Linus Walleij,
    and Sahara.

    17) System sleep tracing changes from Todd E Brandt and Shuah Khan.

    18) PNP subsystem conversion to using struct dev_pm_ops for power
    management from Shuah Khan.

    * tag 'pm+acpi-3.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (217 commits)
    cpufreq: Don't use smp_processor_id() in preemptible context
    cpuidle: coupled: fix race condition between pokes and safe state
    cpuidle: coupled: abort idle if pokes are pending
    cpuidle: coupled: disable interrupts after entering safe state
    ACPI / hotplug: Remove containers synchronously
    driver core / ACPI: Avoid device hot remove locking issues
    cpufreq: governor: Fix typos in comments
    cpufreq: governors: Remove duplicate check of target freq in supported range
    cpufreq: Fix timer/workqueue corruption due to double queueing
    ACPI / EC: Add ASUSTEK L4R to quirk list in order to validate ECDT
    ACPI / thermal: Add check of "_TZD" availability and evaluating result
    cpufreq: imx6q: Fix clock enable balance
    ACPI: blacklist win8 OSI for buggy laptops
    cpufreq: tegra: fix the wrong clock name
    cpuidle: Change struct menu_device field types
    cpuidle: Add a comment warning about possible overflow
    cpuidle: Fix variable domains in get_typical_interval()
    cpuidle: Fix menu_device->intervals type
    cpuidle: CodingStyle: Break up multiple assignments on single line
    cpuidle: Check called function parameter in get_typical_interval()
    ...

    Linus Torvalds
     

23 Aug, 2013

1 commit

  • Pull DT/core/cpufreq cpu_ofnode updates for v3.12 from Sudeep KarkadaNagesha.

    * 'cpu_of_node' of git://linux-arm.org/linux-skn:
    cpufreq: pmac32-cpufreq: remove device tree parsing for cpu nodes
    cpufreq: pmac64-cpufreq: remove device tree parsing for cpu nodes
    cpufreq: maple-cpufreq: remove device tree parsing for cpu nodes
    cpufreq: arm_big_little: remove device tree parsing for cpu nodes
    cpufreq: kirkwood-cpufreq: remove device tree parsing for cpu nodes
    cpufreq: spear-cpufreq: remove device tree parsing for cpu nodes
    cpufreq: highbank-cpufreq: remove device tree parsing for cpu nodes
    cpufreq: cpufreq-cpu0: remove device tree parsing for cpu nodes
    cpufreq: imx6q-cpufreq: remove device tree parsing for cpu nodes
    drivers/bus: arm-cci: avoid parsing DT for cpu device nodes
    ARM: mvebu: remove device tree parsing for cpu nodes
    ARM: topology: remove hwid/MPIDR dependency from cpu_capacity
    of/device: add helper to get cpu device node from logical cpu index
    driver/core: cpu: initialize of_node in cpu's device struture
    ARM: DT/kernel: define ARM specific arch_match_cpu_phys_id
    of: move of_get_cpu_node implementation to DT core library
    powerpc: refactor of_get_cpu_node to support other architectures
    openrisc: remove undefined of_get_cpu_node declaration
    microblaze: remove undefined of_get_cpu_node declaration

    Rafael J. Wysocki
     

21 Aug, 2013

1 commit


15 Aug, 2013

1 commit


14 Aug, 2013

1 commit


05 Jun, 2013

1 commit


12 May, 2013

2 commits

  • We are freeing parent node in success cases but not in failure cases.
    Let's do it.

    Signed-off-by: Viresh Kumar
    Acked-by: Shawn Guo
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     
  • With commit 1e4b545, regulator_get will now return -EPROBE_DEFER
    when the cpu0-supply node is present, but the regulator is not yet
    registered.

    It is possible for this to occur when the regulator registration
    by itself might be defered due to some dependent interface not yet
    instantiated. For example: an regulator which uses I2C and GPIO might
    need both systems available before proceeding, in this case, the
    regulator might defer it's registration.

    However, the cpufreq-cpu0 driver assumes that any un-successful
    return result is equivalent of failure.

    When the regulator_get returns failure other than -EPROBE_DEFER, it
    makes sense to assume that supply node is not present and proceed
    with the assumption that only clock control is necessary in the
    platform.

    With this change, we can now handle the following conditions:
    a) cpu0-supply binding is not present, regulator_get will return
    appropriate error result, resulting in cpufreq-cpu0 driver
    controlling just the clock.
    b) cpu0-supply binding is present, regulator_get returns
    -EPROBE_DEFER, we retry resulting in cpufreq-cpu0 driver
    registering later once the regulator is available.
    c) cpu0-supply binding is present, regulator_get returns
    -EPROBE_DEFER, however, regulator never registers, we retry until
    cpufreq-cpu0 driver fails to register pointing at device tree
    information bug. However, in this case, the fact that
    cpufreq-cpu0 operates with clock only when the DT binding clearly
    indicates need of a supply is a bug of it's own.
    d) cpu0-supply gets an regulator at probe - cpufreq-cpu0 driver
    controls both the clock and regulator

    Signed-off-by: Nishanth Menon
    Acked-by: Shawn Guo
    Signed-off-by: Rafael J. Wysocki

    Nishanth Menon
     

28 Apr, 2013

1 commit

  • * pm-cpufreq: (57 commits)
    cpufreq: MAINTAINERS: Add co-maintainer
    cpufreq: pxa2xx: initialize variables
    ARM: S5pv210: compiling issue, ARM_S5PV210_CPUFREQ needs CONFIG_CPU_FREQ_TABLE=y
    cpufreq: cpu0: Put cpu parent node after using it
    cpufreq: ARM big LITTLE: Adapt to latest cpufreq updates
    cpufreq: ARM big LITTLE: put DT nodes after using them
    cpufreq: Don't call __cpufreq_governor() for drivers without target()
    cpufreq: exynos5440: Protect OPP search calls with RCU lock
    cpufreq: dbx500: Round to closest available freq
    cpufreq: Call __cpufreq_governor() with correct policy->cpus mask
    cpufreq / intel_pstate: Optimize intel_pstate_set_policy
    cpufreq: OMAP: instantiate omap-cpufreq as a platform_driver
    arm: exynos: Enable OPP library support for exynos5440
    cpufreq: exynos: Remove error return even if no soc is found
    cpufreq: exynos: Add cpufreq driver for exynos5440
    cpufreq: AMD "frequency sensitivity feedback" powersave bias for ondemand governor
    cpufreq: ondemand: allow custom powersave_bias_target handler to be registered
    cpufreq: convert cpufreq_driver to using RCU
    cpufreq: powerpc/platforms/cell: move cpufreq driver to drivers/cpufreq
    cpufreq: sparc: move cpufreq driver to drivers/cpufreq
    ...

    Conflicts:
    MAINTAINERS (with commit a8e39c3 from pm-cpuidle)
    drivers/cpufreq/cpufreq_governor.h (with commit beb0ff3)

    Rafael J. Wysocki
     

22 Apr, 2013

1 commit


02 Apr, 2013

4 commits

  • policy->cpus contains all online cpus that have single shared clock line. And
    their frequencies are always updated together.

    Many SMP system's cpufreq drivers take care of this in individual drivers but
    the best place for this code is in cpufreq core.

    This patch modifies cpufreq_notify_transition() to notify frequency change for
    all cpus in policy->cpus and hence updates all users of this API.

    Signed-off-by: Viresh Kumar
    Acked-by: Stephen Warren
    Tested-by: Stephen Warren
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     
  • Currently we are simply returning from target() if we encounter some error after
    broadcasting CPUFREQ_PRECHANGE notifier. Which looks to be wrong as others might
    depend on POSTCHANGE notifier for their functioning.

    So, better broadcast CPUFREQ_POSTCHANGE notifier for these failure cases too,
    but with old frequency.

    Signed-off-by: Viresh Kumar
    Acked-by: Shawn Guo
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     
  • It is not possible for init() to be called for any cpu other than cpu0. During
    bootup whatever cpu is used to boot system will be assigned as cpu0. And later
    on policy->cpu can only change if we hotunplug all cpus first and then hotplug
    them back in different order, which isn't possible (system requires atleast one
    cpu to be up always :)).

    Though I can see one situation where policy->cpu can be different then zero.
    - Hot-unplug cpu 0.
    - rmmod cpufreq-cpu0 module
    - insmod it back
    - hotplug cpu 0 again.

    Here, policy->cpu would be different. But the driver doesn't have any dependency
    on cpu0 as such. We don't mind which cpu of a system is policy->cpu and so this
    check is just not required.

    Remove it.

    Signed-off-by: Viresh Kumar
    Acked-by: Shawn Guo
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     
  • Check for the presence of the '/cpus' OF node before dereferencing it
    blindly:

    [ 4.181793] Unable to handle kernel NULL pointer dereference at virtual address 0000001c
    [ 4.181793] pgd = c0004000
    [ 4.181823] [0000001c] *pgd=00000000
    [ 4.181823] Internal error: Oops: 5 [#1] SMP ARM
    [ 4.181823] Modules linked in:
    [ 4.181823] CPU: 1 Tainted: G W (3.8.0-15-generic #25~hbankD)
    [ 4.181854] PC is at of_get_next_child+0x64/0x70
    [ 4.181854] LR is at of_get_next_child+0x24/0x70
    [ 4.181854] pc : [] lr : [] psr: 60000113
    [ 4.181854] sp : ed891ec0 ip : ed891ec0 fp : ed891ed4
    [ 4.181884] r10: c04dafd0 r9 : c098690c r8 : c0936208
    [ 4.181884] r7 : ed890000 r6 : c0a63d00 r5 : 00000000 r4 : 00000000
    [ 4.181884] r3 : 00000000 r2 : 00000000 r1 : 00000000 r0 : c0b2acc8
    [ 4.181884] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel
    [ 4.181884] Control: 10c5387d Table: adcb804a DAC: 00000015
    [ 4.181915] Process swapper/0 (pid: 1, stack limit = 0xed890238)
    [ 4.181915] Stack: (0xed891ec0 to 0xed892000)
    [ 4.181915] 1ec0: c09b7b70 00000007 ed891efc ed891ed8 c04daff4 c04fd9c0 00000000 c09b7b70
    [ 4.181915] 1ee0: 00000007 c0a63d00 ed890000 c0936208 ed891f54 ed891f00 c00088e0 c04dafdc
    [ 4.181945] 1f00: ed891f54 ed891f10 c006e940 00000000 00000000 00000007 00000007 c08a4914
    [ 4.181945] 1f20: 00000000 c07dbd30 c0a63d00 c09b7b70 00000007 c0a63d00 000000bc c0936208
    [ 4.181945] 1f40: c098690c c0986914 ed891f94 ed891f58 c0936a40 c00087bc 00000007 00000007
    [ 4.181976] 1f60: c0936208 be8bda20 b6eea010 c0a63d00 c064547c 00000000 00000000 00000000
    [ 4.181976] 1f80: 00000000 00000000 ed891fac ed891f98 c0645498 c09368c8 00000000 00000000
    [ 4.181976] 1fa0: 00000000 ed891fb0 c0014658 c0645488 00000000 00000000 00000000 00000000
    [ 4.182006] 1fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    [ 4.182006] 1fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
    [ 4.182037] [] (of_get_next_child+0x64/0x70) from [] (cpu0_cpufreq_driver_init+0x24/0x284)
    [ 4.182067] [] (cpu0_cpufreq_driver_init+0x24/0x284) from [] (do_one_initcall+0x130/0x1b0)
    [ 4.182067] [] (do_one_initcall+0x130/0x1b0) from [] (kernel_init_freeable+0x184/0x24c)
    [ 4.182098] [] (kernel_init_freeable+0x184/0x24c) from [] (kernel_init+0x1c/0xf4)
    [ 4.182128] [] (kernel_init+0x1c/0xf4) from [] (ret_from_fork+0x14/0x20)
    [ 4.182128] Code: f57ff04f e320f004 e89da830 e89da830 (e595001c)
    [ 4.182128] ---[ end trace 634903a22e8609cb ]---
    [ 4.182189] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
    [ 4.182189]
    [ 4.642395] CPU0: stopping

    [rjw: Changelog]
    Signed-off-by: Paolo Pisati
    Acked-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Paolo Pisati
     

01 Apr, 2013

1 commit


02 Feb, 2013

3 commits

  • policy->shared_type field was added only for SoCs with ACPI support:

    commit 3b2d99429e3386b6e2ac949fc72486509c8bbe36
    Author: Venkatesh Pallipadi
    Date: Wed Dec 14 15:05:00 2005 -0500

    P-state software coordination for ACPI core

    http://bugzilla.kernel.org/show_bug.cgi?id=5737

    Many non-ACPI systems are filling this field by mistake, which makes its usage
    confusing. Lets clean it.

    Signed-off-by: Viresh Kumar
    Acked-by: Santosh Shilimkar
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     
  • As multiplatform build is being adopted by more and more ARM platforms,
    initcall function should be used very carefully. For example, when
    GENERIC_CPUFREQ_CPU0 is built in the kernel, cpu0_cpufreq_driver_init()
    will be called on all the platforms to initialize cpufreq-cpu0 driver.

    To eliminate this undesired the effect, the patch changes cpufreq-cpu0
    driver to have it instantiated as a platform_driver. Then it will only
    run on platforms that create the platform_device "cpufreq-cpu0".

    Along with the change, it also changes cpu_dev to be &pdev->dev,
    so that managed functions can start working, and module build gets
    supported too.

    The highbank-cpufreq driver is also updated accordingly to adapt the
    changes on cpufreq-cpu0.

    Signed-off-by: Shawn Guo
    Reviewed-by: Viresh Kumar
    Acked-by: Mark Langsdorf
    Signed-off-by: Rafael J. Wysocki

    Shawn Guo
     
  • Highbank processors depend on the external ECME to perform voltage
    management based on a requested frequency. Communication between the
    A9 cores and the ECME happens over the pl320 IPC channel.

    Signed-off-by: Mark Langsdorf
    Reviewed-by: Shawn Guo
    Reviewed-by: Mike Turquette
    Signed-off-by: Rafael J. Wysocki

    Mark Langsdorf
     

22 Jan, 2013

1 commit

  • OPP pointer is RCU protected, hence after finding it, de-reference
    also should be protected with the same RCU context else the OPP
    pointer may become invalid.

    Reported-by: Jack Mitchell
    Tested-by: Alexander Holler
    Tested-by: Jack Mitchell
    Acked-by: Alexander Holler
    Signed-off-by: Nishanth Menon
    Signed-off-by: Rafael J. Wysocki

    Nishanth Menon
     

21 Nov, 2012

1 commit


10 Sep, 2012

1 commit

  • It adds a generic cpufreq driver for CPU0 frequency management based on
    clk, regulator, OPP and device tree support. It can support both
    uniprocessor (UP) and those symmetric multiprocessor (SMP) systems which
    share clock and voltage across all CPUs.

    Signed-off-by: Shawn Guo
    Acked-by: Santosh Shilimkar
    Tested-by: AnilKumar Ch
    Signed-off-by: Rafael J. Wysocki

    Shawn Guo