1. 25 4月, 2020 3 次提交
  2. 24 4月, 2020 3 次提交
  3. 23 4月, 2020 3 次提交
    • C
      drm/i915/gt: Check carefully for an idle engine in wait-for-idle · b97f77ba
      Chris Wilson 提交于
      intel_gt_wait_for_idle() tries to wait until all the outstanding requests
      are retired and the GPU is idle. As a side effect of retiring requests,
      we may submit more work to flush any pm barriers, and so the
      wait-for-idle tries to flush the background pm work and catch the new
      requests. However, if the work completed in the background before we
      were able to flush, it would queue the extra barrier request without us
      noticing -- and so we would return from wait-for-idle with one request
      remaining. (This breaks e.g. record_default_state where we need to wait
      until that barrier is retired, and it may slow suspend down by causing
      us to wait on the background retirement worker as opposed to immediately
      retiring the barrier.)
      
      However, since we track if there has been a submission since the engine
      pm barrier, we can very quickly detect if the idle barrier is still
      outstanding.
      
      Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/1763Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Matthew Auld <matthew.auld@intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200423085940.28168-1-chris@chris-wilson.co.uk
      b97f77ba
    • C
      drm/i915/gt: Carefully order virtual_submission_tasklet · 36fe164d
      Chris Wilson 提交于
      During the virtual engine's submission tasklet, we take the request and
      insert into the submission queue on each of our siblings. This seems
      quite simply, and so no problems with ordering. However, the sibling
      execlists' submission tasklets may run concurrently with the virtual
      engine's tasklet, submitting the request to HW before the virtual
      finishes its task of telling all the siblings. If this happens, the
      sibling tasklet may *reorder* the ve->sibling[] array that the virtual
      engine tasklet is processing. This can *only* reorder within the
      elements already processed by the virtual engine, nevertheless the
      race is detected by KCSAN:
      
      [  185.580014] BUG: KCSAN: data-race in execlists_dequeue [i915] / virtual_submission_tasklet [i915]
      [  185.580054]
      [  185.580076] write to 0xffff8881f1919860 of 8 bytes by interrupt on cpu 2:
      [  185.580553]  execlists_dequeue+0x6ad/0x1600 [i915]
      [  185.581044]  __execlists_submission_tasklet+0x48/0x60 [i915]
      [  185.581517]  execlists_submission_tasklet+0xd3/0x170 [i915]
      [  185.581554]  tasklet_action_common.isra.0+0x42/0x90
      [  185.581585]  __do_softirq+0xc8/0x206
      [  185.581613]  run_ksoftirqd+0x15/0x20
      [  185.581641]  smpboot_thread_fn+0x15a/0x270
      [  185.581669]  kthread+0x19a/0x1e0
      [  185.581695]  ret_from_fork+0x1f/0x30
      [  185.581717]
      [  185.581736] read to 0xffff8881f1919860 of 8 bytes by interrupt on cpu 0:
      [  185.582231]  virtual_submission_tasklet+0x10e/0x5c0 [i915]
      [  185.582265]  tasklet_action_common.isra.0+0x42/0x90
      [  185.582291]  __do_softirq+0xc8/0x206
      [  185.582315]  run_ksoftirqd+0x15/0x20
      [  185.582340]  smpboot_thread_fn+0x15a/0x270
      [  185.582368]  kthread+0x19a/0x1e0
      [  185.582395]  ret_from_fork+0x1f/0x30
      [  185.582417]
      
      We can prevent this race by checking for the ve->request after looking
      up the sibling array.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200423115315.26825-1-chris@chris-wilson.co.uk
      36fe164d
    • C
      drm/i915/execlists: Drop request-before-CS assertion · 15501287
      Chris Wilson 提交于
      When we migrated to execlists, one of the conditions we wanted to test
      for was whether the breadcrumb seqno was being written before the
      breadcumb interrupt was delivered. This was following on from issues
      observed on previous generations which were not so strongly ordered. With
      the removal of the missed interrupt detection, we have not reliable
      means of detecting the out-of-order seqno/interrupt but instead tried to
      assert that the relationship between the CS event interrupt and the
      breadwrite should be strongly ordered. However, Icelake proves it is
      possible for the HW implementation to forget about minor little details
      such as write ordering and so the order between *processing* the CS
      event and the breadcrumb is unreliable.
      
      Remove the unreliable assertion, but leave a debug telltale in case we
      have reason to suspect.
      
      Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/1658Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Reviewed-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200422141749.28709-1-chris@chris-wilson.co.uk
      15501287
  4. 22 4月, 2020 3 次提交
  5. 21 4月, 2020 10 次提交
  6. 20 4月, 2020 1 次提交
  7. 18 4月, 2020 3 次提交
  8. 17 4月, 2020 3 次提交
    • C
      drm/i915/selftests: Take the engine wakeref around __rps_up_interrupt · a50717db
      Chris Wilson 提交于
      Since we are touching the device to read the registers, we are required
      to ensure the device is awake at the time. Currently, we believe
      ourselves to be inside the active request [thus an active engine
      wakeref], but since that may be retired in the background, we can
      spontaneously lose the wakeref and the ability to probe the HW.
      
      <4> [379.686703] RPM wakelock ref not held during HW access
      <4> [379.686805] WARNING: CPU: 7 PID: 4869 at ./drivers/gpu/drm/i915/intel_runtime_pm.h:115 gen12_fwtable_read32+0x233/0x300 [i915]
      <4> [379.686808] Modules linked in: i915(+) vgem snd_hda_codec_hdmi mei_hdcp x86_pkg_temp_thermal coretemp crct10dif_pclmul crc32_pclmul ax88179_178a usbnet mii ghash_clmulni_intel snd_intel_dspcfg snd_hda_codec snd_hwdep snd_hda_core snd_pcm e1000e mei_me ptp mei pps_core intel_lpss_pci prime_numbers [last unloaded: i915]
      <4> [379.686827] CPU: 7 PID: 4869 Comm: i915_selftest Tainted: G     U            5.7.0-rc1-CI-CI_DRM_8313+ #1
      <4> [379.686830] Hardware name: Intel Corporation Tiger Lake Client Platform/TigerLake U DDR4 SODIMM RVP, BIOS TGLSFWI1.R00.2457.A13.1912190237 12/19/2019
      <4> [379.686883] RIP: 0010:gen12_fwtable_read32+0x233/0x300 [i915]
      <4> [379.686887] Code: d8 ea e0 0f 0b e9 19 fe ff ff 80 3d ad 12 2d 00 00 0f 85 17 fe ff ff 48 c7 c7 b0 32 3e a0 c6 05 99 12 2d 00 01 e8 2d d8 ea e0 <0f> 0b e9 fd fd ff ff 8b 05 c4 75 56 e2 85 c0 0f 85 84 00 00 00 48
      <4> [379.686889] RSP: 0018:ffffc90000727970 EFLAGS: 00010286
      <4> [379.686892] RAX: 0000000000000000 RBX: ffff88848cc20ee8 RCX: 0000000000000001
      <4> [379.686894] RDX: 0000000080000001 RSI: ffff88843b1f0900 RDI: 00000000ffffffff
      <4> [379.686896] RBP: 0000000000000000 R08: ffff88843b1f0900 R09: 0000000000000000
      <4> [379.686898] R10: 0000000000000000 R11: 0000000000000000 R12: 000000000000a058
      <4> [379.686900] R13: 0000000000000001 R14: ffff88848cc2bf30 R15: 00000000ffffffea
      <4> [379.686902] FS:  00007f7d63f5e300(0000) GS:ffff8884a0180000(0000) knlGS:0000000000000000
      <4> [379.686904] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      <4> [379.686907] CR2: 000055e5c30f4988 CR3: 000000042e190002 CR4: 0000000000760ee0
      <4> [379.686910] PKRU: 55555554
      <4> [379.686911] Call Trace:
      <4> [379.686986]  live_rps_interrupt+0xb14/0xc10 [i915]
      <4> [379.687051]  ? intel_rps_unpark+0xb0/0xb0 [i915]
      <4> [379.687057]  ? __trace_bprintk+0x57/0x80
      <4> [379.687143]  __i915_subtests+0xb8/0x210 [i915]
      <4> [379.687222]  ? __i915_live_teardown+0x50/0x50 [i915]
      <4> [379.687291]  ? __intel_gt_live_setup+0x30/0x30 [i915]
      <4> [379.687361]  __run_selftests+0x112/0x170 [i915]
      <4> [379.687431]  i915_live_selftests+0x2c/0x60 [i915]
      <4> [379.687491]  i915_pci_probe+0x93/0x1b0 [i915]
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NAndi Shyti <andi.shyti@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200417093928.17822-2-chris@chris-wilson.co.uk
      a50717db
    • C
      drm/i915/selftests: Delay spinner before waiting for an interrupt · 9d7e560f
      Chris Wilson 提交于
      It seems that although (perhaps because of the memory stall?) the
      spinner has signaled that it has started, it still takes some time to
      spin up to 100% utilisation of the HW. Since the test depends on the
      full utilisation of the HW to trigger the RPS interrupt, wait a little
      bit and flush the interrupt status to be sure that the event we see if
      from the spinner.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NAndi Shyti <andi.shyti@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200417093928.17822-1-chris@chris-wilson.co.uk
      9d7e560f
    • C
      drm/i915/gt: Scrub execlists state on resume · 23122a4d
      Chris Wilson 提交于
      Before we resume, we reset the HW so we restart from a known good state.
      However, as a part of the reset process, we drain our pending CS event
      queue -- and if we are resuming that does not correspond to internal
      state. On setup, we are scrubbing the CS pointers, but alas only on
      setup.
      
      Apply the sanitization not just to setup, but to all resumes.
      Reported-by: NVenkata Ramana Nayana <venkata.ramana.nayana@intel.com>
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Venkata Ramana Nayana <venkata.ramana.nayana@intel.com>
      Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200416114117.3460-1-chris@chris-wilson.co.uk
      23122a4d
  9. 16 4月, 2020 3 次提交
  10. 10 4月, 2020 1 次提交
  11. 08 4月, 2020 7 次提交
    • C
      drm/i915/selftests: Take an explicit ref for rq->batch · fbaa1229
      Chris Wilson 提交于
      Since we are peeking into the batch object of the request, it is
      beholden on us to hold a reference to it.
      
      Closes: https://gitlab.freedesktop.org/drm/intel/issues/1634Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200408091723.28937-1-chris@chris-wilson.co.uk
      fbaa1229
    • C
      drm/i915/gt: Mark up racy check of breadcrumb irq enabled · dd345efe
      Chris Wilson 提交于
      We control b->irq_enabled inside the b->irq_lock, but we check before
      entering the spinlock whether or not the interrupt is currently
      unmasked.
      
      [ 1511.735208] BUG: KCSAN: data-race in __intel_breadcrumbs_disarm_irq [i915] / intel_engine_disarm_breadcrumbs [i915]
      [ 1511.735231]
      [ 1511.735242] write to 0xffff8881f75fc214 of 1 bytes by interrupt on cpu 2:
      [ 1511.735440]  __intel_breadcrumbs_disarm_irq+0x4b/0x160 [i915]
      [ 1511.735635]  signal_irq_work+0x337/0x710 [i915]
      [ 1511.735652]  irq_work_run_list+0xd7/0x110
      [ 1511.735666]  irq_work_run+0x1d/0x50
      [ 1511.735681]  smp_irq_work_interrupt+0x21/0x30
      [ 1511.735701]  irq_work_interrupt+0xf/0x20
      [ 1511.735722]  __do_softirq+0x6f/0x206
      [ 1511.735736]  irq_exit+0xcd/0xe0
      [ 1511.735756]  do_IRQ+0x44/0xc0
      [ 1511.735773]  ret_from_intr+0x0/0x1c
      [ 1511.735787]  schedule+0x0/0xb0
      [ 1511.735803]  worker_thread+0x194/0x670
      [ 1511.735823]  kthread+0x19a/0x1e0
      [ 1511.735837]  ret_from_fork+0x1f/0x30
      [ 1511.735848]
      [ 1511.735867] read to 0xffff8881f75fc214 of 1 bytes by task 432 on cpu 1:
      [ 1511.736068]  intel_engine_disarm_breadcrumbs+0x22/0x80 [i915]
      [ 1511.736263]  __engine_park+0x107/0x5d0 [i915]
      [ 1511.736453]  ____intel_wakeref_put_last+0x44/0x90 [i915]
      [ 1511.736648]  __intel_wakeref_put_last+0x5a/0x70 [i915]
      [ 1511.736842]  intel_context_exit_engine+0xf2/0x100 [i915]
      [ 1511.737044]  i915_request_retire+0x6b2/0x770 [i915]
      [ 1511.737244]  retire_requests+0x7a/0xd0 [i915]
      [ 1511.737438]  intel_gt_retire_requests_timeout+0x3a7/0x6f0 [i915]
      [ 1511.737633]  i915_drop_caches_set+0x1e7/0x260 [i915]
      [ 1511.737650]  simple_attr_write+0xfa/0x110
      [ 1511.737665]  full_proxy_write+0x94/0xc0
      [ 1511.737679]  __vfs_write+0x4b/0x90
      [ 1511.737697]  vfs_write+0xfc/0x280
      [ 1511.737718]  ksys_write+0x78/0x100
      [ 1511.737732]  __x64_sys_write+0x44/0x60
      [ 1511.737751]  do_syscall_64+0x6e/0x2c0
      [ 1511.737769]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Reviewed-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200408092916.5355-1-chris@chris-wilson.co.uk
      dd345efe
    • C
      drm/i915/gt: Mark up racy read of intel_ring.head · 32a55a10
      Chris Wilson 提交于
      The intel_ring.head is updated as the requests are retired, but is
      sampled at any time as we submit requests. Furthermore, it tracks
      RING_HEAD which is inherently asynchronous.
      
      [  148.630314] BUG: KCSAN: data-race in execlists_dequeue [i915] / i915_request_retire [i915]
      [  148.630349]
      [  148.630374] write to 0xffff8881f4e28ddc of 4 bytes by task 90 on cpu 2:
      [  148.630752]  i915_request_retire+0xed/0x770 [i915]
      [  148.631123]  retire_requests+0x7a/0xd0 [i915]
      [  148.631491]  engine_retire+0xa6/0xe0 [i915]
      [  148.631523]  process_one_work+0x3af/0x640
      [  148.631552]  worker_thread+0x80/0x670
      [  148.631581]  kthread+0x19a/0x1e0
      [  148.631609]  ret_from_fork+0x1f/0x30
      [  148.631629]
      [  148.631652] read to 0xffff8881f4e28ddc of 4 bytes by task 14288 on cpu 3:
      [  148.632019]  execlists_dequeue+0x1300/0x1680 [i915]
      [  148.632384]  __execlists_submission_tasklet+0x48/0x60 [i915]
      [  148.632770]  execlists_submit_request+0x38e/0x3c0 [i915]
      [  148.633146]  submit_notify+0x8f/0xc0 [i915]
      [  148.633512]  __i915_sw_fence_complete+0x5d/0x3e0 [i915]
      [  148.633875]  i915_sw_fence_complete+0x58/0x80 [i915]
      [  148.634238]  i915_sw_fence_commit+0x16/0x20 [i915]
      [  148.634613]  __i915_request_queue+0x60/0x70 [i915]
      [  148.634985]  i915_gem_do_execbuffer+0x2de0/0x42b0 [i915]
      [  148.635366]  i915_gem_execbuffer2_ioctl+0x2ab/0x580 [i915]
      [  148.635400]  drm_ioctl_kernel+0xe9/0x130
      [  148.635429]  drm_ioctl+0x27d/0x45e
      [  148.635456]  ksys_ioctl+0x89/0xb0
      [  148.635482]  __x64_sys_ioctl+0x42/0x60
      [  148.635510]  do_syscall_64+0x6e/0x2c0
      [  148.635542]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      
      [  645.071436] BUG: KCSAN: data-race in gen8_emit_fini_breadcrumb [i915] / i915_request_retire [i915]
      [  645.071456]
      [  645.071467] write to 0xffff8881efe403dc of 4 bytes by task 14668 on cpu 3:
      [  645.071647]  i915_request_retire+0xed/0x770 [i915]
      [  645.071824]  i915_request_create+0x6c/0x160 [i915]
      [  645.072000]  i915_gem_do_execbuffer+0x206d/0x42b0 [i915]
      [  645.072177]  i915_gem_execbuffer2_ioctl+0x2ab/0x580 [i915]
      [  645.072194]  drm_ioctl_kernel+0xe9/0x130
      [  645.072208]  drm_ioctl+0x27d/0x45e
      [  645.072222]  ksys_ioctl+0x89/0xb0
      [  645.072235]  __x64_sys_ioctl+0x42/0x60
      [  645.072248]  do_syscall_64+0x6e/0x2c0
      [  645.072263]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      [  645.072275]
      [  645.072285] read to 0xffff8881efe403dc of 4 bytes by interrupt on cpu 2:
      [  645.072458]  gen8_emit_fini_breadcrumb+0x158/0x300 [i915]
      [  645.072636]  __i915_request_submit+0x204/0x430 [i915]
      [  645.072809]  execlists_dequeue+0x8e1/0x1680 [i915]
      [  645.072982]  __execlists_submission_tasklet+0x48/0x60 [i915]
      [  645.073154]  execlists_submit_request+0x38e/0x3c0 [i915]
      [  645.073330]  submit_notify+0x8f/0xc0 [i915]
      [  645.073499]  __i915_sw_fence_complete+0x5d/0x3e0 [i915]
      [  645.073668]  i915_sw_fence_wake+0xc2/0x130 [i915]
      [  645.073836]  __i915_sw_fence_complete+0x2cf/0x3e0 [i915]
      [  645.074006]  i915_sw_fence_complete+0x58/0x80 [i915]
      [  645.074175]  dma_i915_sw_fence_wake+0x3e/0x80 [i915]
      [  645.074344]  signal_irq_work+0x62f/0x710 [i915]
      [  645.074360]  irq_work_run_list+0xd7/0x110
      [  645.074373]  irq_work_run+0x1d/0x50
      [  645.074386]  smp_irq_work_interrupt+0x21/0x30
      [  645.074400]  irq_work_interrupt+0xf/0x20
      [  645.074414]  _raw_spin_unlock_irqrestore+0x34/0x40
      [  645.074585]  execlists_submission_tasklet+0xde/0x170 [i915]
      [  645.074602]  tasklet_action_common.isra.0+0x42/0x90
      [  645.074617]  __do_softirq+0xc8/0x206
      [  645.074629]  irq_exit+0xcd/0xe0
      [  645.074642]  do_IRQ+0x44/0xc0
      [  645.074654]  ret_from_intr+0x0/0x1c
      [  645.074667]  finish_task_switch+0x73/0x230
      [  645.074679]  __schedule+0x1c5/0x4c0
      [  645.074691]  schedule+0x45/0xb0
      [  645.074704]  worker_thread+0x194/0x670
      [  645.074716]  kthread+0x19a/0x1e0
      [  645.074729]  ret_from_fork+0x1f/0x30
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Reviewed-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200407221832.15465-1-chris@chris-wilson.co.uk
      32a55a10
    • J
      drm/i915/uc: prefer struct drm_device based logging · 4381bbd8
      Jani Nikula 提交于
      Prefer struct drm_device based logging over struct device based logging.
      
      No functional changes.
      
      Cc: Wambui Karuga <wambui.karugax@gmail.com>
      Reviewed-by: NWambui Karuga <wambui.karugax@gmail.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200402114819.17232-17-jani.nikula@intel.com
      4381bbd8
    • J
      drm/i915/gt: prefer struct drm_device based logging · dc483ba5
      Jani Nikula 提交于
      Prefer struct drm_device based logging over struct device based logging.
      
      No functional changes.
      
      Cc: Wambui Karuga <wambui.karugax@gmail.com>
      Reviewed-by: NWambui Karuga <wambui.karugax@gmail.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200402114819.17232-16-jani.nikula@intel.com
      dc483ba5
    • J
      drm/i915/uc: prefer struct drm_device based logging · 61d5c507
      Jani Nikula 提交于
      Prefer struct drm_device based logging over struct device based logging.
      
      No functional changes.
      
      Cc: Wambui Karuga <wambui.karugax@gmail.com>
      Reviewed-by: NWambui Karuga <wambui.karugax@gmail.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200402114819.17232-10-jani.nikula@intel.com
      61d5c507
    • C
      drm/i915/selftests: Drop vestigal timeslicing assert · cf4c826d
      Chris Wilson 提交于
      Since the semaphore interrupt may cause us to yield the timeslice
      immediately, we may cancel the timer before we notice the submission is
      complete. The assertion is no longer valid due to the race with the
      interrupt.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200407222625.15542-1-chris@chris-wilson.co.uk
      cf4c826d