09 May, 2010

1 commit


10 Apr, 2010

1 commit

  • Multiple modules used to define those which are with identical
    functionality and were needlessly replicated among the different cpufreq
    drivers. Push them into the header and remove duplication.

    Signed-off-by: Borislav Petkov
    LKML-Reference:
    Reviewed-by: Thomas Renninger
    Signed-off-by: H. Peter Anvin

    Borislav Petkov
     

01 Apr, 2010

1 commit

  • There is no need to do sysfs_remove_link() or kobject_put() etc.
    when policy_rwsem_write is held, move them after releasing the lock.

    This fixes the lockdep warning:

    halt/4071 is trying to acquire lock:
    (s_active){++++.+}, at: [] .sysfs_addrm_finish+0x58/0xc0

    but task is already holding lock:
    (&per_cpu(cpu_policy_rwsem, cpu)){+.+.+.}, at: [] .lock_policy_rwsem_write+0x84/0xf4

    Reported-by: Benjamin Herrenschmidt
    Signed-off-by: WANG Cong
    Cc: Johannes Berg
    Cc: Venkatesh Pallipadi
    Signed-off-by: Dave Jones

    Amerigo Wang
     

08 Mar, 2010

1 commit

  • Constify struct sysfs_ops.

    This is part of the ops structure constification
    effort started by Arjan van de Ven et al.

    Benefits of this constification:

    * prevents modification of data that is shared
    (referenced) by many other structure instances
    at runtime

    * detects/prevents accidental (but not intentional)
    modification attempts on archs that enforce
    read-only kernel data at runtime

    * potentially better optimized code as the compiler
    can assume that the const data cannot be changed

    * the compiler/linker move const data into .rodata
    and therefore exclude them from false sharing

    Signed-off-by: Emese Revfy
    Acked-by: David Teigland
    Acked-by: Matt Domsch
    Acked-by: Maciej Sosnowski
    Acked-by: Hans J. Koch
    Acked-by: Pekka Enberg
    Acked-by: Jens Axboe
    Acked-by: Stephen Hemminger
    Signed-off-by: Greg Kroah-Hartman

    Emese Revfy
     

15 Dec, 2009

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu: (34 commits)
    m68k: rename global variable vmalloc_end to m68k_vmalloc_end
    percpu: add missing per_cpu_ptr_to_phys() definition for UP
    percpu: Fix kdump failure if booted with percpu_alloc=page
    percpu: make misc percpu symbols unique
    percpu: make percpu symbols in ia64 unique
    percpu: make percpu symbols in powerpc unique
    percpu: make percpu symbols in x86 unique
    percpu: make percpu symbols in xen unique
    percpu: make percpu symbols in cpufreq unique
    percpu: make percpu symbols in oprofile unique
    percpu: make percpu symbols in tracer unique
    percpu: make percpu symbols under kernel/ and mm/ unique
    percpu: remove some sparse warnings
    percpu: make alloc_percpu() handle array types
    vmalloc: fix use of non-existent percpu variable in put_cpu_var()
    this_cpu: Use this_cpu_xx in trace_functions_graph.c
    this_cpu: Use this_cpu_xx for ftrace
    this_cpu: Use this_cpu_xx in nmi handling
    this_cpu: Use this_cpu operations in RCU
    this_cpu: Use this_cpu ops for VM statistics
    ...

    Fix up trivial (famous last words) global per-cpu naming conflicts in
    arch/x86/kvm/svm.c
    mm/slab.c

    Linus Torvalds
     

25 Nov, 2009

2 commits

  • This interface is mainly intended (and implemented) for ACPI _PPC BIOS
    frequency limitations, but other cpufreq drivers can also use it for
    similar use-cases.

    Why is this needed:

    Currently it's not obvious why cpufreq got limited.
    People see cpufreq/scaling_max_freq reduced, but this could have
    happened by:
    - any userspace prog writing to scaling_max_freq
    - thermal limitations
    - hardware (_PPC in ACPI case) limitiations

    Therefore export bios_limit (in kHz) to:
    - Point the user that it's the BIOS (broken or intended) which limits
    frequency
    - Export it as a sysfs interface for userspace progs.
    While this was a rarely used feature on laptops, there will appear
    more and more server implemenations providing "Green IT" features like
    allowing the service processor to limit the frequency. People want
    to know about HW/BIOS frequency limitations.

    All ACPI P-state driven cpufreq drivers are covered with this patch:
    - powernow-k8
    - powernow-k7
    - acpi-cpufreq

    Tested with a patched DSDT which limits the first two cores (_PPC returns 1)
    via _PPC, exposed by bios_limit:
    # echo 2200000 >cpu2/cpufreq/scaling_max_freq
    # cat cpu*/cpufreq/scaling_max_freq
    2600000
    2600000
    2200000
    2200000
    # #scaling_max_freq shows general user/thermal/BIOS limitations

    # cat cpu*/cpufreq/bios_limit
    2600000
    2600000
    2800000
    2800000
    # #bios_limit only shows the HW/BIOS limitation

    CC: Pallipadi Venkatesh
    CC: Len Brown
    CC: davej@codemonkey.org.uk
    CC: linux@dominikbrodowski.net

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

    Thomas Renninger
     
  • No need to export these symbols; make them static.

    cpufreq_add_dev_policy
    cpufreq_add_dev_symlink
    cpufreq_add_dev_interface

    Signed-off-by: Alex Chiang
    Signed-off-by: Dave Jones

    Alex Chiang
     

18 Nov, 2009

2 commits

  • Dave,

    Attached is an update of my patch against the cpufreq fixes branch.

    Before applying the patch I compiled and booted the tree to see if the panic
    was still there -- to my surprise it was not. This is because of the conversion
    of cpufreq_cpu_governor to a char[].

    While the panic is kaput, the problem of stale data continues and my patch is
    still valid. It is possible to end up with the wrong governor after hotplug
    events because CPUFREQ_DEFAULT_GOVERNOR is statically linked to a default,
    while the cpu siblings may have had a different governor assigned by a user.

    ie) the patch is still needed in order to keep the governors assigned
    properly when hotplugging devices

    Signed-off-by: Prarit Bhargava
    Signed-off-by: Dave Jones

    Prarit Bhargava
     
  • Currently on governer backup/restore path we storing governor's pointer.
    This is wrong because one may unload governor's module after cpu goes
    offline. As result use-after-free will take place on restored cpu.
    It is not easy to exploit this bug, but still we have to close this
    issue ASAP. Issue was introduced by following commit
    084f34939424161669467c19280dbcf637730314

    ##TESTCASE##
    #!/bin/sh -x
    modprobe acpi_cpufreq
    # Any non default governor, in may case it is "ondemand"
    modprobe cpufreq_ondemand
    echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
    rmmod acpi_cpufreq
    rmmod cpufreq_ondemand
    modprobe acpi_cpufreq # << use-after-free here.

    Signed-off-by: Dmitry Monakhov
    Signed-off-by: Dave Jones

    Dmitry Monakhov
     

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
     

02 Sep, 2009

9 commits

  • remove rwsem lock from CPUFREQ_GOV_STOP call (second call site)

    commit 42a06f2166f2f6f7bf04f32b4e823eacdceafdc9

    Missed a call site for CPUFREQ_GOV_STOP to remove the rwlock taken around the
    teardown. To make a long story short, the rwlock write-lock causes a circular
    dependency with cancel_delayed_work_sync(), because the timer handler takes the
    read lock.

    Note that all callers to __cpufreq_set_policy are taking the rwsem. All sysfs
    callers (writers) hold the write rwsem at the earliest sysfs calling stage.

    However, the rwlock write-lock is not needed upon governor stop.

    Signed-off-by: Mathieu Desnoyers
    Acked-by: Venkatesh Pallipadi
    CC: rjw@sisk.pl
    CC: mingo@elte.hu
    CC: Shaohua Li
    CC: Pekka Enberg
    CC: Dave Young
    CC: "Rafael J. Wysocki"
    CC: Rusty Russell
    CC: trenn@suse.de
    CC: sven.wegener@stealer.net
    CC: cpufreq@vger.kernel.org
    Signed-off-by: Dave Jones

    Mathieu Desnoyers
     
  • Currently everything in the cpufreq layer is per core based.
    This does not reflect reality, for example ondemand on conservative
    governors have global sysfs variables.

    Introduce a global cpufreq directory and add the kobject to the governor
    struct, so that governors can easily access it.
    The directory is initialized in the cpufreq_core_init initcall and thus will
    always be created if cpufreq is compiled in, even if no cpufreq driver is
    active later.

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

    Thomas Renninger
     
  • Doing:
    echo 0 >cpu1/online
    echo 1 >cpu1/online

    on a managed CPU will result in:
    Jul 22 15:15:37 linux kernel: [ 80.013864] WARNING: at fs/sysfs/dir.c:487 sysfs_add_one+0xcf/0xe6()
    Jul 22 15:15:37 linux kernel: [ 80.013866] Hardware name: To Be Filled By O.E.M.
    Jul 22 15:15:37 linux kernel: [ 80.013868] sysfs: cannot create duplicate filename '/devices/system/cpu/cpu1/cpufreq'
    Jul 22 15:15:37 linux kernel: [ 80.013870] Modules linked in: powernow_k8
    Jul 22 15:15:37 linux kernel: [ 80.013874] Pid: 5750, comm: bash Not tainted 2.6.31-rc2 #40
    Jul 22 15:15:37 linux kernel: [ 80.013876] Call Trace:
    Jul 22 15:15:37 linux kernel: [ 80.013879] [] ? sysfs_add_one+0xcf/0xe6
    Jul 22 15:15:37 linux kernel: [ 80.013884] [] warn_slowpath_common+0x77/0xa4
    Jul 22 15:15:37 linux kernel: [ 80.013888] [] warn_slowpath_fmt+0x3c/0x3e
    Jul 22 15:15:37 linux kernel: [ 80.013891] [] sysfs_add_one+0xcf/0xe6
    Jul 22 15:15:37 linux kernel: [ 80.013894] [] create_dir+0x58/0x87
    Jul 22 15:15:37 linux kernel: [ 80.013898] [] sysfs_create_dir+0x38/0x4f
    Jul 22 15:15:37 linux kernel: [ 80.013902] [] kobject_add_internal+0x11f/0x1de
    Jul 22 15:15:37 linux kernel: [ 80.013905] [] kobject_add_varg+0x41/0x4e
    Jul 22 15:15:37 linux kernel: [ 80.013908] [] kobject_init_and_add+0x4c/0x57
    Jul 22 15:15:37 linux kernel: [ 80.013913] [] ? mark_lock+0x22/0x228
    Jul 22 15:15:37 linux kernel: [ 80.013918] [] cpufreq_add_dev_interface+0x40/0x1e4
    ...

    This bug slipped in by git commit:
    150b06f7f223cfd0f808737a5243cceca8ea47fa

    When splitting up cpufreq_add_dev, the whole cpufreq_add_dev function
    is not left anymore, only cpufreq_add_dev_policy.
    This patch should reconstruct the identical functionality again as it
    was before the split.

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

    Thomas Renninger
     
  • Signed-off-by: Dave Jones

    Dave Jones
     
  • Signed-off-by: Dave Jones

    Dave Jones
     
  • Signed-off-by: Dave Jones

    Dave Jones
     
  • Signed-off-by: Dave Jones

    Dave Jones
     
  • Signed-off-by: Dave Jones

    Dave Jones
     
  • Commit 4bc5d3413503 is broken and causes regressions:

    (1) cpufreq_driver->resume() and ->suspend() were only called on
    __powerpc__, but you could set them on all architectures. In fact,
    ->resume() was defined and used before the PPC-related commit
    42d4dc3f4e1e complained about in 4bc5d3413503.

    (2) Therfore, the resume functions in acpi_cpufreq and speedstep-smi
    would never be called.

    (3) This means speedstep-smi would be unusuable after suspend or resume.

    The _real_ problem was calling cpufreq_driver->get() with interrupts
    off, but it re-enabling interrupts on some platforms. Why is ->get()
    necessary?

    Some systems like to change the CPU frequency behind our
    back, especially during BIOS-intensive operations like suspend or
    resume. If such systems also use a CPU frequency-dependant timing loop,
    delays might be off by large factors. Therefore, we need to ascertain
    as soon as possible that the CPU frequency is indeed at the speed we
    think it is. You can do this two ways: either setting it anew, or trying
    to get it. The latter is what was done, the former also has the same IRQ
    issue.

    So, let's try something different: defer the checking to after interrupts
    are re-enabled, by calling cpufreq_update_policy() (via schedule_work()).
    Timings may be off until this later stage, so let's watch out for
    resume regressions caused by the deferred handling of frequency changes
    behind the kernel's back.

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

    Dominik Brodowski
     

05 Aug, 2009

3 commits

  • The suspend code runs with interrupts disabled, and the powerpc workaround we
    do in the cpufreq suspend hook calls the drivers ->get method.

    powernow-k8's ->get does an smp_call_function_single
    which needs interrupts enabled

    cpufreq's suspend/resume code was added in 42d4dc3f4e1e to work around
    a hardware problem on ppc powerbooks. If we make all this code
    conditional on powerpc, we avoid the issue above.

    Signed-off-by: Dave Jones

    Dave Jones
     
  • The first offline/online cycle is successful, the second not.
    Doing:
    echo 0 >cpu1/online
    echo 1 >cpu1/online
    echo 0 >cpu1/online

    The last command will trigger:
    Jul 22 14:39:50 linux kernel: [ 593.210125] ------------[ cut here ]------------
    Jul 22 14:39:50 linux kernel: [ 593.210139] WARNING: at lib/kref.c:43 kref_get+0x23/0x2b()
    Jul 22 14:39:50 linux kernel: [ 593.210144] Hardware name: To Be Filled By O.E.M.
    Jul 22 14:39:50 linux kernel: [ 593.210148] Modules linked in: powernow_k8
    Jul 22 14:39:50 linux kernel: [ 593.210158] Pid: 378, comm: kondemand/2 Tainted: G W 2.6.31-rc2 #38
    Jul 22 14:39:50 linux kernel: [ 593.210163] Call Trace:
    Jul 22 14:39:50 linux kernel: [ 593.210171] [] ? kref_get+0x23/0x2b
    Jul 22 14:39:50 linux kernel: [ 593.210181] [] warn_slowpath_common+0x77/0xa4
    Jul 22 14:39:50 linux kernel: [ 593.210190] [] warn_slowpath_null+0xf/0x11
    Jul 22 14:39:50 linux kernel: [ 593.210198] [] kref_get+0x23/0x2b
    Jul 22 14:39:50 linux kernel: [ 593.210206] [] kobject_get+0x1a/0x22
    Jul 22 14:39:50 linux kernel: [ 593.210214] [] cpufreq_cpu_get+0x8a/0xcb
    Jul 22 14:39:50 linux kernel: [ 593.210222] [] __cpufreq_driver_getavg+0x1d/0x67
    Jul 22 14:39:50 linux kernel: [ 593.210231] [] do_dbs_timer+0x158/0x27f
    Jul 22 14:39:50 linux kernel: [ 593.210240] [] worker_thread+0x200/0x313
    ...

    The output continues on every do_dbs_timer ondemand freq checking poll.
    This regression was introduced by git commit:
    3f4a782b5ce2698b1870b5a7b573cd721d4fce33

    The policy is released when the cpufreq device is removed in:
    __cpufreq_remove_dev():
    /* if this isn't the CPU which is the parent of the kobj, we
    * only need to unlink, put and exit
    */

    Not creating the symlink is not sever at all.
    As long as:
    sysfs_remove_link(&sys_dev->kobj, "cpufreq");
    handles it gracefully that the symlink did not exist.
    Possibly no error should be returned at all, because ondemand
    governor would still provide the same functionality.
    Userspace in userspace gov case might be confused if the link
    is missing.

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

    CC: Mathieu Desnoyers
    CC: Venkatesh Pallipadi
    Signed-off-by: Thomas Renninger
    Signed-off-by: Dave Jones

    Thomas Renninger
     
  • Suspend/Resume fails on multi socket, multi core systems because the cpufreq
    code erroneously sets the per_cpu policy_cpu value when a logical cpu is
    offline.

    This most notably results in missing sysfs files that are used to set the
    cpu frequencies of the various cpus.

    Signed-off-by: Prarit Bhargava
    Signed-off-by: Dave Jones

    Prarit Bhargava
     

09 Jul, 2009

1 commit


07 Jul, 2009

2 commits

  • OK, I've tried to clean it up the best I could, but please test this with
    concurrent cpu hotplug and cpufreq add/remove in loops. I'm sure we will make
    other interesting findings.

    This is step one of fixing the overall locking dependency mess in cpufreq.

    Signed-off-by: Mathieu Desnoyers
    CC: Venkatesh Pallipadi
    CC: rjw@sisk.pl
    CC: mingo@elte.hu
    CC: Shaohua Li
    CC: Pekka Enberg
    CC: Dave Young
    CC: "Rafael J. Wysocki"
    CC: Rusty Russell
    CC: sven.wegener@stealer.net
    CC: cpufreq@vger.kernel.org
    CC: Thomas Renninger
    Signed-off-by: Dave Jones

    Mathieu Desnoyers
     
  • Commit b14893a62c73af0eca414cfed505b8c09efc613c although it was very
    much needed to properly cleanup ondemand timer, opened-up a can of worms
    related to locking dependencies in cpufreq.

    Patch here defines the need for dbs_mutex and cleans up its usage in
    ondemand governor. This also resolves the lockdep warnings reported here

    http://lkml.indiana.edu/hypermail/linux/kernel/0906.1/01925.html
    http://lkml.indiana.edu/hypermail/linux/kernel/0907.0/00820.html

    and few others..

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

    venkatesh.pallipadi@intel.com
     

09 Jun, 2009

1 commit


27 May, 2009

1 commit

  • * Rafael J. Wysocki (rjw@sisk.pl) wrote:
    > This message has been generated automatically as a part of a report
    > of regressions introduced between 2.6.28 and 2.6.29.
    >
    > The following bug entry is on the current list of known regressions
    > introduced between 2.6.28 and 2.6.29. Please verify if it still should
    > be listed and let me know (either way).
    >
    >
    > Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=13186
    > Subject : cpufreq timer teardown problem
    > Submitter : Mathieu Desnoyers
    > Date : 2009-04-23 14:00 (24 days old)
    > References : http://marc.info/?l=linux-kernel&m=124049523515036&w=4
    > Handled-By : Mathieu Desnoyers
    > Patch : http://patchwork.kernel.org/patch/19754/
    > http://patchwork.kernel.org/patch/19753/

    The patches linked above depend on the following patch to remove
    circular locking dependency :

    cpufreq: remove rwsem lock from CPUFREQ_GOV_STOP call

    (the following issue was faced when using cancel_delayed_work_sync() in the
    timer teardown (which fixes a race).

    * KOSAKI Motohiro (kosaki.motohiro@jp.fujitsu.com) wrote:
    > Hi
    >
    > my box output following warnings.
    > it seems regression by commit 7ccc7608b836e58fbacf65ee4f8eefa288e86fac.
    >
    > A: work -> do_dbs_timer() -> cpu_policy_rwsem
    > B: store() -> cpu_policy_rwsem -> cpufreq_governor_dbs() -> work
    >
    >

    Hrm, I think it must be due to my attempt to fix the timer teardown race
    in ondemand governor mixed with new locking behavior in 2.6.30-rc.

    The rwlock seems to be taken around the whole call to
    cpufreq_governor_dbs(), when it should be only taken around accesses to
    the locked data, and especially *not* around the call to
    dbs_timer_exit().

    Reverting my fix attempt would put the teardown race back in place
    (replacing the cancel_delayed_work_sync by cancel_delayed_work).
    Instead, a proper fix would imply modifying this critical section :

    cpufreq.c: __cpufreq_remove_dev()
    ...
    if (cpufreq_driver->target)
    __cpufreq_governor(data, CPUFREQ_GOV_STOP);

    unlock_policy_rwsem_write(cpu);

    To make sure the __cpufreq_governor() callback is not called with rwsem
    held. This would allow execution of cancel_delayed_work_sync() without
    being nested within the rwsem.

    Applies on top of the 2.6.30-rc5 tree.

    Required to remove circular dep in teardown of both conservative and
    ondemande governors so they can use cancel_delayed_work_sync().
    CPUFREQ_GOV_STOP does not modify the policy, therefore this locking seemed
    unneeded.

    Signed-off-by: Mathieu Desnoyers
    CC: KOSAKI Motohiro
    Cc: Greg KH
    CC: Ingo Molnar
    CC: "Rafael J. Wysocki"
    CC: Ben Slusky
    CC: Chris Wright
    CC: Andrew Morton
    Signed-off-by: Dave Jones

    Mathieu Desnoyers
     

27 Mar, 2009

1 commit

  • * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq: (35 commits)
    [CPUFREQ] Prevent p4-clockmod from auto-binding to the ondemand governor.
    [CPUFREQ] Make cpufreq-nforce2 less obnoxious
    [CPUFREQ] p4-clockmod reports wrong frequency.
    [CPUFREQ] powernow-k8: Use a common exit path.
    [CPUFREQ] Change link order of x86 cpufreq modules
    [CPUFREQ] conservative: remove 10x from def_sampling_rate
    [CPUFREQ] conservative: fixup governor to function more like ondemand logic
    [CPUFREQ] conservative: fix dbs_cpufreq_notifier so freq is not locked
    [CPUFREQ] conservative: amend author's email address
    [CPUFREQ] Use swap() in longhaul.c
    [CPUFREQ] checkpatch cleanups for acpi-cpufreq
    [CPUFREQ] powernow-k8: Only print error message once, not per core.
    [CPUFREQ] ondemand/conservative: sanitize sampling_rate restrictions
    [CPUFREQ] ondemand/conservative: deprecate sampling_rate{min,max}
    [CPUFREQ] powernow-k8: Always compile powernow-k8 driver with ACPI support
    [CPUFREQ] Introduce /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_transition_latency
    [CPUFREQ] checkpatch cleanups for powernow-k8
    [CPUFREQ] checkpatch cleanups for ondemand governor.
    [CPUFREQ] checkpatch cleanups for powernow-k7
    [CPUFREQ] checkpatch cleanups for speedstep related drivers.
    ...

    Linus Torvalds
     

10 Mar, 2009

1 commit

  • This reverts commit e088e4c9cdb618675874becb91b2fd581ee707e6.

    Removing the sysfs interface for p4-clockmod was flagged as a
    regression in bug 12826.

    Course of action:
    - Find out the remaining causes of overheating, and fix them
    if possible. ACPI should be doing the right thing automatically.
    If it isn't, we need to fix that.
    - mark p4-clockmod ui as deprecated
    - try again with the removal in six months.

    It's not really feasible to printk about the deprecation, because
    it needs to happen at all the sysfs entry points, which means adding
    a lot of strcmp("p4-clockmod".. calls to the core, which.. bleuch.

    Signed-off-by: Dave Jones

    Dave Jones
     

25 Feb, 2009

2 commits


06 Jan, 2009

1 commit

  • Impact: use new cpumask API to reduce memory usage

    This is part of an effort to reduce structure sizes for machines
    configured with large NR_CPUS. cpumask_t gets replaced by
    cpumask_var_t, which is either struct cpumask[1] (small NR_CPUS) or
    struct cpumask * (large NR_CPUS).

    Signed-off-by: Rusty Russell
    Signed-off-by: Mike Travis
    Acked-by: Dave Jones
    Signed-off-by: Ingo Molnar

    Rusty Russell
     

06 Dec, 2008

2 commits

  • Previously driver resume would always set the current policy min/max with
    the cpuinfo min/max, defined by user_policy.min/max. Resulting in a reset
    of policy settings when policy.min/max != cpuinfo.min/max when coming out
    of suspend. Now user_policy is saved as the policy instead of cpuinfo to
    preserve what the user actually set.

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

    Mike Chan
     
  • p4-clockmod has a long history of abuse. It pretends to be a CPU
    frequency scaling driver, even though it doesn't actually change
    the CPU frequency, but instead just modulates the frequency with
    wait-states.
    The biggest misconception is that when running at the lower 'frequency'
    p4-clockmod is saving power. This isn't the case, as workloads running
    slower take longer to complete, preventing the CPU from entering deep C states.

    However p4-clockmod does have a purpose. It can prevent overheating.
    Having it hooked up to the cpufreq interfaces is the wrong way to achieve
    cooling however. It should instead be hooked up to ACPI.

    This diff introduces a means for a cpufreq driver to register with the
    cpufreq core, but not present a sysfs interface.

    Signed-off-by: Matthew Garrett
    Signed-off-by: Dave Jones

    Matthew Garrett
     

10 Oct, 2008

2 commits

  • Add a cpu parameter to __cpufreq_driver_getavg(). This is needed for software
    cpufreq coordination where policy->cpu may not be same as the CPU on which we
    want to getavg frequency.

    A follow-on patch will use this parameter to getavg freq from all cpus
    in policy->cpus.

    Change since last patch. Fix the offline/online and suspend/resume
    oops reported by Youquan Song

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

    venkatesh.pallipadi@intel.com
     
  • After calling cpufreq_cpu_get, error handling code should call
    cpufreq_cpu_put.

    The semantic match that finds this problem is as follows:
    (http://www.emn.fr/x-info/coccinelle/)

    //
    @r@
    expression x,E;
    statement S;
    position p1,p2,p3;
    @@

    (
    if ((x = cpufreq_cpu_get@p1(...)) == NULL || ...) S
    |
    x = cpufreq_cpu_get@p1(...)
    ... when != x
    if (x == NULL || ...) S
    )

    (
    return x;
    |
    return 0;
    |
    x = E
    |
    E = x
    |
    cpufreq_cpu_put(x)
    )

    @exists@
    position r.p1,r.p2,r.p3;
    expression x;
    int ret != 0;
    statement S;
    @@

    * x = cpufreq_cpu_get@p1(...)

    * return@p2 \(NULL\|ret\);
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Dave Jones

    Julia Lawall
     

31 Jul, 2008

1 commit

  • Ingo Molnar provided a fix to not call _PPC at processor driver
    initialization time in "[PATCH] ACPI: fix cpufreq regression" (git
    commit e4233dec749a3519069d9390561b5636a75c7579)

    But it can still happen that _PPC is called at processor driver
    initialization time.

    This patch should make sure that this is not possible anymore.

    Signed-off-by: Thomas Renninger
    Cc: Andi Kleen
    Cc: Len Brown
    Cc: Dave Jones
    Cc: Ingo Molnar
    Cc: Venkatesh Pallipadi
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Thomas Renninger
     

24 Jul, 2008

1 commit

  • * 'cpus4096-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (31 commits)
    NR_CPUS: Replace NR_CPUS in speedstep-centrino.c
    cpumask: Provide a generic set of CPUMASK_ALLOC macros, FIXUP
    NR_CPUS: Replace NR_CPUS in cpufreq userspace routines
    NR_CPUS: Replace per_cpu(..., smp_processor_id()) with __get_cpu_var
    NR_CPUS: Replace NR_CPUS in arch/x86/kernel/genapic_flat_64.c
    NR_CPUS: Replace NR_CPUS in arch/x86/kernel/genx2apic_uv_x.c
    NR_CPUS: Replace NR_CPUS in arch/x86/kernel/cpu/proc.c
    NR_CPUS: Replace NR_CPUS in arch/x86/kernel/cpu/mcheck/mce_64.c
    cpumask: Optimize cpumask_of_cpu in lib/smp_processor_id.c, fix
    cpumask: Use optimized CPUMASK_ALLOC macros in the centrino_target
    cpumask: Provide a generic set of CPUMASK_ALLOC macros
    cpumask: Optimize cpumask_of_cpu in lib/smp_processor_id.c
    cpumask: Optimize cpumask_of_cpu in kernel/time/tick-common.c
    cpumask: Optimize cpumask_of_cpu in drivers/misc/sgi-xp/xpc_main.c
    cpumask: Optimize cpumask_of_cpu in arch/x86/kernel/ldt.c
    cpumask: Optimize cpumask_of_cpu in arch/x86/kernel/io_apic_64.c
    cpumask: Replace cpumask_of_cpu with cpumask_of_cpu_ptr
    Revert "cpumask: introduce new APIs"
    cpumask: make for_each_cpu_mask a bit smaller
    net: Pass reference to cpumask variable in net/sunrpc/svc.c
    ...

    Fix up trivial conflicts in drivers/cpufreq/cpufreq.c manually

    Linus Torvalds
     

22 Jul, 2008

1 commit


06 Jul, 2008

1 commit