Skip to content
Snippets Groups Projects
  1. Jun 18, 2011
  2. Jun 17, 2011
  3. Jun 16, 2011
    • Konrad Rzeszutek Wilk's avatar
      [CPUFREQ] powernow-k8: Don't try to transition if the pstate is incorrect · fbb5b89e
      Konrad Rzeszutek Wilk authored
      
      This patch augments the pstate transition code to error out
      (instead of returning 0) when an incorrect pstate is provided.
      
      Suggested-by: default avatarBorislav Petkov <bp@alien8.de>
      CC: andre.przywara@amd.com
      CC: Mark.Langsdorf@amd.com
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarDave Jones <davej@redhat.com>
      fbb5b89e
    • Konrad Rzeszutek Wilk's avatar
      [CPUFREQ] powernow-k8: Don't notify of successful transition if we failed (vid case). · a9d3d206
      Konrad Rzeszutek Wilk authored
      
      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: [<ffffffff81479163>] 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: default avatarBorislav Petkov <bp@alien8.de>
      CC: andre.przywara@amd.com
      CC: Mark.Langsdorf@amd.com
      Reported-by: default avatarTobias Diedrich <ranma+xen@tdiedrich.de>
      Tested-by: default avatarTobias Diedrich <ranma+xen@tdiedrich.de>
      [v1: Rebased on v3.0-rc2, reduced patch to deal with vid case]
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarDave Jones <davej@redhat.com>
      a9d3d206
    • Konrad Rzeszutek Wilk's avatar
      [CPUFREQ] Don't set stat->last_index to -1 if the pol->cur has incorrect value. · 46a310b8
      Konrad Rzeszutek Wilk authored
      
      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: [<ffffffff81479163>] 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:
       [<ffffffff81479248>] cpufreq_stat_notifier_trans+0x48/0x7c
       [<ffffffff81095d68>] notifier_call_chain+0x32/0x5e
       [<ffffffff81095e6b>] __srcu_notifier_call_chain+0x47/0x63
       [<ffffffff81095e96>] srcu_notifier_call_chain+0xf/0x11
       [<ffffffff81477e7a>] cpufreq_notify_transition+0x111/0x134
       [<ffffffff8147b0d4>] powernowk8_target+0x53b/0x617
       [<ffffffff8147723a>] __cpufreq_driver_target+0x2e/0x30
       [<ffffffff8147a127>] cpufreq_governor_dbs+0x339/0x356
       [<ffffffff81477394>] __cpufreq_governor+0xa8/0xe9
       [<ffffffff81477525>] __cpufreq_set_policy+0x132/0x13e
       [<ffffffff8147848d>] cpufreq_add_dev_interface+0x272/0x28c
      
      Reported-by: default avatarTobias Diedrich <ranma+xen@tdiedrich.de>
      Tested-by: default avatarTobias Diedrich <ranma+xen@tdiedrich.de>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarDave Jones <davej@redhat.com>
      46a310b8
    • Torsten Schenk's avatar
      ALSA: 6fire - Fix signedness bug · 0ec5258d
      Torsten Schenk authored
      
      Fixed remaining issues of the signedness bug discovered by Dan Carpenter.
      A check was remaining that tests if unsigned rt->rate is >= 0.
      Changed that so that rt->rate now consistently uses ARRAY_SIZE(rates)
      as invalid rate value and not -1.
      
      Signed-off-by: default avatarTorsten Schenk <torsten.schenk@zoho.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      0ec5258d
    • Linus Torvalds's avatar
      Merge branch 'rc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6 · 7cc2ed05
      Linus Torvalds authored
      * 'rc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
        kbuild: Call depmod.sh via shell
        perf: clear out make flags when calling kernel make kernelver
      7cc2ed05
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6 · 8dac6bee
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
        AFS: Use i_generation not i_version for the vnode uniquifier
        AFS: Set s_id in the superblock to the volume name
        vfs: Fix data corruption after failed write in __block_write_begin()
        afs: afs_fill_page reads too much, or wrong data
        VFS: Fix vfsmount overput on simultaneous automount
        fix wrong iput on d_inode introduced by e6bc45d6
        Delay struct net freeing while there's a sysfs instance refering to it
        afs: fix sget() races, close leak on umount
        ubifs: fix sget races
        ubifs: split allocation of ubifs_info into a separate function
        fix leak in proc_set_super()
      8dac6bee
    • Linus Torvalds's avatar
      Merge branch 'sh-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-3.x · f8f44f09
      Linus Torvalds authored
      * 'sh-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-3.x:
        sh: sh7724: Add USBHS DMAEngine support
        sh: ecovec: Add renesas_usbhs support
        sh, exec: remove redundant set_fs(USER_DS)
        drivers: sh: resume enabled clocks fix
        dmaengine: shdma: SH_DMAC_MAX_CHANNELS message fix
        sh: Fix up xchg/cmpxchg corruption with gUSA RB.
        sh: Remove compressed kernel libgcc dependency.
        sh: fix wrong icache/dcache address-array start addr in cache-debugfs.
      f8f44f09
    • Linus Torvalds's avatar
      Merge branch 'rmobile-fixes-for-linus' of... · f49cc57c
      Linus Torvalds authored
      Merge branch 'rmobile-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-3.x
      
      * 'rmobile-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-3.x:
        ARM: mach-shmobile: mackerel: tidyup usbhs driver settings
        ARM: mach-shmobile: Correct SCIF port types for SH7367.
        ARM: mach-shmobile: sh73a0 gic_arch_extn.irq_set_wake() fix
        ARM: mach-shmobile: Mackerel USB platform data update
        ARM: mach-shmobile: AG5EVM SDHI1 platform data update
      f49cc57c
Loading