21 Jul, 2014

1 commit


20 May, 2014

1 commit

  • Many drivers keep frequencies in frequency table in ascending
    or descending order. When governor tries to change to policy->min
    or policy->max respectively then the cpufreq_frequency_table_target
    could return on first iteration. This will save some iteration cycles.

    So, break out early when a frequency in cpufreq_frequency_table
    equals to target one.

    Testing this during kernel compilation using ondemand governor
    with a frequency table in ascending order, the
    cpufreq_frequency_table_target returned early on the first
    iteration at about 30% of times called.

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

    Stratos Karafotis
     

30 Apr, 2014

1 commit


07 Apr, 2014

2 commits

  • Currently cpufreq frequency table has two fields: frequency and driver_data.
    driver_data is only for drivers' internal use and cpufreq core shouldn't use
    it at all. But with the introduction of BOOST frequencies, this assumption
    was broken and we started using it as a flag instead.

    There are two problems due to this:
    - It is against the description of this field, as driver's data is used by
    the core now.
    - if drivers fill it with -3 for any frequency, then those frequencies are
    never considered by cpufreq core as it is exactly same as value of
    CPUFREQ_BOOST_FREQ, i.e. ~2.

    The best way to get this fixed is by creating another field flags which
    will be used for such flags. This patch does that. Along with that various
    drivers need modifications due to the change of struct cpufreq_frequency_table.

    Reviewed-by: Gautham R Shenoy
    Signed-off-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     
  • CPUFreq core doesn't control value of .driver_data and this field is
    completely driver specific. This can contain any value and not only
    indexes. For most of the drivers, which aren't using this field, its
    value is zero. So, printing this from core doesn't make any sense.
    Don't print it.

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

    Viresh Kumar
     

12 Mar, 2014

1 commit

  • freq table is not per CPU but per policy, so it makes more sense to
    keep it within struct cpufreq_policy instead of a per-cpu variable.

    This patch does it. Over that, there is no need to set policy->freq_table
    to NULL in ->exit(), as policy structure is going to be freed soon.

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

    Viresh Kumar
     

17 Jan, 2014

1 commit

  • This commit adds boost frequency support in cpufreq core (Hardware &
    Software). Some SoCs (like Exynos4 - e.g. 4x12) allow setting frequency
    above its normal operation limits. Such mode shall be only used for a
    short time.

    Overclocking (boost) support is essentially provided by platform
    dependent cpufreq driver.

    This commit unifies support for SW and HW (Intel) overclocking solutions
    in the core cpufreq driver. Previously the "boost" sysfs attribute was
    defined in the ACPI processor driver code. By default boost is disabled.
    One global attribute is available at: /sys/devices/system/cpu/cpufreq/boost.

    It only shows up when cpufreq driver supports overclocking.
    Under the hood frequencies dedicated for boosting are marked with a
    special flag (CPUFREQ_BOOST_FREQ) at driver's frequency table.
    It is the user's concern to enable/disable overclocking with a proper call
    to sysfs.

    The cpufreq_boost_trigger_state() function is defined non static on purpose.
    It is used later with thermal subsystem to provide automatic enable/disable
    of the BOOST feature.

    Signed-off-by: Lukasz Majewski
    Signed-off-by: Myungjoo Ham
    Acked-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Lukasz Majewski
     

06 Jan, 2014

1 commit

  • Sometimes boot loaders set CPU frequency to a value outside of frequency table
    present with cpufreq core. In such cases CPU might be unstable if it has to run
    on that frequency for long duration of time and so its better to set it to a
    frequency which is specified in freq-table. This also makes cpufreq stats
    inconsistent as cpufreq-stats would fail to register because current frequency
    of CPU isn't found in freq-table.

    Because we don't want this change to affect boot process badly, we go for the
    next freq which is >= policy->cur ('cur' must be set by now, otherwise we will
    end up setting freq to lowest of the table as 'cur' is initialized to zero).

    In case current frequency doesn't match any frequency from freq-table, we throw
    warnings to user, so that user can get this fixed in their bootloaders or
    freq-tables.

    Reported-by: Carlos Hernandez
    Reported-and-tested-by: Nishanth Menon
    Signed-off-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     

16 Oct, 2013

3 commits

  • Most of the CPUFreq drivers do similar things in .exit() and .verify() routines
    and .attr. So its better if we have generic routines for them which can be used
    by cpufreq drivers then.

    This patch introduces generic .attr, .exit() and .verify() cpufreq drivers.

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

    Viresh Kumar
     
  • Most of the users of cpufreq_verify_within_limits() calls it for
    limiting with min/max from policy->cpuinfo. We can make that code
    simple by introducing another routine which will do this for them
    automatically.

    This patch adds another routine cpufreq_verify_within_cpu_limits()
    and updates others to use it.

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

    Viresh Kumar
     
  • cpufreq_frequency_table_verify() is rewritten here to make it more logical
    and efficient.
    - merge multiple lines for variable declarations together.
    - quit early if any frequency between min/max is found.
    - don't call cpufreq_verify_within_limits() in case any valid freq is
    found as it is of no use.
    - rename the count variable as found and change its type to boolean.

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

    Viresh Kumar
     

01 Oct, 2013

1 commit

  • Almost every cpufreq driver is required to validate its frequency table with:
    cpufreq_frequency_table_cpuinfo() and then expose it to cpufreq core with:
    cpufreq_frequency_table_get_attr().

    This patch creates another helper routine cpufreq_table_validate_and_show() that
    will do both these steps in a single call and will return 0 for success, error
    otherwise.

    This also fixes potential bugs in cpufreq drivers where people have called
    cpufreq_frequency_table_get_attr() before calling
    cpufreq_frequency_table_cpuinfo(), as the later may fail.

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

    Viresh Kumar
     

08 Aug, 2013

1 commit

  • This patch addresses the following issues in the header files in the
    cpufreq core:
    - Include headers in ascending order, so that we don't add same
    many times by mistake.
    - must be included after , so that they override
    whatever they need to.
    - Remove unnecessary includes.
    - Don't include files already included by cpufreq.h or
    cpufreq_governor.h.

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

    Viresh Kumar
     

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
     

09 Feb, 2013

1 commit


02 Feb, 2013

1 commit

  • __cpufreq_remove_dev() is called on multiple occasions: cpufreq_driver
    unregister and cpu removals.

    Current implementation of this routine is overly complex without much need. If
    the cpu to be removed is the policy->cpu, we remove the policy first and add all
    other cpus again from policy->cpus and then finally call __cpufreq_remove_dev()
    again to remove the cpu to be deleted. Haahhhh..

    There exist a simple solution to removal of a cpu:
    - Simply use the old policy structure
    - update its fields like: policy->cpu, etc.
    - notify any users of cpufreq, which depend on changing policy->cpu

    Hence this patch, which tries to implement the above theory. It is tested well
    by myself on ARM big.LITTLE TC2 SoC, which has 5 cores (2 A15 and 3 A7). Both
    A15's share same struct policy and all A7's share same policy structure.

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

    Viresh Kumar
     

15 Nov, 2012

1 commit


04 May, 2011

1 commit

  • With dynamic debug having gained the capability to report debug messages
    also during the boot process, it offers a far superior interface for
    debug messages than the custom cpufreq infrastructure. As a first step,
    remove the old cpufreq_debug_printk() function and replace it with a call
    to the generic pr_debug() function.

    How can dynamic debug be used on cpufreq? You need a kernel which has
    CONFIG_DYNAMIC_DEBUG enabled.

    To enabled debugging during runtime, mount debugfs and

    $ echo -n 'module cpufreq +p' > /sys/kernel/debug/dynamic_debug/control

    for debugging the complete "cpufreq" module. To achieve the same goal during
    boot, append

    ddebug_query="module cpufreq +p"

    as a boot parameter to the kernel of your choice.

    For more detailled instructions, please see
    Documentation/dynamic-debug-howto.txt

    Signed-off-by: Dominik Brodowski
    Signed-off-by: Dave Jones

    Dominik Brodowski
     

29 Oct, 2009

1 commit

  • This patch updates percpu related symbols in cpufreq such that percpu
    symbols are unique and don't clash with local symbols. This serves
    two purposes of decreasing the possibility of global percpu symbol
    collision and allowing dropping per_cpu__ prefix from percpu symbols.

    * drivers/cpufreq/cpufreq.c: s/policy_cpu/cpufreq_policy_cpu/
    * drivers/cpufreq/freq_table.c: s/show_table/cpufreq_show_table/
    * arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c: s/drv_data/acfreq_data/
    s/old_perf/acfreq_old_perf/

    Partly based on Rusty Russell's "alloc_percpu: rename percpu vars
    which cause name clashes" patch.

    Signed-off-by: Tejun Heo
    Cc: Rusty Russell

    Tejun Heo
     

25 Feb, 2009

1 commit


22 Jul, 2008

1 commit


23 May, 2008

1 commit


20 May, 2008

1 commit

  • Change cpufreq_policy and cpufreq_governor pointer tables
    from arrays to per_cpu variables in the cpufreq subsystem.

    Also some minor complaints from checkpatch.pl fixed.

    Based on:
    git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
    git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git

    Signed-off-by: Mike Travis
    Signed-off-by: Dave Jones

    Mike Travis
     

07 Feb, 2008

1 commit


12 Jul, 2007

1 commit

  • sysfs is now completely out of driver/module lifetime game. After
    deletion, a sysfs node doesn't access anything outside sysfs proper,
    so there's no reason to hold onto the attribute owners. Note that
    often the wrong modules were accounted for as owners leading to
    accessing removed modules.

    This patch kills now unnecessary attribute->owner. Note that with
    this change, userland holding a sysfs node does not prevent the
    backing module from being unloaded.

    For more info regarding lifetime rule cleanup, please read the
    following message.

    http://article.gmane.org/gmane.linux.kernel/510293

    (tweaked by Greg to not delete the field just yet, to make it easier to
    merge things properly.)

    Signed-off-by: Tejun Heo
    Cc: Cornelia Huck
    Cc: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Tejun Heo
     

07 Nov, 2006

1 commit


31 May, 2006

3 commits


28 Feb, 2006

1 commit


17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds