1. 22 Sep, 2014 2 commits
    • Prarit Bhargava's avatar
      cpufreq: release policy->rwsem on error · 7106e02b
      Prarit Bhargava authored
      While debugging a cpufreq-related hardware failure on a system I saw the
      following lockdep warning:
      
       =========================
       [ BUG: held lock freed! ] 3.17.0-rc4+ #1 Tainted: G            E
       -------------------------
       insmod/2247 is freeing memory ffff88006e1b1400-ffff88006e1b17ff, with a lock still held there!
        (&policy->rwsem){+.+...}, at: [<ffffffff8156d37d>] __cpufreq_add_dev.isra.21+0x47d/0xb80
       3 locks held by insmod/2247:
        #0:  (subsys mutex#5){+.+.+.}, at: [<ffffffff81485579>] subsys_interface_register+0x69/0x120
        #1:  (cpufreq_rwsem){.+.+.+}, at: [<ffffffff8156cf73>] __cpufreq_add_dev.isra.21+0x73/0xb80
        #2:  (&policy->rwsem){+.+...}, at: [<ffffffff8156d37d>] __cpufreq_add_dev.isra.21+0x47d/0xb80
      
       stack backtrace:
       CPU: 0 PID: 2247 Comm: insmod Tainted: G            E  3.17.0-rc4+ #1
       Hardware name: HP ProLiant MicroServer Gen8, BIOS J06 08/24/2013
        0000000000000000 000000008f3063c4 ffff88006f87bb30 ffffffff8171b358
        ffff88006bcf3750 ffff88006f87bb68 ffffffff810e09e1 ffff88006e1b1400
        ffffea0001b86c00 ffffffff8156d327 ffff880073003500 0000000000000246
       Call Trace:
        [<ffffffff8171b358>] dump_stack+0x4d/0x66
        [<ffffffff810e09e1>] debug_check_no_locks_freed+0x171/0x180
        [<ffffffff8156d327>] ? __cpufreq_add_dev.isra.21+0x427/0xb80
        [<ffffffff8121412b>] kfree+0xab/0x2b0
        [<ffffffff8156d327>] __cpufreq_add_dev.isra.21+0x427/0xb80
        [<ffffffff81724cf7>] ? _raw_spin_unlock+0x27/0x40
        [<ffffffffa003517f>] ? pcc_cpufreq_do_osc+0x17f/0x17f [pcc_cpufreq]
        [<ffffffff8156da8e>] cpufreq_add_dev+0xe/0x10
        [<ffffffff814855d1>] subsys_interface_register+0xc1/0x120
        [<ffffffff8156bcf2>] cpufreq_register_driver+0x112/0x340
        [<ffffffff8121415a>] ? kfree+0xda/0x2b0
        [<ffffffffa003517f>] ? pcc_cpufreq_do_osc+0x17f/0x17f [pcc_cpufreq]
        [<ffffffffa003562e>] pcc_cpufreq_init+0x4af/0xe81 [pcc_cpufreq]
        [<ffffffffa003517f>] ? pcc_cpufreq_do_osc+0x17f/0x17f [pcc_cpufreq]
        [<ffffffff81002144>] do_one_initcall+0xd4/0x210
        [<ffffffff811f7472>] ? __vunmap+0xd2/0x120
        [<ffffffff81127155>] load_module+0x1315/0x1b70
        [<ffffffff811222a0>] ? store_uevent+0x70/0x70
        [<ffffffff811229d9>] ? copy_module_from_fd.isra.44+0x129/0x180
        [<ffffffff81127b86>] SyS_finit_module+0xa6/0xd0
        [<ffffffff81725b69>] system_call_fastpath+0x16/0x1b
       cpufreq: __cpufreq_add_dev: ->get() failed
      insmod: ERROR: could not insert module pcc-cpufreq.ko: No such device
      
      The warning occurs in the __cpufreq_add_dev() code which does
      
              down_write(&policy->rwsem);
      	...
              if (cpufreq_driver->get && !cpufreq_driver->setpolicy) {
                      policy->cur = cpufreq_driver->get(policy->cpu);
                      if (!policy->cur) {
                              pr_err("%s: ->get() failed\n", __func__);
                              goto err_get_freq;
                      }
      
      If cpufreq_driver->get(policy->cpu) returns an error we execute the
      code at err_get_freq, which does not up the policy->rwsem.  This causes
      the lockdep warning.
      
      Trivial patch to up the policy->rwsem in the error path.
      
      After the patch has been applied, and an error occurs in the
      cpufreq_driver->get(policy->cpu) call we will now see
      
      cpufreq: __cpufreq_add_dev: ->get() failed
      cpufreq: __cpufreq_add_dev: ->get() failed
      modprobe: ERROR: could not insert 'pcc_cpufreq': No such device
      
      Fixes: 4e97b631 (cpufreq: Initialize governor for a new policy under policy->rwsem)
      Signed-off-by: default avatarPrarit Bhargava <prarit@redhat.com>
      Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Cc: 3.14+ <stable@vger.kernel.org> # 3.14+
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      7106e02b
    • Lan Tianyu's avatar
      cpufreq: fix cpufreq suspend/resume for intel_pstate · 8e30444e
      Lan Tianyu authored
      Cpufreq core introduces cpufreq_suspended flag to let cpufreq sysfs nodes
      across S2RAM/S2DISK. But the flag is only set in the cpufreq_suspend()
      for cpufreq drivers which have target or target_index callback. This
      skips intel_pstate driver. This patch is to set the flag before checking
      target or target_index callback.
      
      Fixes: 2f0aea93 (cpufreq: suspend governors on system suspend/hibernate)
      Signed-off-by: default avatarLan Tianyu <tianyu.lan@intel.com>
      Cc: 3.15+ <stable@vger.kernel.org> # 3.15+
      [rjw: Subject]
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      8e30444e
  2. 21 Sep, 2014 3 commits
    • Linus Torvalds's avatar
      Linux 3.17-rc6 · 0f33be00
      Linus Torvalds authored
      0f33be00
    • Linus Torvalds's avatar
      Merge branch 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm · dae0af78
      Linus Torvalds authored
      Pull ARM fixes from Russell King:
       "Fixes for ARM, the most notable being the fix from Nathan Lynch to fix
        the state of various registers during execve, to ensure that data
        can't be leaked between two executables.
      
        Fixes from Victor Kamensky for get_user() on big endian platforms,
        since the addition of 8-byte get_user() support broke these fairly
        badly.
      
        A fix from Sudeep Holla for affinity setting when hotplugging CPU 0.
      
        A fix from Stephen Boyd for a perf-induced sleep attempt while atomic.
      
        Lastly, a correctness fix for emulation of the SWP instruction on
        ARMv7+, and a fix for wrong carry handling when updating the
        translation table base address on LPAE platforms"
      
      * 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm:
        ARM: 8149/1: perf: Don't sleep while atomic when enabling per-cpu interrupts
        ARM: 8148/1: flush TLS and thumbee register state during exec
        ARM: 8151/1: add missing exports for asm functions required by get_user macro
        ARM: 8137/1: fix get_user BE behavior for target variable with size of 8 bytes
        ARM: 8135/1: Fix in-correct barrier usage in SWP{B} emulation
        ARM: 8133/1: use irq_set_affinity with force=false when migrating irqs
        ARM: 8132/1: LPAE: drop wrong carry flag correction after adding TTBR1_OFFSET
      dae0af78
    • Linus Torvalds's avatar
      Merge tag 'media-v3.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media · c1f03b48
      Linus Torvalds authored
      Pull media fixes from Mauro Carvalho Chehab:
       "some media bug fixes:
         - a Kconfig dependency issue
         - some fixes for af9033/it913x demod to be more reliable and address
           a performance regression
         - cx18: fix an oops on devices with tda8290 tuner
         - two new USB IDs for af9035
         - a couple fixes on smapp driver"
      
      * tag 'media-v3.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
        [media] af9035: new IDs: add support for PCTV 78e and PCTV 79e
        [media] af9033: feed clock to RF tuner
        [media] it913x: init tuner on attach
        [media] af9033: update IT9135 tuner inittabs
        [media] Kconfig: do not select SPI bus on sub-driver auto-select
        [media] cx18: fix kernel oops with tda8290 tuner
        [media] smiapp: Set sub-device owner
        [media] smiapp: Fix power count handling
      c1f03b48
  3. 20 Sep, 2014 8 commits
  4. 19 Sep, 2014 21 commits
  5. 18 Sep, 2014 6 commits