15 Sep, 2011

1 commit

  • per_cpu(processors, n) can be NULL, resulting in:

    Loading CPUFreq modules[ 437.661360] BUG: unable to handle kernel NULL pointer dereference at (null)
    IP: [] pcc_cpufreq_cpu_init+0x74/0x220 [pcc_cpufreq]

    It's better to avoid the oops by failing the driver, and allowing the
    system to boot.

    Signed-off-by: Naga Chumbalkar
    Cc: Dave Jones
    Cc: Len Brown
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Naga Chumbalkar
     

27 Jul, 2011

1 commit

  • * 'drm-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (135 commits)
    drm/radeon/kms: fix DP training for DPEncoderService revision bigger than 1.1
    drm/radeon/kms: add missing vddci setting on NI+
    drm/radeon: Add a rmb() in IH processing
    drm/radeon: ATOM Endian fix for atombios_crtc_program_pll()
    drm/radeon: Fix the definition of RADEON_BUF_SWAP_32BIT
    drm/radeon: Do an MMIO read on interrupts when not uisng MSIs
    drm/radeon: Writeback endian fixes
    drm/radeon: Remove a bunch of useless _iomem casts
    drm/gem: add support for private objects
    DRM: clean up and document parsing of video= parameter
    DRM: Radeon: Fix section mismatch.
    drm: really make debug levels match in edid failure code
    drm/radeon/kms: fix i2c map for rv250/280
    drm/nouveau/gr: disable fifo access and idle before suspend ctx unload
    drm/nouveau: pass flag to engine fini() method on suspend
    drm/nouveau: replace nv04_graph_fifo_access() use with direct reg bashing
    drm/nv40/gr: rewrite/split context takedown functions
    drm/nouveau: detect disabled device in irq handler and return IRQ_NONE
    drm/nouveau: ignore connector type when deciding digital/analog on DVI-I
    drm/nouveau: Add a quirk for Gigabyte NX86T
    ...

    Linus Torvalds
     

26 Jul, 2011

1 commit

  • * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (99 commits)
    drivers/virt: add missing linux/interrupt.h to fsl_hypervisor.c
    powerpc/85xx: fix mpic configuration in CAMP mode
    powerpc: Copy back TIF flags on return from softirq stack
    powerpc/64: Make server perfmon only built on ppc64 server devices
    powerpc/pseries: Fix hvc_vio.c build due to recent changes
    powerpc: Exporting boot_cpuid_phys
    powerpc: Add CFAR to oops output
    hvc_console: Add kdb support
    powerpc/pseries: Fix hvterm_raw_get_chars to accept < 16 chars, fixing xmon
    powerpc/irq: Quieten irq mapping printks
    powerpc: Enable lockup and hung task detectors in pseries and ppc64 defeconfigs
    powerpc: Add mpt2sas driver to pseries and ppc64 defconfig
    powerpc: Disable IRQs off tracer in ppc64 defconfig
    powerpc: Sync pseries and ppc64 defconfigs
    powerpc/pseries/hvconsole: Fix dropped console output
    hvc_console: Improve tty/console put_chars handling
    powerpc/kdump: Fix timeout in crash_kexec_wait_realmode
    powerpc/mm: Fix output of total_ram.
    powerpc/cpufreq: Add cpufreq driver for Momentum Maple boards
    powerpc: Correct annotations of pmu registration functions
    ...

    Fix up trivial Kconfig/Makefile conflicts in arch/powerpc, drivers, and
    drivers/cpufreq

    Linus Torvalds
     

19 Jul, 2011

1 commit


14 Jul, 2011

18 commits


11 Jul, 2011

1 commit


29 Jun, 2011

1 commit


17 Jun, 2011

3 commits

  • This patch augments the pstate transition code to error out
    (instead of returning 0) when an incorrect pstate is provided.

    Suggested-by: Borislav Petkov
    CC: andre.przywara@amd.com
    CC: Mark.Langsdorf@amd.com
    Signed-off-by: Konrad Rzeszutek Wilk
    Signed-off-by: Dave Jones

    Konrad Rzeszutek Wilk
     
  • Before this patch if we failed the vid transition would still try to
    submit the "new" frequencies to cpufreq.
    That is incorrect - also we could submit a non-existing frequency value
    which would cause cpufreq to crash. The ultimate fix is in cpufreq
    to deal with incorrect values, but this patch improves the error
    recovery in the AMD powernowk8 driver.

    The failure that was reported was as follows:

    powernow-k8: Found 1 AMD Athlon(tm) 64 Processor 3700+ (1 cpu cores) (version 2.20.00)
    powernow-k8: fid 0x2 (1000 MHz), vid 0x12
    powernow-k8: fid 0xa (1800 MHz), vid 0xa
    powernow-k8: fid 0xc (2000 MHz), vid 0x8
    powernow-k8: fid 0xe (2200 MHz), vid 0x8
    Marking TSC unstable due to cpufreq changes
    powernow-k8: fid trans failed, fid 0x2, curr 0x0
    BUG: unable to handle kernel paging request at ffff880807e07b78
    IP: [] cpufreq_stats_update+0x46/0x5b
    ...

    And transition fails and data->currfid ends up with 0. Since
    the machine does not support 800Mhz value when the calculation is
    done ('find_khz_freq_from_fid(data->currfid);') it reports the
    new frequency as 800000 which is bogus. This patch fixes
    the issue during target setting.

    The patch however does not fix the issue in 'powernowk8_cpu_init'
    where the pol->cur can also be set with the 800000 value:

    pol->cur = find_khz_freq_from_fid(data->currfid);
    dprintk("policy current frequency %d kHz\n", pol->cur);

    /* min/max the cpu is capable of */
    if (cpufreq_frequency_table_cpuinfo(pol, data->powernow_table)) {

    The fix for that looks to update cpufreq_frequency_table_cpuinfo to
    check pol->cur.... but that would cause an regression in how the
    acpi-cpufreq driver works (it sets cpu->cur after calling
    cpufreq_frequency_table_cpuinfo). Instead the fix will be to let
    cpufreq gracefully handle bogus data (another patch).

    Acked-by: Borislav Petkov
    CC: andre.przywara@amd.com
    CC: Mark.Langsdorf@amd.com
    Reported-by: Tobias Diedrich
    Tested-by: Tobias Diedrich
    [v1: Rebased on v3.0-rc2, reduced patch to deal with vid case]
    Signed-off-by: Konrad Rzeszutek Wilk
    Signed-off-by: Dave Jones

    Konrad Rzeszutek Wilk
     
  • If the driver submitted an non-existing pol>cur value (say it
    used the default initialized value of zero), when the cpufreq
    stats tries to setup its initial values it incorrectly sets
    stat->last_index to -1 (or 0xfffff...). And cpufreq_stats_update
    tries to update at that index location and fails.

    This can be caused by:

    stat->last_index = freq_table_get_index(stat, policy->cur);

    not finding the appropiate frequency in the table (b/c the policy->cur
    is wrong) and we end up crashing. The fix however is
    concentrated in the 'cpufreq_stats_update' as the last_index
    (and old_index) are updated there. Which means it can reset
    the last_index to -1 again and on the next iteration cause a crash.

    Without this patch, the following crash is observed:

    powernow-k8: Found 1 AMD Athlon(tm) 64 Processor 3700+ (1 cpu cores) (version 2.20.00)
    powernow-k8: fid 0x2 (1000 MHz), vid 0x12
    powernow-k8: fid 0xa (1800 MHz), vid 0xa
    powernow-k8: fid 0xc (2000 MHz), vid 0x8
    powernow-k8: fid 0xe (2200 MHz), vid 0x8
    Marking TSC unstable due to cpufreq changes
    powernow-k8: fid trans failed, fid 0x2, curr 0x0
    BUG: unable to handle kernel paging request at ffff880807e07b78
    IP: [] cpufreq_stats_update+0x46/0x5b
    .. snip..
    Pid: 1, comm: swapper Not tainted 3.0.0-rc2 #45 MICRO-STAR INTERNATIONAL CO., LTD MS-7094/MS-7094
    ..snip..
    Call Trace:
    [] cpufreq_stat_notifier_trans+0x48/0x7c
    [] notifier_call_chain+0x32/0x5e
    [] __srcu_notifier_call_chain+0x47/0x63
    [] srcu_notifier_call_chain+0xf/0x11
    [] cpufreq_notify_transition+0x111/0x134
    [] powernowk8_target+0x53b/0x617
    [] __cpufreq_driver_target+0x2e/0x30
    [] cpufreq_governor_dbs+0x339/0x356
    [] __cpufreq_governor+0xa8/0xe9
    [] __cpufreq_set_policy+0x132/0x13e
    [] cpufreq_add_dev_interface+0x272/0x28c

    Reported-by: Tobias Diedrich
    Tested-by: Tobias Diedrich
    Signed-off-by: Konrad Rzeszutek Wilk
    Signed-off-by: Dave Jones

    Konrad Rzeszutek Wilk
     

13 Jun, 2011

1 commit


25 May, 2011

3 commits


20 May, 2011

2 commits

  • * 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    x86, cpu: Fix detection of Celeron Covington stepping A1 and B0
    Documentation, ABI: Update L3 cache index disable text
    x86, AMD, cacheinfo: Fix L3 cache index disable checks
    x86, AMD, cacheinfo: Fix fallout caused by max3 conversion
    x86, cpu: Change NOP selection for certain Intel CPUs
    x86, cpu: Clean up and unify the NOP selection infrastructure
    x86, percpu: Use ASM_NOP4 instead of hardcoding P6_NOP4
    x86, cpu: Move AMD Elan Kconfig under "Processor family"

    Fix up trivial conflicts in alternative handling (commit dc326fca2b64
    "x86, cpu: Clean up and unify the NOP selection infrastructure" removed
    some hacky 5-byte instruction stuff, while commit d430d3d7e646 "jump
    label: Introduce static_branch() interface" renamed HAVE_JUMP_LABEL to
    CONFIG_JUMP_LABEL in the code that went away)

    Linus Torvalds
     
  • Signed-off-by: Dave Jones

    Dave Jones
     

04 May, 2011

5 commits

  • Since format string handling is part of request_module, there is no
    need to construct the module name. As such, drop the redundant sprintf
    and heap usage.

    Signed-off-by: Kees Cook
    Signed-off-by: Dave Jones

    Kees Cook
     
  • Fixed brace coding style issue.

    Signed-off-by: Karthigan Srinivasan
    Signed-off-by: Dave Jones

    Karthigan Srinivasan
     
  • When a CPU is taken offline in an SMP system, cpufreq_remove_dev()
    nulls out the per-cpu policy before cpufreq_stats_free_table() can
    make use of it. cpufreq_stats_free_table() then skips the
    call to sysfs_remove_group(), leaving about 100 bytes of sysfs-related
    memory unclaimed each time a CPU-removal occurs. Break up
    cpu_stats_free_table into sysfs and table portions, and
    call the sysfs portion early.

    Signed-off-by: Steven Finney
    Signed-off-by: Dave Jones
    Cc: stable@kernel.org

    steven finney
     
  • 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
     
  • When we discover CPUs that are affected by each other's
    frequency/voltage transitions, the first CPU gets a sysfs directory
    created, and rest of the siblings get symlinks. Currently, when we
    hotplug off only the first CPU, all of the symlinks and the sysfs
    directory gets removed. Even though rest of the siblings are still
    online and functional, they are orphaned, and no longer governed by
    cpufreq.

    This patch, given the above scenario, creates a sysfs directory for
    the first sibling and symlinks for the rest of the siblings.

    Please note the recursive call, it was rather too ugly to roll it
    out. And the removal of redundant NULL setting (it is already taken
    care of near the top of the function).

    Signed-off-by: Jacob Shin
    Acked-by: Mark Langsdorf
    Reviewed-by: Thomas Renninger
    Signed-off-by: Dave Jones
    Cc: stable@kernel.org

    Jacob Shin
     

31 Mar, 2011

1 commit


24 Mar, 2011

1 commit

  • The cpufreq subsystem uses sysdev suspend and resume for
    executing cpufreq_suspend() and cpufreq_resume(), respectively,
    during system suspend, after interrupts have been switched off on the
    boot CPU, and during system resume, while interrupts are still off on
    the boot CPU. In both cases the other CPUs are off-line at the
    relevant point (either they have been switched off via CPU hotplug
    during suspend, or they haven't been switched on yet during resume).
    For this reason, although it may seem that cpufreq_suspend() and
    cpufreq_resume() are executed for all CPUs in the system, they are
    only called for the boot CPU in fact, which is quite confusing.

    To remove the confusion and to prepare for elimiating sysdev
    suspend and resume operations from the kernel enirely, convernt
    cpufreq to using a struct syscore_ops object for the boot CPU
    suspend and resume and rename the callbacks so that their names
    reflect their purpose. In addition, put some explanatory remarks
    into their kerneldoc comments.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki