15 Nov, 2012

1 commit


06 Jan, 2012

1 commit

  • CPU frequency is guranteed to be changed on notifier callback with
    CPUFREQ_POSTCHANGE. Notifier callback with CPUFREQ_PRECHANGE does
    not gurantee a change in frequency; after it, if cpufreq driver is
    unable to change CPU to new frequency. This results in wrong
    information being fed to user (if setting CPU frequency fails)
    upon doing like,

    cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed

    Hence in userspace governer update cpu_cur_freq only if notifier
    has been called with POSTCHANGE.

    Signed-off-by: Afzal Mohammed
    Signed-off-by: Dave Jones

    Afzal Mohammed
     

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
     

25 Feb, 2009

1 commit


10 Oct, 2008

1 commit

  • We don't need to export the governors for use as the default governor,
    because the default governor will be built-in anyway and we can access
    the symbol directly.

    This also fixes the following sparse warnings:

    drivers/cpufreq/cpufreq_conservative.c:578:25: warning: symbol 'cpufreq_gov_conservative' was not declared. Should it be static?
    drivers/cpufreq/cpufreq_ondemand.c:582:25: warning: symbol 'cpufreq_gov_ondemand' was not declared. Should it be static?
    drivers/cpufreq/cpufreq_performance.c:39:25: warning: symbol 'cpufreq_gov_performance' was not declared. Should it be static?
    drivers/cpufreq/cpufreq_powersave.c:38:25: warning: symbol 'cpufreq_gov_powersave' was not declared. Should it be static?
    drivers/cpufreq/cpufreq_userspace.c:190:25: warning: symbol 'cpufreq_gov_userspace' was not declared. Should it be static?

    Signed-off-by: Sven Wegener
    Signed-off-by: Dave Jones

    Sven Wegener
     

20 Jul, 2008

1 commit

  • * Replace arrays sized by NR_CPUS with percpu variables.

    Prior reference: http://marc.info/?l=linux-kernel&m=120251421825989&w=4
    Subject: [PATCH 1/4] cpufreq: change cpu freq tables to per_cpu variables
    From: Mike Travis
    Date: 2008-02-08 23:37:39

    Signed-off-by: Mike Travis
    Signed-off-by: Ingo Molnar

    Mike Travis
     

07 Feb, 2008

1 commit

  • Eliminate cpufreq_userspace scaling_setspeed deadlock.

    Luming Yu recently uncovered yet another cpufreq related deadlock.
    One thread that continuously switches the governors and the other thread that
    repeatedly cats the contents of cpufreq directory causes both these threads to
    go into a deadlock.

    Detailed examination of the deadlock showed the exact flow before the deadlock
    as:

    Thread 1 Thread 2
    ________ ________
    cats files under /sys/devices/.../cpufreq/
    Set governor to userspace
    Adds a new sysfs entry for
    scaling_setspeed
    cats files under /sys/devices/.../cpufreq/

    Set governor to performance
    Holds cpufreq_rw_sem in write
    mode
    Sends a STOP notify to
    userspace governor
    cat /sys/devices/.../cpufreq/scaling_setspeed
    Gets a handle on the above sysfs entry with
    sysfs_get_active
    Blocks while trying to get cpufreq_rw_sem
    in read mode
    Remove a sysfs entry for
    scaling_setspeed
    Blocks on sysfs_deactivate
    while waiting for earlier
    get_active (on other thread)
    to drain

    At this point both threads go into deadlock and any other thread that tries to
    do anything with sysfs cpufreq will also block.

    There seems to be no easy way to avoid this deadlock as long as
    cpufreq_userspace adds/removes the sysfs entry under same kobject as cpufreq.
    Below patch moves scaling_setspeed to cpufreq.c, keeping it always and calling
    back the governor on read/write. This is the cleanest fix I could think of,
    even though adding two callbacks in governor structure just for this seems
    unnecessary.

    Note that the change makes scaling_setspeed under /sys/.../cpufreq permanent
    and returns when governor is not userspace.

    Signed-off-by: Venkatesh Pallipadi
    Signed-off-by: Dave Jones

    Venki Pallipadi
     

18 Jan, 2008

1 commit

  • When the cpufreq driver starts up at boot time, it calls into the default
    governor which might not be initialised yet. This hurts when the
    governor's worker function relies on memory that is not yet set up by its
    init function.

    This migrates all governors from module_init() to fs_initcall() when being
    the default, as was already done in cpufreq_performance when it was the
    only possible choice. The performance governor is always initialized early
    because it might be used as fallback even when not being the default.

    Fixes at least one actual oops where ondemand is the default governor and
    cpufreq_governor_dbs() uses the uninitialised kondemand_wq work-queue
    during boot-time.

    Signed-off-by: Johannes Weiner
    Cc: Dave Jones
    Cc: "Rafael J. Wysocki"
    Cc: Venkatesh Pallipadi
    Acked-by: Ingo Molnar
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Johannes Weiner
     

13 Jul, 2007

1 commit

  • * master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq:
    [CPUFREQ] Fix sysfs_create_file return value handling
    [CPUFREQ] ondemand: fix tickless accounting and software coordination bug
    [CPUFREQ] ondemand: add a check to avoid negative load calculation
    [CPUFREQ] Keep userspace governor quiet when it is not being used
    [CPUFREQ] Longhaul - Proper register access
    [CPUFREQ] Kconfig powernow-k8 driver should depend on ACPI P-States driver
    [CPUFREQ] Longhaul - Replace ACPI functions with direct I/O
    [CPUFREQ] Longhaul - Remove duplicate multipliers
    [CPUFREQ] Longhaul - Embedded "conservative"
    [CPUFREQ] acpi-cpufreq: Proper ReadModifyWrite of PERF_CTL MSR
    [CPUFREQ] check return value of sysfs_create_file
    [CPUFREQ] Longhaul - Check ACPI "BM DMA in progress" bit
    [CPUFREQ] Longhaul - Move old_ratio to correct place
    [CPUFREQ] Longhaul - VT8237 support
    [CPUFREQ] Longhaul - Use all kinds of support
    [CPUFREQ] powernow-k8: clarify number of cores.

    Linus Torvalds
     

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
     

22 Jun, 2007

1 commit


11 Feb, 2007

1 commit

  • The hotplug CPU locking in cpufreq is horrendous. No-one seems to care
    enough to fix it, so just remove it so that the 99.9% of the real world
    users of this code can use cpufreq without being bothered by warnings.

    Signed-off-by: Andrew Morton
    Signed-off-by: Dave Jones

    Dave Jones
     

21 Oct, 2006

1 commit


26 Jul, 2006

1 commit

  • The patch below moves the cpu hotplugging higher up in the cpufreq
    layering; this is needed to avoid recursive taking of the cpu hotplug
    lock and to otherwise detangle the mess.

    The new rules are:
    1. you must do lock_cpu_hotplug() around the following functions:
    __cpufreq_driver_target
    __cpufreq_governor (for CPUFREQ_GOV_LIMITS operation only)
    __cpufreq_set_policy
    2. governer methods (.governer) must NOT take the lock_cpu_hotplug()
    lock in any way; they are called with the lock taken already
    3. if your governer spawns a thread that does things, like calling
    __cpufreq_driver_target, your thread must honor rule #1.
    4. the policy lock and other cpufreq internal locks nest within
    the lock_cpu_hotplug() lock.

    I'm not entirely happy about how the __cpufreq_governor rule ended up
    (conditional locking rule depending on the argument) but basically all
    callers pass this as a constant so it's not too horrible.

    The patch also removes the cpufreq_governor() function since during the
    locking audit it turned out to be entirely unused (so no need to fix it)

    The patch works on my testbox, but it could use more testing
    (otoh... it can't be much worse than the current code)

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Linus Torvalds

    Arjan van de Ven
     

01 Jul, 2006

1 commit


28 Feb, 2006

1 commit


28 Jan, 2006

1 commit

  • Userspace governor need not to hold it's own cpufreq_policy,
    better make use of the global core policy.
    Also fixes a bug in case of frequency changes via _PPC.
    Old min/max values have wrongly been passed to __cpufreq_driver_target()
    (kind of buffered) and when max freq was available again, only the old
    max(normally lowest freq) was still active.

    Signed-off-by: Thomas Renninger
    Signed-off-by: Venkatesh Pallipadi
    Signed-off-by: Dave Jones

    cpufreq_userspace.c | 53 +++++++++++++++++++++++++++-------------------------
    1 files changed, 28 insertions(+), 25 deletions(-)

    Thomas Renninger
     

19 Jan, 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