1. 24 Oct, 2016 1 commit
    • Rafael J. Wysocki's avatar
      cpufreq: intel_pstate: Always set max P-state in performance mode · 2f1d407a
      Rafael J. Wysocki authored
      The only times at which intel_pstate checks the policy set for
      a given CPU is the initialization of that CPU and updates of its
      policy settings from cpufreq when intel_pstate_set_policy() is
      invoked.
      
      That is insufficient, however, because intel_pstate uses the same
      P-state selection function for all CPUs regardless of the policy
      setting for each of them and the P-state limits are shared between
      them.  Thus if the policy is set to "performance" for a particular
      CPU, it may not behave as expected if the cpufreq settings are
      changed subsequently for another CPU.
      
      That can be easily demonstrated by writing "performance" to
      scaling_governor for all CPUs and then switching it to "powersave"
      for one of them in which case all of the CPUs will behave as though
      their scaling_governor were all "powersave" (even though the policy
      still appears to be "performance" for the remaining CPUs).
      
      Fix this problem by modifying intel_pstate_adjust_busy_pstate() to
      always set the P-state to the maximum allowed by the current limits
      for all CPUs whose policy is set to "performance".
      
      Note that it still is recommended to always change the policy setting
      in the same way for all CPUs even with this fix applied to avoid
      confusion.
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      2f1d407a
  2. 21 Oct, 2016 1 commit
  3. 20 Oct, 2016 1 commit
    • Sergey Senozhatsky's avatar
      cpufreq: fix overflow in cpufreq_table_find_index_dl() · c6fe46a7
      Sergey Senozhatsky authored
      'best' is always less or equals to 'pos', so `best - pos' returns
      a negative value which is then getting casted to `unsigned int'
      and passed to __cpufreq_driver_target()->acpi_cpufreq_target()
      for policy->freq_table selection. This results in
      
       BUG: unable to handle kernel paging request at ffff881019b469f8
       IP: [<ffffffffa00356c1>] acpi_cpufreq_target+0x4f/0x190 [acpi_cpufreq]
       PGD 267f067
       PUD 0
      
       Oops: 0000 [#1] PREEMPT SMP
       CPU: 6 PID: 70 Comm: kworker/6:1 Not tainted 4.9.0-rc1-next-20161017-dbg-dirty
       Workqueue: events dbs_work_handler
       task: ffff88041b808000 task.stack: ffff88041b810000
       RIP: 0010:[<ffffffffa00356c1>]  [<ffffffffa00356c1>] acpi_cpufreq_target+0x4f/0x190 [acpi_cpufreq]
       RSP: 0018:ffff88041b813c60  EFLAGS: 00010282
       RAX: ffff880419b46a00 RBX: ffff88041b848400 RCX: ffff880419b20f80
       RDX: 00000000001dff38 RSI: 00000000ffffffff RDI: ffff88041b848400
       RBP: ffff88041b813cb0 R08: 0000000000000006 R09: 0000000000000040
       R10: ffffffff8207f9e0 R11: ffffffff8173595b R12: 0000000000000000
       R13: ffff88041f1dff38 R14: 0000000000262900 R15: 0000000bfffffff4
       FS:  0000000000000000(0000) GS:ffff88041f000000(0000) knlGS:0000000000000000
       CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
       CR2: ffff881019b469f8 CR3: 000000041a2d3000 CR4: 00000000001406e0
       Stack:
        ffff88041b813cb0 ffffffff813347f9 ffff88041b813ca0 ffffffff81334663
        ffff88041f1d4bc0 ffff88041b848400 0000000000000000 0000000000000000
        0000000000262900 0000000000000000 ffff88041b813d00 ffffffff813355dc
       Call Trace:
        [<ffffffff813347f9>] ? cpufreq_freq_transition_begin+0xf1/0xfc
        [<ffffffff81334663>] ? get_cpu_idle_time+0x97/0xa6
        [<ffffffff813355dc>] __cpufreq_driver_target+0x3b6/0x44e
        [<ffffffff81336ca3>] cs_dbs_timer+0x11a/0x135
        [<ffffffff81336fda>] dbs_work_handler+0x39/0x62
        [<ffffffff81057823>] process_one_work+0x280/0x4a5
        [<ffffffff81058719>] worker_thread+0x24f/0x397
        [<ffffffff810584ca>] ? rescuer_thread+0x30b/0x30b
        [<ffffffff81418380>] ? nl80211_get_key+0x29/0x36a
        [<ffffffff8105d2b7>] kthread+0xfc/0x104
        [<ffffffff8107ceea>] ? put_lock_stats.isra.9+0xe/0x20
        [<ffffffff8105d1bb>] ? kthread_create_on_node+0x3f/0x3f
        [<ffffffff814b2092>] ret_from_fork+0x22/0x30
       Code: 56 4d 6b ff 0c 41 55 41 54 53 48 83 ec 28 48 8b 15 ad 1e 00 00 44 8b 41
       08 48 8b 87 c8 00 00 00 49 89 d5 4e 03 2c c5 80 b2 78 81 <46> 8b 74 38 04 45
       3b 75 00 75 11 31 c0 83 39 00 0f 84 1c 01 00
       RIP  [<ffffffffa00356c1>] acpi_cpufreq_target+0x4f/0x190 [acpi_cpufreq]
        RSP <ffff88041b813c60>
       CR2: ffff881019b469f8
       ---[ end trace 16d9fc7a17897d37 ]---
      
      [ rjw: In some cases this bug may also cause incorrect frequencies to
        be selected by cpufreq governors. ]
      
      Fixes: 899bb664 (cpufreq: skip invalid entries when searching the frequency)
      Link: http://marc.info/?l=linux-kernel&m=147672030714331&w=2Reported-and-tested-by: default avatarSedat Dilek <sedat.dilek@gmail.com>
      Reported-and-tested-by: default avatarJörg Otte <jrg.otte@gmail.com>
      Signed-off-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Cc: 4.8+ <stable@vger.kernel.org> # 4.8+
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      c6fe46a7
  4. 13 Oct, 2016 2 commits
  5. 12 Oct, 2016 3 commits
  6. 09 Oct, 2016 2 commits
    • Rafael J. Wysocki's avatar
      cpufreq: intel_pstate: Clarify comment in get_target_pstate_use_performance() · f00593a4
      Rafael J. Wysocki authored
      Make the comment explaining the meaning of the perf_scaled variable
      in get_target_pstate_use_performance() more straightforward.
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      f00593a4
    • Srinivas Pandruvada's avatar
      cpufreq: intel_pstate: Fix unsafe HWP MSR access · f9f4872d
      Srinivas Pandruvada authored
      This is a requirement that MSR MSR_PM_ENABLE must be set to 0x01 before
      reading MSR_HWP_CAPABILITIES on a given CPU. If cpufreq init() is
      scheduled on a CPU which is not same as policy->cpu or migrates to a
      different CPU before calling msr read for MSR_HWP_CAPABILITIES, it
      is possible that MSR_PM_ENABLE was not to set to 0x01 on that CPU.
      This will cause GP fault. So like other places in this path
      rdmsrl_on_cpu should be used instead of rdmsrl.
      
      Moreover the scope of MSR_HWP_CAPABILITIES is on per thread basis, so it
      should be read from the same CPU, for which MSR MSR_HWP_REQUEST is
      getting set.
      
      dmesg dump or warning:
      
      [   22.014488] WARNING: CPU: 139 PID: 1 at arch/x86/mm/extable.c:50 ex_handler_rdmsr_unsafe+0x68/0x70
      [   22.014492] unchecked MSR access error: RDMSR from 0x771
      [   22.014493] Modules linked in:
      [   22.014507] CPU: 139 PID: 1 Comm: swapper/0 Not tainted 4.7.5+ #1
      ...
      ...
      [   22.014516] Call Trace:
      [   22.014542]  [<ffffffff813d7dd1>] dump_stack+0x63/0x82
      [   22.014558]  [<ffffffff8107bc8b>] __warn+0xcb/0xf0
      [   22.014561]  [<ffffffff8107bcff>] warn_slowpath_fmt+0x4f/0x60
      [   22.014563]  [<ffffffff810676f8>] ex_handler_rdmsr_unsafe+0x68/0x70
      [   22.014564]  [<ffffffff810677d9>] fixup_exception+0x39/0x50
      [   22.014604]  [<ffffffff8102e400>] do_general_protection+0x80/0x150
      [   22.014610]  [<ffffffff817f9ec8>] general_protection+0x28/0x30
      [   22.014635]  [<ffffffff81687940>] ? get_target_pstate_use_performance+0xb0/0xb0
      [   22.014642]  [<ffffffff810600c7>] ? native_read_msr+0x7/0x40
      [   22.014657]  [<ffffffff81688123>] intel_pstate_hwp_set+0x23/0x130
      [   22.014660]  [<ffffffff81688406>] intel_pstate_set_policy+0x1b6/0x340
      [   22.014662]  [<ffffffff816829bb>] cpufreq_set_policy+0xeb/0x2c0
      [   22.014664]  [<ffffffff81682f39>] cpufreq_init_policy+0x79/0xe0
      [   22.014666]  [<ffffffff81682cb0>] ? cpufreq_update_policy+0x120/0x120
      [   22.014669]  [<ffffffff816833a6>] cpufreq_online+0x406/0x820
      [   22.014671]  [<ffffffff8168381f>] cpufreq_add_dev+0x5f/0x90
      [   22.014717]  [<ffffffff81530ac8>] subsys_interface_register+0xb8/0x100
      [   22.014719]  [<ffffffff816821bc>] cpufreq_register_driver+0x14c/0x210
      [   22.014749]  [<ffffffff81fe1d90>] intel_pstate_init+0x39d/0x4d5
      [   22.014751]  [<ffffffff81fe13f2>] ? cpufreq_gov_dbs_init+0x12/0x12
      
      Cc: 4.3+ <stable@vger.kernel.org> # 4.3+
      Signed-off-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      f9f4872d
  7. 01 Oct, 2016 1 commit
  8. 26 Sep, 2016 2 commits
  9. 16 Sep, 2016 3 commits
  10. 14 Sep, 2016 1 commit
  11. 13 Sep, 2016 11 commits
  12. 12 Sep, 2016 1 commit
  13. 08 Sep, 2016 1 commit
  14. 04 Sep, 2016 4 commits
  15. 03 Sep, 2016 6 commits
    • Linus Torvalds's avatar
      Merge branch 'for-linus-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs · 4b30b6d1
      Linus Torvalds authored
      Pull btrfs fixes from Chris Mason:
       "I'm still prepping a set of fixes for btrfs fsync, just nailing down a
        hard to trigger memory corruption.  For now, these are tested and ready."
      
      * 'for-linus-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
        btrfs: fix one bug that process may endlessly wait for ticket in wait_reserve_ticket()
        Btrfs: fix endless loop in balancing block groups
        Btrfs: kill invalid ASSERT() in process_all_refs()
      4b30b6d1
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · 2bece1a0
      Linus Torvalds authored
      Pull arm64 fixes from Catalin Marinas:
       "arm64 and arm/perf fixes:
      
         - arm64 fix: debug exception unmasking on the CPU resume path
      
         - ARM PMU fixes: memory leak on error path and NULL pointer
           dereference"
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64: kernel: Fix unmasked debug exceptions when restoring mdscr_el1
        drivers/perf: arm_pmu: Fix NULL pointer dereference during probe
        drivers/perf: arm_pmu: Fix leak in error path
      2bece1a0
    • Linus Torvalds's avatar
      Merge tag 'char-misc-4.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · 593ee4ed
      Linus Torvalds authored
      Pull char/misc driver fixes from Greg KH:
       "Here are a number of small driver fixes for 4.8-rc5.
      
        The largest thing here is deleting an obsolete driver,
        drivers/misc/bh1780gli.c, as the functionality of it was replaced by
        an iio driver a while ago.
      
        The other fixes are things that have been reported, or reverts of
        broken stuff (the binder change).  All of these changes have been in
        linux-next for a while with no reported issues"
      
      * tag 'char-misc-4.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        thunderbolt: Don't declare Falcon Ridge unsupported
        thunderbolt: Add support for INTEL_FALCON_RIDGE_2C controller.
        thunderbolt: Fix resume quirk for Falcon Ridge 4C.
        lkdtm: Mark lkdtm_rodata_do_nothing() notrace
        mei: me: disable driver on SPT SPS firmware
        Revert "android: binder: fix dangling pointer comparison"
        drivers/iio/light/Kconfig: SENSORS_BH1780 cleanup
        android: binder: fix dangling pointer comparison
        misc: delete bh1780 driver
      593ee4ed
    • Linus Torvalds's avatar
      Merge tag 'driver-core-4.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core · 41488202
      Linus Torvalds authored
      Pull driver core fixes from Greg KH:
       "Here are three small fixes for 4.8-rc5.
      
        One for sysfs, one for kernfs, and one documentation fix, all for
        reported issues.  All of these have been in linux-next for a while"
      
      * tag 'driver-core-4.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
        sysfs: correctly handle read offset on PREALLOC attrs
        documentation: drivers/core/of: fix name of of_node symlink
        kernfs: don't depend on d_find_any_alias() when generating notifications
      41488202
    • Linus Torvalds's avatar
      Merge tag 'staging-4.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · 018c81b8
      Linus Torvalds authored
      Pull staging/IIO driver fixes from Greg KH:
       "Here are a number of small fixes for staging and IIO drivers that
        resolve reported problems.
      
        Full details are in the shortlog.  All of these have been in
        linux-next with no reported issues"
      
      * tag 'staging-4.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (35 commits)
        arm: dts: rockchip: add reset node for the exist saradc SoCs
        arm64: dts: rockchip: add reset saradc node for rk3368 SoCs
        iio: adc: rockchip_saradc: reset saradc controller before programming it
        iio: accel: kxsd9: Fix raw read return
        iio: adc: ti_am335x_adc: Increase timeout value waiting for ADC sample
        iio: adc: ti_am335x_adc: Protect FIFO1 from concurrent access
        include/linux: fix excess fence.h kernel-doc notation
        staging: wilc1000: correctly check if associatedsta has not been found
        staging: wilc1000: NULL dereference on error
        staging: wilc1000: txq_event: Fix coding error
        MAINTAINERS: Add file patterns for ion device tree bindings
        MAINTAINERS: Update maintainer entry for wilc1000
        iio: chemical: atlas-ph-sensor: fix typo in val assignment
        iio: fix sched WARNING "do not call blocking ops when !TASK_RUNNING"
        staging: comedi: ni_mio_common: fix AO inttrig backwards compatibility
        staging: comedi: dt2811: fix a precedence bug
        staging: comedi: adv_pci1760: Do not return EINVAL for CMDF_ROUND_DOWN.
        staging: comedi: ni_mio_common: fix wrong insn_write handler
        staging: comedi: comedi_test: fix timer race conditions
        staging: comedi: daqboard2000: bug fix board type matching code
        ...
      018c81b8
    • Linus Torvalds's avatar
      Merge tag 'tty-4.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · 39da979c
      Linus Torvalds authored
      Pull serial driver fixes from Greg KH:
       "Here are some small serial driver fixes for 4.8-rc5.  One fixes an
        oft-reported build issue with the fintek driver, another reverts a
        patch that was causing problems, one fixes a crash, and some new
        device ids were added.
      
        All of these have been in linux-next for a while"
      
      * tag 'tty-4.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
        serial: 8250: added acces i/o products quad and octal serial cards
        serial: 8250_mid: fix divide error bug if baud rate is 0
        Revert "tty/serial/8250: use mctrl_gpio helpers"
        8250/fintek: rename IRQ_MODE macro
      39da979c