1. 23 3月, 2017 2 次提交
  2. 20 3月, 2017 1 次提交
  3. 18 3月, 2017 2 次提交
  4. 17 3月, 2017 2 次提交
  5. 15 3月, 2017 2 次提交
    • A
      drm/i915/guc: Simplify intel_guc_init_hw() · 6cd5a72c
      Arkadiusz Hiler 提交于
      Current version of intel_guc_init_hw() does a lot:
       - cares about submission
       - loads huc
       - implement WA
      
      This change offloads some of the logic to intel_uc_init_hw(), which now
      cares about the above.
      
      v2: rename guc_hw_reset and fix typo in define name (M. Wajdeczko)
      v3: rename once again
      v4: remove spurious comments and add some style (J. Lahtinen)
      v5: flow changes, got rid of dead checks (M. Wajdeczko)
      v6: rebase
      v7: rebase & onion teardown (J. Lahtinen)
      
      Cc: Anusha Srivatsa <anusha.srivatsa@intel.com>
      Cc: Michal Winiarski <michal.winiarski@intel.com>
      Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
      Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Signed-off-by: NArkadiusz Hiler <arkadiusz.hiler@intel.com>
      Reviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Signed-off-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      6cd5a72c
    • A
      drm/i915/uc: Rename intel_?uc_{setup, load}() to _init_hw() · 882d1db0
      Arkadiusz Hiler 提交于
      GuC historically has two "startup" functions called _init() and _setup()
      
      Then HuC came with it's _init() and _load().
      
      This commit renames intel_guc_setup() and intel_huc_load() to
      *uc_init_hw() as they called from the i915_gem_init_hw().
      
      The aim is to be consistent in that entry points called during
      particular driver init phases (e.g. init_hw) are all suffixed by that
      phase. When reading the leaf functions, it should be clear at what stage
      during the driver load it is called and therefore what operations are
      legal at that point.
      
      Also, since the functions start with intel_guc and intel_huc they take
      appropiate structure.
      
      v2: commit message update (Chris Wilson)
      v3: change taken parameters to be more "semantic" (M. Wajdeczko)
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Michal Winiarski <michal.winiarski@intel.com>
      Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
      Signed-off-by: NArkadiusz Hiler <arkadiusz.hiler@intel.com>
      Reviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Signed-off-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      882d1db0
  6. 13 3月, 2017 1 次提交
  7. 09 3月, 2017 4 次提交
    • C
      drm/i915: Use pagecache write to prepopulate shmemfs from pwrite-ioctl · 4e6fdafa
      Chris Wilson 提交于
      Before we instantiate/pin the backing store for our use, we
      can prepopulate the shmemfs filp efficiently using a write into the
      pagecache. We avoid the penalty of instantiating all the pages, important
      if the user is just writing to a few and never uses the object on the GPU,
      and using a direct write into shmemfs allows it to avoid the cost of
      retrieving a page (mostly the clear-before-use, but in theory we could
      curtail swapin) before it is overwritten.
      
      This can be extended later to provide additional specialisation for
      other backends (other than shmemfs). For now it provides a defense
      against very large write-only allocations from exhausting all of system
      memory.
      
      v2: Smelling fixes.
      
      Fixes: fe115628 ("drm/i915: Implement pwrite without struct-mutex")
      References: https://bugs.freedesktop.org/show_bug.cgi?id=99107Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Matthew Auld <matthew.william.auld@gmail.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Cc: <stable@vger.kernel.org> # v4.10+
      Reviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170307120338.7277-2-chris@chris-wilson.co.uk
      (cherry picked from commit 7c55e2c5)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      4e6fdafa
    • C
      drm/i915: Store a permanent error in obj->mm.pages · 0d9dc306
      Chris Wilson 提交于
      Once the object has been truncated, it is unrecoverable. To facilitate
      detection of this state store the error in obj->mm.pages.
      
      This is required for the next patch which should be applied to v4.10
      (via stable), so we also need to mark this patch for backporting. In
      that regard, let's consider this to be a fix/improvement too.
      
      v2: Avoid dereferencing the ERR_PTR when freeing the object.
      
      Fixes: 1233e2db ("drm/i915: Move object backing storage manipulation to its own locking")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: <stable@vger.kernel.org> # v4.10+
      Link: http://patchwork.freedesktop.org/patch/msgid/20170307132031.32461-1-chris@chris-wilson.co.ukReviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      (cherry picked from commit 4e5462ee)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      0d9dc306
    • C
      drm/i915: Squelch any ktime/jiffie rounding errors for wait-ioctl · 89cf83d4
      Chris Wilson 提交于
      We wait upon jiffies, but report the time elapsed using a
      high-resolution timer. This discrepancy can lead to us timing out the
      wait prior to us reporting the elapsed time as complete.
      
      This restores the squelching lost in commit e95433c7 ("drm/i915:
      Rearrange i915_wait_request() accounting with callers").
      
      Fixes: e95433c7 ("drm/i915: Rearrange i915_wait_request() accounting with callers")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Matthew Auld <matthew.william.auld@gmail.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: <drm-intel-fixes@lists.freedesktop.org> # v4.10-rc1+
      Cc: stable@vger.kernel.org
      Link: http://patchwork.freedesktop.org/patch/msgid/20170216125441.30923-1-chris@chris-wilson.co.ukReviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      (cherry picked from commit c1d2061b)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      89cf83d4
    • C
      drm/i915: Avoiding recursing on ww_mutex inside shrinker · 03d1cac6
      Chris Wilson 提交于
      We have to avoid taking ww_mutex inside the shrinker as we use it as a
      plain mutex type and so need to avoid recursive deadlocks:
      
      [  602.771969] =================================
      [  602.771970] [ INFO: inconsistent lock state ]
      [  602.771973] 4.10.0gpudebug+ #122 Not tainted
      [  602.771974] ---------------------------------
      [  602.771975] inconsistent {RECLAIM_FS-ON-W} -> {IN-RECLAIM_FS-W} usage.
      [  602.771978] kswapd0/40 [HC0[0]:SC0[0]:HE1:SE1] takes:
      [  602.771979]  (reservation_ww_class_mutex){+.+.?.}, at: [<ffffffffa054680a>] i915_gem_object_wait+0x39a/0x410 [i915]
      [  602.772020] {RECLAIM_FS-ON-W} state was registered at:
      [  602.772024]   mark_held_locks+0x76/0x90
      [  602.772026]   lockdep_trace_alloc+0xb8/0xc0
      [  602.772028]   __kmalloc_track_caller+0x5d/0x130
      [  602.772031]   krealloc+0x89/0xb0
      [  602.772033]   reservation_object_reserve_shared+0xaf/0xd0
      [  602.772055]   i915_gem_do_execbuffer.isra.35+0x1413/0x18b0 [i915]
      [  602.772075]   i915_gem_execbuffer2+0x10e/0x1d0 [i915]
      [  602.772078]   drm_ioctl+0x291/0x480
      [  602.772079]   do_vfs_ioctl+0x695/0x6f0
      [  602.772081]   SyS_ioctl+0x3c/0x70
      [  602.772084]   entry_SYSCALL_64_fastpath+0x18/0xad
      [  602.772085] irq event stamp: 5197423
      [  602.772088] hardirqs last  enabled at (5197423): [<ffffffff8116751d>] kfree+0xdd/0x170
      [  602.772091] hardirqs last disabled at (5197422): [<ffffffff811674f9>] kfree+0xb9/0x170
      [  602.772095] softirqs last  enabled at (5190992): [<ffffffff8107bfe1>] __do_softirq+0x221/0x280
      [  602.772097] softirqs last disabled at (5190575): [<ffffffff8107c294>] irq_exit+0x64/0xc0
      [  602.772099]
                     other info that might help us debug this:
      [  602.772100]  Possible unsafe locking scenario:
      
      [  602.772101]        CPU0
      [  602.772101]        ----
      [  602.772102]   lock(reservation_ww_class_mutex);
      [  602.772104]   <Interrupt>
      [  602.772105]     lock(reservation_ww_class_mutex);
      [  602.772107]
                      *** DEADLOCK ***
      
      [  602.772109] 2 locks held by kswapd0/40:
      [  602.772110]  #0:  (shrinker_rwsem){++++..}, at: [<ffffffff811337b5>] shrink_slab.constprop.62+0x35/0x280
      [  602.772116]  #1:  (&dev->struct_mutex){+.+.+.}, at: [<ffffffffa0553957>] i915_gem_shrinker_lock+0x27/0x60 [i915]
      [  602.772141]
                     stack backtrace:
      [  602.772144] CPU: 2 PID: 40 Comm: kswapd0 Not tainted 4.10.0gpudebug+ #122
      [  602.772145] Hardware name: LENOVO 42433ZG/42433ZG, BIOS 8AET64WW (1.44 ) 07/26/2013
      [  602.772147] Call Trace:
      [  602.772151]  dump_stack+0x68/0xa1
      [  602.772153]  print_usage_bug+0x1d4/0x1f0
      [  602.772155]  mark_lock+0x390/0x530
      [  602.772157]  ? print_irq_inversion_bug+0x200/0x200
      [  602.772159]  __lock_acquire+0x405/0x1260
      [  602.772181]  ? i915_gem_object_wait+0x39a/0x410 [i915]
      [  602.772183]  lock_acquire+0x60/0x80
      [  602.772205]  ? i915_gem_object_wait+0x39a/0x410 [i915]
      [  602.772207]  mutex_lock_nested+0x69/0x760
      [  602.772229]  ? i915_gem_object_wait+0x39a/0x410 [i915]
      [  602.772231]  ? kfree+0xdd/0x170
      [  602.772253]  ? i915_gem_object_wait+0x163/0x410 [i915]
      [  602.772255]  ? trace_hardirqs_on_caller+0x18d/0x1c0
      [  602.772256]  ? trace_hardirqs_on+0xd/0x10
      [  602.772278]  i915_gem_object_wait+0x39a/0x410 [i915]
      [  602.772300]  i915_gem_object_unbind+0x5e/0x130 [i915]
      [  602.772323]  i915_gem_shrink+0x22d/0x3d0 [i915]
      [  602.772347]  i915_gem_shrinker_scan+0x3f/0x80 [i915]
      [  602.772349]  shrink_slab.constprop.62+0x1ad/0x280
      [  602.772352]  shrink_node+0x52/0x80
      [  602.772355]  kswapd+0x427/0x5c0
      [  602.772358]  kthread+0x122/0x130
      [  602.772360]  ? try_to_free_pages+0x270/0x270
      [  602.772362]  ? kthread_stop+0x70/0x70
      [  602.772365]  ret_from_fork+0x2e/0x40
      
      v2: Add commentary about the pruning being opportunistic
      Reported-by: NJan Nordholz <jckn@gmx.net>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99977#c10
      Fixes: e54ca977 ("drm/i915: Remove completed fences after a wait")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Matthew Auld <matthew.auld@intel.com>
      Reviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170308132629.7987-1-chris@chris-wilson.co.uk
      03d1cac6
  8. 08 3月, 2017 2 次提交
  9. 03 3月, 2017 2 次提交
  10. 02 3月, 2017 1 次提交
    • C
      drm/i915: Hold rpm during GEM suspend in driver unload/suspend · c998e8a0
      Chris Wilson 提交于
      i915_gem_suspend() tries to access the device to ensure it is idle and
      all writes from the device are flushed to memory. It assumed is already
      held the runtime pm wakeref, but we should explicitly acquire it for our
      access to be safe.
      
      [  619.926287] WARNING: CPU: 3 PID: 9353 at drivers/gpu/drm/i915/intel_drv.h:1750 gen6_write32+0x23e/0x2a0 [i915]
      [  619.926300] RPM wakelock ref not held during HW access
      [  619.926311] Modules linked in: vgem x86_pkg_temp_thermal intel_powerclamp snd_hda_codec_hdmi snd_hda_codec_generic snd_hda_codec coretemp snd_hwdep crct10dif_pclmul snd_hda_core crc32_pclmul snd_pcm mei_me mei lpc_ich ghash_clmulni_intel i915(-) sdhci_pci sdhci mmc_core e1000e ptp pps_core prime_numbers [last unloaded: snd_hda_intel]
      [  619.926578] CPU: 3 PID: 9353 Comm: drv_module_relo Tainted: G     U          4.10.0-CI-Trybot_609+ #1
      [  619.926585] Hardware name: LENOVO 42962WU/42962WU, BIOS 8DET56WW (1.26 ) 12/01/2011
      [  619.926592] Call Trace:
      [  619.926609]  dump_stack+0x67/0x92
      [  619.926625]  __warn+0xc6/0xe0
      [  619.926640]  warn_slowpath_fmt+0x4a/0x50
      [  619.926726]  gen6_write32+0x23e/0x2a0 [i915]
      [  619.926801]  gen6_mm_switch+0x38/0x70 [i915]
      [  619.926871]  i915_switch_context+0xec/0xa10 [i915]
      [  619.926942]  i915_gem_switch_to_kernel_context+0x13c/0x2b0 [i915]
      [  619.927019]  i915_gem_suspend+0x2b/0x180 [i915]
      [  619.927079]  i915_driver_unload+0x22/0x200 [i915]
      [  619.927093]  ? __this_cpu_preempt_check+0x13/0x20
      [  619.927105]  ? trace_hardirqs_on_caller+0xe7/0x200
      [  619.927118]  ? trace_hardirqs_on+0xd/0x10
      [  619.927128]  ? _raw_spin_unlock_irqrestore+0x3d/0x60
      [  619.927192]  i915_pci_remove+0x14/0x20 [i915]
      [  619.927205]  pci_device_remove+0x34/0xb0
      [  619.927219]  device_release_driver_internal+0x158/0x210
      [  619.927234]  driver_detach+0x3b/0x80
      [  619.927245]  bus_remove_driver+0x53/0xd0
      [  619.927256]  driver_unregister+0x27/0x50
      [  619.927267]  pci_unregister_driver+0x25/0xa0
      [  619.927351]  i915_exit+0x1a/0xb1a [i915]
      [  619.927362]  SyS_delete_module+0x193/0x1e0
      [  619.927378]  entry_SYSCALL_64_fastpath+0x1c/0xb1
      [  619.927386] RIP: 0033:0x7f82b46c5d37
      [  619.927393] RSP: 002b:00007ffdb6f610d8 EFLAGS: 00000246 ORIG_RAX: 00000000000000b0
      [  619.927408] RAX: ffffffffffffffda RBX: ffffffff81481ff3 RCX: 00007f82b46c5d37
      [  619.927415] RDX: 0000000000000001 RSI: 0000000000000800 RDI: 000000000224f558
      [  619.927422] RBP: ffffc90001187f88 R08: 0000000000000000 R09: 00007ffdb6f61100
      [  619.927428] R10: 000000000224f4e0 R11: 0000000000000246 R12: 0000000000000000
      [  619.927435] R13: 00007ffdb6f612b0 R14: 0000000000000000 R15: 0000000000000000
      [  619.927451]  ? __this_cpu_preempt_check+0x13/0x20
      
      or
      
      [  641.646590] WARNING: CPU: 1 PID: 8913 at drivers/gpu/drm/i915/intel_drv.h:1750 intel_runtime_pm_get_noresume+0x8b/0x90 [i915]
      [  641.646595] RPM wakelock ref not held during HW access
      [  641.646600] Modules linked in: vgem snd_hda_codec_hdmi snd_hda_codec_generic x86_pkg_temp_thermal intel_powerclamp coretemp snd_hda_codec snd_hwdep crct10dif_pclmul snd_hda_core crc32_pclmul ghash_clmulni_intel snd_pcm mei_me mei i915(-) r8169 mii prime_numbers i2c_hid [last unloaded: snd_hda_intel]
      [  641.646825] CPU: 1 PID: 8913 Comm: drv_module_relo Tainted: G     U          4.10.0-CI-Trybot_609+ #1
      [  641.646836] Hardware name: TOSHIBA SATELLITE P50-C/06F4                            , BIOS 1.20 10/08/2015
      [  641.646843] Call Trace:
      [  641.646857]  dump_stack+0x67/0x92
      [  641.646869]  __warn+0xc6/0xe0
      [  641.646880]  warn_slowpath_fmt+0x4a/0x50
      [  641.646893]  ? __this_cpu_preempt_check+0x13/0x20
      [  641.646904]  ? trace_hardirqs_on_caller+0xe7/0x200
      [  641.646957]  intel_runtime_pm_get_noresume+0x8b/0x90 [i915]
      [  641.647022]  __i915_add_request+0x423/0x540 [i915]
      [  641.647080]  i915_gem_switch_to_kernel_context+0x148/0x2b0 [i915]
      [  641.647145]  i915_gem_suspend+0x2b/0x180 [i915]
      [  641.647189]  i915_driver_unload+0x22/0x200 [i915]
      [  641.647200]  ? __this_cpu_preempt_check+0x13/0x20
      [  641.647210]  ? trace_hardirqs_on_caller+0xe7/0x200
      [  641.647220]  ? trace_hardirqs_on+0xd/0x10
      [  641.647231]  ? _raw_spin_unlock_irqrestore+0x3d/0x60
      [  641.647276]  i915_pci_remove+0x14/0x20 [i915]
      [  641.647293]  pci_device_remove+0x34/0xb0
      [  641.647307]  device_release_driver_internal+0x158/0x210
      [  641.647321]  driver_detach+0x3b/0x80
      [  641.647330]  bus_remove_driver+0x53/0xd0
      [  641.647338]  driver_unregister+0x27/0x50
      [  641.647348]  pci_unregister_driver+0x25/0xa0
      [  641.647415]  i915_exit+0x1a/0xb1a [i915]
      [  641.647429]  SyS_delete_module+0x193/0x1e0
      [  641.647444]  entry_SYSCALL_64_fastpath+0x1c/0xb1
      [  641.647453] RIP: 0033:0x7fc622bd2d37
      [  641.647463] RSP: 002b:00007ffff8ffb5c8 EFLAGS: 00000246 ORIG_RAX: 00000000000000b0
      [  641.647475] RAX: ffffffffffffffda RBX: ffffffff81481ff3 RCX: 00007fc622bd2d37
      [  641.647480] RDX: 0000000000000001 RSI: 0000000000000800 RDI: 0000000000d49118
      [  641.647485] RBP: ffffc90000997f88 R08: 0000000000000000 R09: 00007ffff8ffb5f0
      [  641.647491] R10: 0000000000d490a0 R11: 0000000000000246 R12: 0000000000000000
      [  641.647498] R13: 00007ffff8ffb7a0 R14: 0000000000000000 R15: 0000000000000000
      [  641.647510]  ? __this_cpu_preempt_check+0x13/0x20
      
      v2: Keep holding rpm until the end to cover i915_gem_sanitize() as well.
      
      Fixes: 5ab57c70 ("drm/i915: Flush logical context image out to memory upon suspend")
      Fixes: 1c777c5d ("drm/i915/hsw: Fix GPU hang during resume from S3-devices state")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170302083029.19576-1-chris@chris-wilson.co.ukReviewed-by: NImre Deak <imre.deak@intel.com>
      Cc: <stable@vger.kernel.org> # v4.9+
      c998e8a0
  11. 28 2月, 2017 1 次提交
    • C
      drm/i915: Delay disabling the user interrupt for breadcrumbs · 67b807a8
      Chris Wilson 提交于
      A significant cost in setting up a wait is the overhead of enabling the
      interrupt. As we disable the interrupt whenever the queue of waiters is
      empty, if we are frequently waiting on alternating batches, we end up
      re-enabling the interrupt on a frequent basis. We do want to disable the
      interrupt during normal operations as under high load it may add several
      thousand interrupts/s - we have been known in the past to occupy whole
      cores with our interrupt handler after accidentally leaving user
      interrupts enabled. As a compromise, leave the interrupt enabled until
      the next IRQ, or the system is idle. This gives a small window for a
      waiter to keep the interrupt active and not be delayed by having to
      re-enable the interrupt.
      
      v2: Restore hangcheck/missed-irq detection for continuations
      v3: Be more careful restoring the hangcheck timer after reset
      v4: Be more careful restoring the fake irq after reset (if required!)
      v5: Redo changes to intel_engine_wakeup()
      v6: Factor out __intel_engine_wakeup()
      v7: Improve commentary for declaring a missed wakeup
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170227205850.2828-4-chris@chris-wilson.co.uk
      67b807a8
  12. 25 2月, 2017 2 次提交
  13. 23 2月, 2017 1 次提交
  14. 22 2月, 2017 6 次提交
  15. 17 2月, 2017 3 次提交
  16. 16 2月, 2017 2 次提交
  17. 14 2月, 2017 6 次提交