15 Aug, 2013

1 commit


10 Aug, 2013

1 commit


08 Aug, 2013

1 commit

  • Chapter 14 of Documentation/CodingStyle says:

    The preferred form for passing a size of a struct is the following:

    p = kmalloc(sizeof(*p), ...);

    The alternative form where struct name is spelled out hurts
    readability and introduces an opportunity for a bug when the pointer
    variable type is changed but the corresponding sizeof that is passed
    to a memory allocator is not.

    This wasn't followed consistently in drivers/cpufreq, let's make it
    more consistent by always following this rule.

    Signed-off-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     

26 Jul, 2013

1 commit

  • The target frequency calculation method in the ondemand governor has
    changed and it is now independent of the measured average frequency.
    Consequently, the APERF/MPERF support in cpufreq is not used any
    more, so drop it.

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

    Stratos Karafotis
     

29 Jun, 2013

1 commit


28 Jun, 2013

4 commits

  • * pm-cpufreq: (41 commits)
    cpufreq: tegra: call CPUFREQ_POSTCHANGE notfier in error cases
    cpufreq: s3c64xx: call CPUFREQ_POSTCHANGE notfier in error cases
    cpufreq: omap: call CPUFREQ_POSTCHANGE notfier in error cases
    cpufreq: imx6q: call CPUFREQ_POSTCHANGE notfier in error cases
    cpufreq: exynos: call CPUFREQ_POSTCHANGE notfier in error cases
    cpufreq: dbx500: call CPUFREQ_POSTCHANGE notfier in error cases
    cpufreq: davinci: call CPUFREQ_POSTCHANGE notfier in error cases
    cpufreq: arm-big-little: call CPUFREQ_POSTCHANGE notfier in error cases
    cpufreq: powernow-k8: call CPUFREQ_POSTCHANGE notfier in error cases
    cpufreq: pcc: call CPUFREQ_POSTCHANGE notfier in error cases
    cpufreq: e_powersaver: call CPUFREQ_POSTCHANGE notfier in error cases
    cpufreq: ACPI: call CPUFREQ_POSTCHANGE notfier in error cases
    cpufreq: s3c2416: fix forgotten driver_data conversions
    cpufreq: make __cpufreq_notify_transition() static
    cpufreq: Fix minor formatting issues
    cpufreq: Fix governor start/stop race condition
    cpufreq: Simplify userspace governor
    cpufreq: X86_AMD_FREQ_SENSITIVITY: select CPU_FREQ_TABLE
    cpufreq: tegra: create CONFIG_ARM_TEGRA_CPUFREQ
    cpufreq: S3C2416/S3C64XX: select CPU_FREQ_TABLE
    ...

    Rafael J. Wysocki
     
  • * acpi-hotplug:
    ACPI: Do not use CONFIG_ACPI_HOTPLUG_MEMORY_MODULE
    ACPI / cpufreq: Add ACPI processor device IDs to acpi-cpufreq
    Memory hotplug: Move alternative function definitions to header
    ACPI / processor: Fix potential NULL pointer dereference in acpi_processor_add()
    Memory hotplug / ACPI: Simplify memory removal
    ACPI / scan: Add second pass of companion offlining to hot-remove code
    Driver core / MM: Drop offline_memory_block()
    ACPI / processor: Pass processor object handle to acpi_bind_one()
    ACPI: Drop removal_type field from struct acpi_device
    Driver core / memory: Simplify __memory_block_change_state()
    ACPI / processor: Initialize per_cpu(processors, pr->id) properly
    CPU: Fix sysfs cpu/online of offlined CPUs
    Driver core: Introduce offline/online callbacks for memory blocks
    ACPI / memhotplug: Bind removable memory blocks to ACPI device nodes
    ACPI / processor: Use common hotplug infrastructure
    ACPI / hotplug: Use device offline/online for graceful hot-removal
    Driver core: Use generic offline/online for CPU offline/online
    Driver core: Add offline/online device operations

    Rafael J. Wysocki
     
  • Commits fcf8058 (cpufreq: Simplify cpufreq_add_dev()) and aa77a52
    (cpufreq: acpi-cpufreq: Don't set policy->related_cpus from .init())
    changed the contents of the "related_cpus" sysfs attribute on systems
    where acpi-cpufreq is used and user space can't get the list of CPUs
    which are in the same hardware coordination CPU domain (provided by
    the ACPI AML method _PSD) via "related_cpus" any more.

    To make up for that loss add a new sysfs attribute "freqdomian_cpus"
    for the acpi-cpufreq driver which exposes the list of CPUs in the
    same domain regardless of whether it is coordinated by hardware or
    software.

    [rjw: Changelog, documentation]
    References: https://bugzilla.kernel.org/show_bug.cgi?id=58761
    Reported-by: Jean-Philippe Halimi
    Signed-off-by: Lan Tianyu
    Acked-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Lan Tianyu
     
  • * pm-cpufreq-assorted: (21 commits)
    cpufreq: powernow-k8: call CPUFREQ_POSTCHANGE notfier in error cases
    cpufreq: pcc: call CPUFREQ_POSTCHANGE notfier in error cases
    cpufreq: e_powersaver: call CPUFREQ_POSTCHANGE notfier in error cases
    cpufreq: ACPI: call CPUFREQ_POSTCHANGE notfier in error cases
    cpufreq: make __cpufreq_notify_transition() static
    cpufreq: Fix minor formatting issues
    cpufreq: Fix governor start/stop race condition
    cpufreq: Simplify userspace governor
    cpufreq: powerpc: move cpufreq driver to drivers/cpufreq
    cpufreq: kirkwood: Select CPU_FREQ_TABLE option
    cpufreq: big.LITTLE needs cpufreq table
    cpufreq: SPEAr needs cpufreq table
    cpufreq: powerpc: Add cpufreq driver for Freescale e500mc SoCs
    cpufreq: remove unnecessary cpufreq_cpu_{get|put}() calls
    cpufreq: MAINTAINERS: Add git tree path for ARM specific updates
    cpufreq: rename index as driver_data in cpufreq_frequency_table
    cpufreq: Don't create empty /sys/devices/system/cpu/cpufreq directory
    cpufreq: Move get_cpu_idle_time() to cpufreq.c
    cpufreq: governors: Move get_governor_parent_kobj() to cpufreq.c
    cpufreq: Add EXPORT_SYMBOL_GPL for have_governor_per_policy
    ...

    Rafael J. Wysocki
     

24 Jun, 2013

1 commit

  • PRECHANGE and POSTCHANGE notifiers must be called in groups, i.e either both
    should be called or both shouldn't be.

    In case we have started PRECHANGE notifier and found an error, we
    must call POSTCHANGE notifier with freqs.new = freqs.old to
    guarantee that the sequence of calling notifiers is complete.

    This patch fixes it.

    Signed-off-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     

07 Jun, 2013

1 commit

  • After commit ac212b6 (ACPI / processor: Use common hotplug
    infrastructure) the acpi-cpufreq module is not loaded automatically
    by udev which fails to match it against the x86cpu modalias. Still,
    it can be matched against ACPI processor device IDs, which even
    makes more sense, because it depends on the ACPI processor driver
    that uses those device IDs to bind to processor devices.

    For this reason, add ACPI processor device IDs to acpi-cpufreq.

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

    Rafael J. Wysocki
     

05 Jun, 2013

1 commit

  • Commit 4b31e774 (Always set P-state on initialization) fixed bug
    #4634 and caused the driver to always set the target P-State at
    least once since the initial P-State may not be the desired one.
    Commit 5a1c0228 (cpufreq: Avoid calling cpufreq driver's target()
    routine if target_freq == policy->cur) caused a regression in
    this behavior.

    This fixes the regression by setting policy->cur based on the CPU's
    target frequency rather than the CPU's current reported frequency
    (which may be different). This means that the P-State will be set
    initially if the CPU's target frequency is different from the
    governor's target frequency.

    This fixes an issue where setting the default governor to
    performance wouldn't correctly enable turbo mode on all cores.

    Signed-off-by: Ross Lagerwall
    Reviewed-by: Len Brown
    Acked-by: Viresh Kumar
    Cc: 3.8+
    Signed-off-by: Rafael J. Wysocki

    Ross Lagerwall
     

04 Jun, 2013

1 commit

  • The "index" field of struct cpufreq_frequency_table was never an
    index and isn't used at all by the cpufreq core. It only is useful
    for cpufreq drivers for their internal purposes.

    Many people nowadays blindly set it in ascending order with the
    assumption that the core will use it, which is a mistake.

    Rename it to "driver_data" as that's what its purpose is. All of its
    users are updated accordingly.

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

    Viresh Kumar
     

27 May, 2013

1 commit


02 Apr, 2013

1 commit

  • 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
     

25 Mar, 2013

1 commit

  • With the addition of following patch:

    fcf8058 cpufreq: Simplify cpufreq_add_dev()

    cpufreq driver's .init() routine must initialize policy->cpus with
    mask of all possible CPUs (Online + Offline) that share the clock.
    Then the core would copy this mask onto policy->related_cpus and will
    reset policy->cpus to carry only online cpus.

    acpi-cpufreq driver wasn't updated with this assumption and so
    sometimes when we try to hot[un]plug CPUs at run time, sysfs
    directories get corrupted.

    This patch fixes acpi-cpufreq driver against this corruption.

    Reported-and-tested-by: Maciej Rutecki
    Tested-by: Borislav Petkov
    Signed-off-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     

02 Feb, 2013

2 commits

  • Implement a generic helper function policy_is_shared() to replace the
    current dbs_sw_coordinated_cpus() at cpufreq level, so that it can be
    used by code other than cpufreq governors.

    Suggested-by: Viresh Kumar
    Signed-off-by: Fabio Baltieri
    Acked-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Fabio Baltieri
     
  • de3ed81d746d ("[CPUFREQ] Change link order of x86 cpufreq modules")
    changed cpufreq drivers link order so that powernow-k8 gets loaded first
    due to earlier K8s having BIOS bugs.

    However, now that acpi-cpufreq supports both AMD and Intel CPUs with HW
    P-states, we want to load it first, so that cases where acpi-cpufreq and
    powernow-k8 are both built-in and powernow-k8 initializing first, can be
    addressed.

    So, make sure that even if acpi-cpufreq gets loaded first, it errors out
    on K8s and powernow-k8 can be loaded then successfully.

    Signed-off-by: Matthew Garrett
    References: http://lkml.kernel.org/r/20130118162347.GA31499@srcf.ucam.org
    Signed-off-by: Borislav Petkov
    Signed-off-by: Rafael J. Wysocki

    Matthew Garrett
     

23 Jan, 2013

1 commit

  • The acpi core will call request_module("acpi-cpufreq") on subsystem init,
    but this will fail if the module isn't available at that stage of boot.
    Add some module aliases to ensure that udev can load the module on Intel
    and AMD systems with the appropriate feature bits - I /think/ that this
    will also work on VIA systems, but haven't verified that.

    References: http://lkml.kernel.org/r/1448223.sdUJnNSRz4@vostro.rjw.lan
    Signed-off-by: Matthew Garrett
    Tested-by: Leonid Isaev
    Acked-by: Borislav Petkov
    Cc: 3.7+
    Signed-off-by: Rafael J. Wysocki

    Matthew Garrett
     

10 Sep, 2012

4 commits

  • The powernow-k8 driver supported a sysfs knob called "cpb", which was
    instantiated per CPU, but actually acted globally for the whole
    system. To keep some compatibility with this feature, we re-introduce
    this behavior here, but:
    a) only enable it on AMD CPUs and
    b) protect it with a Kconfig switch

    I'd like to consider this feature obsolete. Lets keep it around for
    some kernel versions and then phase it out.

    Signed-off-by: Andre Przywara
    Signed-off-by: Rafael J. Wysocki

    Andre Przywara
     
  • One feature present in powernow-k8 that isn't present in acpi-cpufreq
    is support for enabling or disabling AMD's core performance boost
    technology. This patch adds support to acpi-cpufreq, but also
    includes support for Intel's dynamic acceleration.

    The original boost disabling sysfs file was per CPU, but acted
    globally. Also the naming (cpb) was at least not intuitive.
    So lets introduce a single file simply called "boost", which sits
    once in /sys/devices/system/cpu/cpufreq.
    This should be the only way of using this feature, so add
    documentation about the rationale and the usage.

    A following patch will re-introduce the cpb knob for compatibility
    reasons on AMD CPUs.

    Per-CPU boost switching is possible, but not trivial and is thus
    postponed to a later patch series.

    Signed-off-by: Andre Przywara
    Signed-off-by: Rafael J. Wysocki

    Andre Przywara
     
  • To workaround some Windows specific behavior, the ACPI _PSD table
    on AMD desktop boards advertises all cores as dependent, meaning
    that they all can only use the same P-state. acpi-cpufreq strictly
    obeys this description, instantiating one CPU only and symlinking
    the others. But the hardware can have distinct frequencies for each
    core and powernow-k8 did it that way.
    So, in order to use the hardware to its full potential and keep the
    original powernow-k8 behavior, lets override the _PSD table setting
    on AMD hardware.
    We use the siblings table, as it matches the current hardware
    behavior.

    Signed-off-by: Andre Przywara
    Signed-off-by: Rafael J. Wysocki

    Andre Przywara
     
  • The programming model for P-states on modern AMD CPUs is very similar to
    that of Intel and VIA. It makes sense to consolidate this support into one
    driver rather than duplicating functionality between two of them. This
    patch adds support for AMDs with hardware P-state control to acpi-cpufreq.

    Signed-off-by: Matthew Garrett
    Signed-off-by: Andre Przywara
    Signed-off-by: Rafael J. Wysocki

    Matthew Garrett
     

14 Jul, 2011

1 commit


11 Jul, 2011

1 commit


20 May, 2011

1 commit