1. 23 8月, 2016 2 次提交
  2. 11 8月, 2016 3 次提交
    • G
      nvme: Suspend all queues before deletion · c21377f8
      Gabriel Krisman Bertazi 提交于
      When nvme_delete_queue fails in the first pass of the
      nvme_disable_io_queues() loop, we return early, failing to suspend all
      of the IO queues.  Later, on the nvme_pci_disable path, this causes us
      to disable MSI without actually having freed all the IRQs, which
      triggers the BUG_ON in free_msi_irqs(), as show below.
      
      This patch refactors nvme_disable_io_queues to suspend all queues before
      start submitting delete queue commands.  This way, we ensure that we
      have at least returned every IRQ before continuing with the removal
      path.
      
      [  487.529200] kernel BUG at ../drivers/pci/msi.c:368!
      cpu 0x46: Vector: 700 (Program Check) at [c0000078c5b83650]
          pc: c000000000627a50: free_msi_irqs+0x90/0x200
          lr: c000000000627a40: free_msi_irqs+0x80/0x200
          sp: c0000078c5b838d0
         msr: 9000000100029033
        current = 0xc0000078c5b40000
        paca    = 0xc000000002bd7600   softe: 0        irq_happened: 0x01
          pid   = 1376, comm = kworker/70:1H
      kernel BUG at ../drivers/pci/msi.c:368!
      Linux version 4.7.0.mainline+ (root@iod76) (gcc version 5.3.1 20160413
      (Ubuntu/IBM 5.3.1-14ubuntu2.1) ) #104 SMP Fri Jul 29 09:20:17 CDT 2016
      enter ? for help
      [c0000078c5b83920] d0000000363b0cd8 nvme_dev_disable+0x208/0x4f0 [nvme]
      [c0000078c5b83a10] d0000000363b12a4 nvme_timeout+0xe4/0x250 [nvme]
      [c0000078c5b83ad0] c0000000005690e4 blk_mq_rq_timed_out+0x64/0x110
      [c0000078c5b83b40] c00000000056c930 bt_for_each+0x160/0x170
      [c0000078c5b83bb0] c00000000056d928 blk_mq_queue_tag_busy_iter+0x78/0x110
      [c0000078c5b83c00] c0000000005675d8 blk_mq_timeout_work+0xd8/0x1b0
      [c0000078c5b83c50] c0000000000e8cf0 process_one_work+0x1e0/0x590
      [c0000078c5b83ce0] c0000000000e9148 worker_thread+0xa8/0x660
      [c0000078c5b83d80] c0000000000f2090 kthread+0x110/0x130
      [c0000078c5b83e30] c0000000000095f0 ret_from_kernel_thread+0x5c/0x6c
      Signed-off-by: NGabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
      Cc: Brian King <brking@linux.vnet.ibm.com>
      Cc: Keith Busch <keith.busch@intel.com>
      Cc: linux-nvme@lists.infradead.org
      Signed-off-by: NJens Axboe <axboe@fb.com>
      c21377f8
    • A
      efi/capsule: Allocate whole capsule into virtual memory · 6862e6ad
      Austin Christ 提交于
      According to UEFI 2.6 section 7.5.3, the capsule should be in contiguous
      virtual memory and firmware may consume the capsule immediately. To
      correctly implement this functionality, the kernel driver needs to vmap
      the entire capsule at the time it is made available to firmware.
      
      The virtual allocation of the capsule update has been changed from kmap,
      which was only allocating the first page of the update, to vmap, and
      allocates the entire data payload.
      Signed-off-by: NAustin Christ <austinwc@codeaurora.org>
      Signed-off-by: NMatt Fleming <matt@codeblueprint.co.uk>
      Reviewed-by: NMatt Fleming <matt@codeblueprint.co.uk>
      Reviewed-by: NLee, Chun-Yi <jlee@suse.com>
      Cc: <stable@vger.kernel.org> # v4.7
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Bryan O'Donoghue <pure.logic@nexus-software.ie>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Kweh Hock Leong <hock.leong.kweh@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-efi@vger.kernel.org
      Link: http://lkml.kernel.org/r/1470912120-22831-3-git-send-email-matt@codeblueprint.co.ukSigned-off-by: NIngo Molnar <mingo@kernel.org>
      6862e6ad
    • D
      rapidio: dereferencing an error pointer · 73984137
      Dan Carpenter 提交于
      Original patch: https://lkml.org/lkml/2016/8/4/32
      
      If riocm_ch_alloc() fails then we end up dereferencing the error
      pointer.
      
      The problem is that we're not unwinding in the reverse order from how we
      allocate things so it gets confusing.  I've changed this around so now
      "ch" is NULL when we are done with it after we call riocm_put_channel().
      That way we can check if it's NULL and avoid calling riocm_put_channel()
      on it twice.
      
      I renamed err_nodev to err_put_new_ch so that it better reflects what
      the goto does.
      
      Then because we had flipping things around, it means we don't neeed to
      initialize the pointers to NULL and we can remove an if statement and
      pull things in an indent level.
      
      Link: http://lkml.kernel.org/r/20160805152406.20713-1-alexandre.bounine@idt.comSigned-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NAlexandre Bounine <alexandre.bounine@idt.com>
      Cc: Matt Porter <mporter@kernel.crashing.org>
      Cc: Andre van Herk <andre.van.herk@prodrive-technologies.com>
      Cc: Barry Wood <barry.wood@idt.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      73984137
  3. 10 8月, 2016 4 次提交
  4. 09 8月, 2016 19 次提交
  5. 08 8月, 2016 10 次提交
    • D
      drm: Paper over locking inversion after registration rework · 5c6c201c
      Daniel Vetter 提交于
      drm_connector_register_all requires a few too many locks because our
      connector_list locking is busted. Add another FIXME+hack to work
      around this. This should address the below lockdep splat:
      
      ======================================================
      [ INFO: possible circular locking dependency detected ]
      4.7.0-rc5+ #524 Tainted: G           O
      -------------------------------------------------------
      kworker/u8:0/6 is trying to acquire lock:
       (&dev->mode_config.mutex){+.+.+.}, at: [<ffffffff815afde0>] drm_modeset_lock_all+0x40/0x120
      
      but task is already holding lock:
       ((fb_notifier_list).rwsem){++++.+}, at: [<ffffffff810ac195>] __blocking_notifier_call_chain+0x35/0x70
      
      which lock already depends on the new lock.
      
      the existing dependency chain (in reverse order) is:
      
      -> #1 ((fb_notifier_list).rwsem){++++.+}:
             [<ffffffff810df611>] lock_acquire+0xb1/0x200
             [<ffffffff819a55b4>] down_write+0x44/0x80
             [<ffffffff810abf91>] blocking_notifier_chain_register+0x21/0xb0
             [<ffffffff814c7448>] fb_register_client+0x18/0x20
             [<ffffffff814c6c86>] backlight_device_register+0x136/0x260
             [<ffffffffa0127eb2>] intel_backlight_device_register+0xa2/0x160 [i915]
             [<ffffffffa00f46be>] intel_connector_register+0xe/0x10 [i915]
             [<ffffffffa0112bfb>] intel_dp_connector_register+0x1b/0x80 [i915]
             [<ffffffff8159dfea>] drm_connector_register+0x4a/0x80
             [<ffffffff8159fe44>] drm_connector_register_all+0x64/0xf0
             [<ffffffff815a2a64>] drm_modeset_register_all+0x174/0x1c0
             [<ffffffff81599b72>] drm_dev_register+0xc2/0xd0
             [<ffffffffa00621d7>] i915_driver_load+0x1547/0x2200 [i915]
             [<ffffffffa006d80f>] i915_pci_probe+0x4f/0x70 [i915]
             [<ffffffff814a2135>] local_pci_probe+0x45/0xa0
             [<ffffffff814a349b>] pci_device_probe+0xdb/0x130
             [<ffffffff815c07e3>] driver_probe_device+0x223/0x440
             [<ffffffff815c0ad5>] __driver_attach+0xd5/0x100
             [<ffffffff815be386>] bus_for_each_dev+0x66/0xa0
             [<ffffffff815c002e>] driver_attach+0x1e/0x20
             [<ffffffff815bf9be>] bus_add_driver+0x1ee/0x280
             [<ffffffff815c1810>] driver_register+0x60/0xe0
             [<ffffffff814a1a10>] __pci_register_driver+0x60/0x70
             [<ffffffffa01a905b>] i915_init+0x5b/0x62 [i915]
             [<ffffffff8100042d>] do_one_initcall+0x3d/0x150
             [<ffffffff811a935b>] do_init_module+0x5f/0x1d9
             [<ffffffff81124416>] load_module+0x20e6/0x27e0
             [<ffffffff81124d63>] SYSC_finit_module+0xc3/0xf0
             [<ffffffff81124dae>] SyS_finit_module+0xe/0x10
             [<ffffffff819a83a9>] entry_SYSCALL_64_fastpath+0x1c/0xac
      
      -> #0 (&dev->mode_config.mutex){+.+.+.}:
             [<ffffffff810df0ac>] __lock_acquire+0x10fc/0x1260
             [<ffffffff810df611>] lock_acquire+0xb1/0x200
             [<ffffffff819a3097>] mutex_lock_nested+0x67/0x3c0
             [<ffffffff815afde0>] drm_modeset_lock_all+0x40/0x120
             [<ffffffff8158f79b>] drm_fb_helper_restore_fbdev_mode_unlocked+0x2b/0x80
             [<ffffffff8158f81d>] drm_fb_helper_set_par+0x2d/0x50
             [<ffffffffa0105f7a>] intel_fbdev_set_par+0x1a/0x60 [i915]
             [<ffffffff814c13c6>] fbcon_init+0x586/0x610
             [<ffffffff8154d16a>] visual_init+0xca/0x130
             [<ffffffff8154e611>] do_bind_con_driver+0x1c1/0x3a0
             [<ffffffff8154eaf6>] do_take_over_console+0x116/0x180
             [<ffffffff814bd3a7>] do_fbcon_takeover+0x57/0xb0
             [<ffffffff814c1e48>] fbcon_event_notify+0x658/0x750
             [<ffffffff810abcae>] notifier_call_chain+0x3e/0xb0
             [<ffffffff810ac1ad>] __blocking_notifier_call_chain+0x4d/0x70
             [<ffffffff810ac1e6>] blocking_notifier_call_chain+0x16/0x20
             [<ffffffff814c748b>] fb_notifier_call_chain+0x1b/0x20
             [<ffffffff814c86b1>] register_framebuffer+0x251/0x330
             [<ffffffff8158fa9f>] drm_fb_helper_initial_config+0x25f/0x3f0
             [<ffffffffa0106b48>] intel_fbdev_initial_config+0x18/0x30 [i915]
             [<ffffffff810adfd8>] async_run_entry_fn+0x48/0x150
             [<ffffffff810a3947>] process_one_work+0x1e7/0x750
             [<ffffffff810a3efb>] worker_thread+0x4b/0x4f0
             [<ffffffff810aad4f>] kthread+0xef/0x110
             [<ffffffff819a85ef>] ret_from_fork+0x1f/0x40
      
      other info that might help us debug this:
      
       Possible unsafe locking scenario:
      
             CPU0                    CPU1
             ----                    ----
        lock((fb_notifier_list).rwsem);
                                     lock(&dev->mode_config.mutex);
                                     lock((fb_notifier_list).rwsem);
        lock(&dev->mode_config.mutex);
      
       *** DEADLOCK ***
      
      6 locks held by kworker/u8:0/6:
       #0:  ("events_unbound"){.+.+.+}, at: [<ffffffff810a38c9>] process_one_work+0x169/0x750
       #1:  ((&entry->work)){+.+.+.}, at: [<ffffffff810a38c9>] process_one_work+0x169/0x750
       #2:  (registration_lock){+.+.+.}, at: [<ffffffff814c8487>] register_framebuffer+0x27/0x330
       #3:  (console_lock){+.+.+.}, at: [<ffffffff814c86ce>] register_framebuffer+0x26e/0x330
       #4:  (&fb_info->lock){+.+.+.}, at: [<ffffffff814c78dd>] lock_fb_info+0x1d/0x40
       #5:  ((fb_notifier_list).rwsem){++++.+}, at: [<ffffffff810ac195>] __blocking_notifier_call_chain+0x35/0x70
      
      stack backtrace:
      CPU: 2 PID: 6 Comm: kworker/u8:0 Tainted: G           O    4.7.0-rc5+ #524
      Hardware name: Intel Corp. Broxton P/NOTEBOOK, BIOS APLKRVPA.X64.0138.B33.1606250842 06/25/2016
      Workqueue: events_unbound async_run_entry_fn
       0000000000000000 ffff8800758577f0 ffffffff814507a5 ffffffff828b9900
       ffffffff828b9900 ffff880075857830 ffffffff810dc6fa ffff880075857880
       ffff88007584d688 0000000000000005 0000000000000006 ffff88007584d6b0
      Call Trace:
       [<ffffffff814507a5>] dump_stack+0x67/0x92
       [<ffffffff810dc6fa>] print_circular_bug+0x1aa/0x200
       [<ffffffff810df0ac>] __lock_acquire+0x10fc/0x1260
       [<ffffffff810df611>] lock_acquire+0xb1/0x200
       [<ffffffff815afde0>] ? drm_modeset_lock_all+0x40/0x120
       [<ffffffff815afde0>] ? drm_modeset_lock_all+0x40/0x120
       [<ffffffff819a3097>] mutex_lock_nested+0x67/0x3c0
       [<ffffffff815afde0>] ? drm_modeset_lock_all+0x40/0x120
       [<ffffffff810fa85f>] ? rcu_read_lock_sched_held+0x7f/0x90
       [<ffffffff81208218>] ? kmem_cache_alloc_trace+0x248/0x2b0
       [<ffffffff815afdc5>] ? drm_modeset_lock_all+0x25/0x120
       [<ffffffff815afde0>] drm_modeset_lock_all+0x40/0x120
       [<ffffffff8158f79b>] drm_fb_helper_restore_fbdev_mode_unlocked+0x2b/0x80
       [<ffffffff8158f81d>] drm_fb_helper_set_par+0x2d/0x50
       [<ffffffffa0105f7a>] intel_fbdev_set_par+0x1a/0x60 [i915]
       [<ffffffff814c13c6>] fbcon_init+0x586/0x610
       [<ffffffff8154d16a>] visual_init+0xca/0x130
       [<ffffffff8154e611>] do_bind_con_driver+0x1c1/0x3a0
       [<ffffffff8154eaf6>] do_take_over_console+0x116/0x180
       [<ffffffff814bd3a7>] do_fbcon_takeover+0x57/0xb0
       [<ffffffff814c1e48>] fbcon_event_notify+0x658/0x750
       [<ffffffff810abcae>] notifier_call_chain+0x3e/0xb0
       [<ffffffff810ac1ad>] __blocking_notifier_call_chain+0x4d/0x70
       [<ffffffff810ac1e6>] blocking_notifier_call_chain+0x16/0x20
       [<ffffffff814c748b>] fb_notifier_call_chain+0x1b/0x20
       [<ffffffff814c86b1>] register_framebuffer+0x251/0x330
       [<ffffffff815b7e8d>] ? vga_switcheroo_client_fb_set+0x5d/0x70
       [<ffffffff8158fa9f>] drm_fb_helper_initial_config+0x25f/0x3f0
       [<ffffffffa0106b48>] intel_fbdev_initial_config+0x18/0x30 [i915]
       [<ffffffff810adfd8>] async_run_entry_fn+0x48/0x150
       [<ffffffff810a3947>] process_one_work+0x1e7/0x750
       [<ffffffff810a38c9>] ? process_one_work+0x169/0x750
       [<ffffffff810a3efb>] worker_thread+0x4b/0x4f0
       [<ffffffff810a3eb0>] ? process_one_work+0x750/0x750
       [<ffffffff810aad4f>] kthread+0xef/0x110
       [<ffffffff819a85ef>] ret_from_fork+0x1f/0x40
       [<ffffffff810aac60>] ? kthread_stop+0x2e0/0x2e0
      
      v2: Rebase onto the right branch (hand-editing patches ftw) and add more
      reporters.
      Reported-by: NImre Deak <imre.deak@intel.com>
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Acked-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reported-by: NJiri Kosina <jikos@kernel.org>
      Cc: Jiri Kosina <jikos@kernel.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      5c6c201c
    • L
      drm: rcar-du: Link HDMI encoder with bridge · 29986cc8
      Laurent Pinchart 提交于
      The conversion of the rcar-du driver from the I2C slave encoder to the
      DRM bridge API left the HDMI encoder's bridge pointer NULL, preventing
      the bridge from being handled automatically by the DRM core. Fix it.
      
      Fixes: 1d926114 ("drm: rcar-du: Remove i2c slave encoder interface for hdmi encoder")
      Signed-off-by: NLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      29986cc8
    • W
      thermal: clock_cooling: Fix missing mutex_init() · 165989a5
      Wei Yongjun 提交于
      The driver allocates the mutex but not initialize it.
      Use mutex_init() on it to initialize it correctly.
      
      This is detected by Coccinelle semantic patch.
      Signed-off-by: NWei Yongjun <weiyj.lk@gmail.com>
      Signed-off-by: NZhang Rui <rui.zhang@intel.com>
      165989a5
    • K
      thermal: hwmon: EXPORT_SYMBOL_GPL for thermal hwmon sysfs · f4c59243
      Kuninori Morimoto 提交于
      thermal_add_hwmon_sysfs()/thermal_remove_hwmon_sysfs() need
      EXPORT_SYMBOL_GPL(). Otherwise we will have ERROR
      
      >> ERROR: "thermal_remove_hwmon_sysfs" [drivers/thermal/rcar_thermal.ko] undefined!
      >> ERROR: "thermal_add_hwmon_sysfs" [drivers/thermal/rcar_thermal.ko] undefined!
      Signed-off-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Signed-off-by: NZhang Rui <rui.zhang@intel.com>
      f4c59243
    • M
      thermal: fix race condition when updating cooling device · d0b7306d
      Michele Di Giorgio 提交于
      When multiple thermal zones are bound to the same cooling device, multiple
      kernel threads may want to update the cooling device state by calling
      thermal_cdev_update(). Having cdev not protected by a mutex can lead to a race
      condition. Consider the following situation with two kernel threads k1 and k2:
      
      	    Thread k1				Thread k2
                                          ||
                                          ||  call thermal_cdev_update()
                                          ||      ...
                                          ||      set_cur_state(cdev, target);
          call power_actor_set_power()    ||
              ...                         ||
              instance->target = state;   ||
              cdev->updated = false;      ||
                                          ||      cdev->updated = true;
                                          ||      // completes execution
          call thermal_cdev_update()      ||
              // cdev->updated == true    ||
              return;                     ||
                                          \/
                                          time
      
      k2 has already looped through the thermal instances looking for the deepest
      cooling device state and is preempted right before setting cdev->updated to
      true. Now, k1 runs, modifies the thermal instance state and sets cdev->updated
      to false. Then, k1 is preempted and k2 continues the execution by setting
      cdev->updated to true, therefore preventing k1 from performing the update.
      Notice that this is not an issue if k2 looks at the instance->target modified by
      k1 "after" it is assigned by k1. In fact, in this case the update will happen
      anyway and k1 can safely return immediately from thermal_cdev_update().
      
      This may lead to a situation where a thermal governor never updates the cooling
      device. For example, this is the case for the step_wise governor: when calling
      the function thermal_zone_trip_update(), the governor may always get a new state
      equal to the old one (which, however, wasn't notified to the cooling device) and
      will therefore skip the update.
      
      CC: Zhang Rui <rui.zhang@intel.com>
      CC: Eduardo Valentin <edubezval@gmail.com>
      CC: Peter Feuerer <peter@piie.net>
      Reported-by: NToby Huang <toby.huang@arm.com>
      Signed-off-by: NMichele Di Giorgio <michele.digiorgio@arm.com>
      Reviewed-by: NJavi Merino <javi.merino@arm.com>
      Signed-off-by: NZhang Rui <rui.zhang@intel.com>
      d0b7306d
    • P
      thermal/powerclamp: Prevent division by zero when counting interval · 70c50ee7
      Petr Mladek 提交于
      I have got a zero division error when disabling the forced
      idle injection from the intel powerclamp. I did
      
        echo 0 >/sys/class/thermal/cooling_device48/cur_state
      
      and got
      
      [  986.072632] divide error: 0000 [#1] PREEMPT SMP
      [  986.078989] Modules linked in:
      [  986.083618] CPU: 17 PID: 24967 Comm: kidle_inject/17 Not tainted 4.7.0-1-default+ #3055
      [  986.093781] Hardware name: Intel Corporation S2600CP/S2600CP, BIOS RMLSDP.86I.R3.27.D685.1305151734 05/15/2013
      [  986.106227] task: ffff880430e1c080 task.stack: ffff880427ef0000
      [  986.114122] RIP: 0010:[<ffffffff81794859>]  [<ffffffff81794859>] clamp_thread+0x1d9/0x600
      [  986.124609] RSP: 0018:ffff880427ef3e20  EFLAGS: 00010246
      [  986.131860] RAX: 0000000000000258 RBX: 0000000000000006 RCX: 0000000000000001
      [  986.141179] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000018
      [  986.150478] RBP: ffff880427ef3ec8 R08: ffff880427ef0000 R09: 0000000000000002
      [  986.159779] R10: 0000000000003df2 R11: 0000000000000018 R12: 0000000000000002
      [  986.169089] R13: 0000000000000000 R14: ffff880427ef0000 R15: ffff880427ef0000
      [  986.178388] FS:  0000000000000000(0000) GS:ffff880435940000(0000) knlGS:0000000000000000
      [  986.188785] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  986.196559] CR2: 00007f1d0caf0000 CR3: 0000000002006000 CR4: 00000000001406e0
      [  986.205909] Stack:
      [  986.209524]  ffff8802be897b00 ffff880430e1c080 0000000000000011 0000006a35959780
      [  986.219236]  0000000000000011 ffff880427ef0008 0000000000000000 ffff8804359503d0
      [  986.228966]  0000000100029d93 ffffffff81794140 0000000000000000 ffffffff05000011
      [  986.238686] Call Trace:
      [  986.242825]  [<ffffffff81794140>] ? pkg_state_counter+0x80/0x80
      [  986.250866]  [<ffffffff81794680>] ? powerclamp_set_cur_state+0x180/0x180
      [  986.259797]  [<ffffffff8111d1a9>] kthread+0xc9/0xe0
      [  986.266682]  [<ffffffff8193d69f>] ret_from_fork+0x1f/0x40
      [  986.274142]  [<ffffffff8111d0e0>] ? kthread_create_on_node+0x180/0x180
      [  986.282869] Code: d1 ea 48 89 d6 80 3d 6a d0 d4 00 00 ba 64 00 00 00 89 d8 41 0f 45 f5 0f af c2 42 8d 14 2e be 31 00 00 00 83 fa 31 0f 42 f2 31 d2 <f7> f6 48 8b 15 9e 07 87 00 48 8b 3d 97 07 87 00 48 63 f0 83 e8
      [  986.307806] RIP  [<ffffffff81794859>] clamp_thread+0x1d9/0x600
      [  986.315871]  RSP <ffff880427ef3e20>
      
      RIP points to the following lines:
      
      	compensation = get_compensation(target_ratio);
      	interval = duration_jiffies*100/(target_ratio+compensation);
      
      A solution would be to switch the following two commands in
      powerclamp_set_cur_state():
      
      	set_target_ratio = 0;
      	end_power_clamp();
      
      But I think that the zero division might happen also when target_ratio
      is non-zero because the compensation might be negative. Therefore
      we also check the sum of target_ratio and compensation explicitly.
      
      Also the compensated_ratio variable is always set. Therefore there
      is no need to initialize it.
      Signed-off-by: NPetr Mladek <pmladek@suse.com>
      Acked-by: NJacob Pan <jacob.jun.pan@linux.intel.com>
      Signed-off-by: NZhang Rui <rui.zhang@intel.com>
      70c50ee7
    • S
      thermal: intel_pch_thermal: Add suspend/resume callback · 176b1ec2
      Srinivas Pandruvada 提交于
      Added suspend/resume callback to disable/enable PCH thermal sensor
      respectively. If the sensor is enabled by the BIOS, then the sensor status
      will not be changed during suspend/resume.
      Signed-off-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: NZhang Rui <rui.zhang@intel.com>
      176b1ec2
    • J
      block: rename bio bi_rw to bi_opf · 1eff9d32
      Jens Axboe 提交于
      Since commit 63a4cc24, bio->bi_rw contains flags in the lower
      portion and the op code in the higher portions. This means that
      old code that relies on manually setting bi_rw is most likely
      going to be broken. Instead of letting that brokeness linger,
      rename the member, to force old and out-of-tree code to break
      at compile time instead of at runtime.
      
      No intended functional changes in this commit.
      Signed-off-by: NJens Axboe <axboe@fb.com>
      1eff9d32
    • J
      target: iblock_execute_sync_cache() should use bio_set_op_attrs() · 31c64f78
      Jens Axboe 提交于
      The original commit missed this function, it needs to mark it a
      write flush.
      
      Cc: Mike Christie <mchristi@redhat.com>
      Fixes: e742fc32 ("target: use bio op accessors")
      Signed-off-by: NJens Axboe <axboe@fb.com>
      31c64f78
    • J
      block/mm: make bdev_ops->rw_page() take a bool for read/write · c11f0c0b
      Jens Axboe 提交于
      Commit abf54548 changed it from an 'rw' flags type to the
      newer ops based interface, but now we're effectively leaking
      some bdev internals to the rest of the kernel. Since we only
      care about whether it's a read or a write at that level, just
      pass in a bool 'is_write' parameter instead.
      
      Then we can also move op_is_write() and friends back under
      CONFIG_BLOCK protection.
      Reviewed-by: NMike Christie <mchristi@redhat.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      c11f0c0b
  6. 06 8月, 2016 2 次提交
    • A
      cpufreq: powernv: Fix crash in gpstate_timer_handler() · 8e859467
      Akshay Adiga 提交于
      Commit 09ca4c9b (cpufreq: powernv: Replacing pstate_id with
      frequency table index) changes calc_global_pstate() to use
      cpufreq_table index instead of pstate_id.
      
      But in gpstate_timer_handler(), pstate_id was being passed instead
      of cpufreq_table index, which caused index_to_pstate() to access
      out of bound indices, leading to this crash.
      
      Adding sanity check for index and pstate, to ensure only valid pstate
      and index values are returned.
      
      Call Trace:
      [c00000078d66b130] [c00000000011d224] __free_irq+0x234/0x360
      (unreliable)
      [c00000078d66b1c0] [c00000000011d44c] free_irq+0x6c/0xa0
      [c00000078d66b1f0] [c00000000006c4f8] opal_event_shutdown+0x88/0xd0
      [c00000078d66b230] [c000000000067a4c] opal_shutdown+0x1c/0x90
      [c00000078d66b260] [c000000000063a00] pnv_shutdown+0x20/0x40
      [c00000078d66b280] [c000000000021538] machine_restart+0x38/0x90
      [c0000000078d66b310] [c000000000965ea0] panic+0x284/0x300
      [c00000078d66b3a0] [c00000000001f508] die+0x388/0x450
      [c00000078d66b430] [c000000000045a50] bad_page_fault+0xd0/0x140
      [c00000078d66b4a0] [c000000000008964] handle_page_fault+0x2c/0x30
         interrupt: 300 at gpstate_timer_handler+0x150/0x260
          LR = gpstate_timer_handler+0x130/0x260
      [c00000078d66b7f0] [c000000000132b58] call_timer_fn+0x58/0x1c0
      [c00000078d66b880] [c000000000132e20] expire_timers+0x130/0x1d0
      [c00000078d66b8f0] [c000000000133068] run_timer_softirq+0x1a8/0x230
      [c00000078d66b980] [c0000000000b535c] __do_softirq+0x18c/0x400
      [c00000078d66ba70] [c0000000000b5828] irq_exit+0xc8/0x100
      [c00000078d66ba90] [c00000000001e214] timer_interrupt+0xa4/0xe0
      [c00000078d66bac0] [c0000000000027d0] decrementer_common+0x150/0x180
         interrupt: 901 at arch_local_irq_restore+0x74/0x90
        0] [c000000000106b34] call_cpuidle+0x44/0x90
      [c00000078d66be50] [c00000000010708c] cpu_startup_entry+0x38c/0x460
      [c00000078d66bf20] [c00000000003d930] start_secondary+0x330/0x380
      [c00000078d66bf90] [c000000000008e6c] start_secondary_prolog+0x10/0x14
      
      Fixes: 09ca4c9b (cpufreq: powernv: Replacing pstate_id with frequency table index)
      Reported-by: NMadhavan Srinivasan <maddy@linux.vnet.ibm.com>
      Signed-off-by: NAkshay Adiga <akshay.adiga@linux.vnet.ibm.com>
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      Tested-by: NAndrew Donnellan <andrew.donnellan@au1.ibm.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      8e859467
    • K
      ramoops: use DT reserved-memory bindings · 529182e2
      Kees Cook 提交于
      Instead of a ramoops-specific node, use a child node of /reserved-memory.
      This requires that of_platform_device_create() be explicitly called
      for the node, though, since "/reserved-memory" does not have its own
      "compatible" property.
      Suggested-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Acked-by: NRob Herring <robh@kernel.org>
      529182e2