1. 16 Mar, 2020 4 commits
  2. 15 Mar, 2020 1 commit
  3. 14 Mar, 2020 1 commit
  4. 13 Mar, 2020 8 commits
  5. 12 Mar, 2020 5 commits
  6. 11 Mar, 2020 16 commits
  7. 10 Mar, 2020 5 commits
    • Chris Wilson's avatar
      drm/i915/execlists: Mark up data-races in virtual engines · 3a55dc89
      Chris Wilson authored
      The virtual engine passes tokens back and forth to its backing physical
      engines.
      
      [   57.372993] BUG: KCSAN: data-race in execlists_dequeue [i915] / virtual_submission_tasklet [i915]
      [   57.373012]
      [   57.373023] write to 0xffff8881f47324c0 of 4 bytes by interrupt on cpu 2:
      [   57.373241]  execlists_dequeue+0x6fa/0x2150 [i915]
      [   57.373458]  __execlists_submission_tasklet+0x48/0x60 [i915]
      [   57.373677]  execlists_submission_tasklet+0xd3/0x170 [i915]
      [   57.373694]  tasklet_action_common.isra.0+0x42/0xa0
      [   57.373709]  __do_softirq+0xd7/0x2cd
      [   57.373723]  irq_exit+0xbe/0xe0
      [   57.373735]  do_IRQ+0x51/0x100
      [   57.373748]  ret_from_intr+0x0/0x1c
      [   57.373963]  engine_retire+0x89/0xe0 [i915]
      [   57.373977]  process_one_work+0x3b1/0x690
      [   57.373990]  worker_thread+0x80/0x670
      [   57.374004]  kthread+0x19a/0x1e0
      [   57.374017]  ret_from_fork+0x1f/0x30
      [   57.374027]
      [   57.374038] read to 0xffff8881f47324c0 of 4 bytes by interrupt on cpu 3:
      [   57.374256]  virtual_submission_tasklet+0x27/0x5a0 [i915]
      [   57.374273]  tasklet_action_common.isra.0+0x42/0xa0
      [   57.374288]  __do_softirq+0xd7/0x2cd
      [   57.374302]  run_ksoftirqd+0x15/0x20
      [   57.374315]  smpboot_thread_fn+0x1ab/0x300
      [   57.374329]  kthread+0x19a/0x1e0
      [   57.374342]  ret_from_fork+0x1f/0x30
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200310141320.24149-3-chris@chris-wilson.co.uk
      3a55dc89
    • Chris Wilson's avatar
      drm/i915: Mark up racy read of active rq->engine · 326611dd
      Chris Wilson authored
      As a virtual engine may change the rq->engine to point to the active
      request in flight, we need to warn the compiler that an active request's
      engine is volatile.
      
      [   95.017686] write (marked) to 0xffff8881e8386b10 of 8 bytes by interrupt on cpu 2:
      [   95.018123]  execlists_dequeue+0x762/0x2150 [i915]
      [   95.018539]  __execlists_submission_tasklet+0x48/0x60 [i915]
      [   95.018955]  execlists_submission_tasklet+0xd3/0x170 [i915]
      [   95.018986]  tasklet_action_common.isra.0+0x42/0xa0
      [   95.019016]  __do_softirq+0xd7/0x2cd
      [   95.019043]  irq_exit+0xbe/0xe0
      [   95.019068]  irq_work_interrupt+0xf/0x20
      [   95.019491]  i915_request_retire+0x2c5/0x670 [i915]
      [   95.019937]  retire_requests+0xa1/0xf0 [i915]
      [   95.020348]  engine_retire+0xa1/0xe0 [i915]
      [   95.020376]  process_one_work+0x3b1/0x690
      [   95.020403]  worker_thread+0x80/0x670
      [   95.020429]  kthread+0x19a/0x1e0
      [   95.020454]  ret_from_fork+0x1f/0x30
      [   95.020476]
      [   95.020498] read to 0xffff8881e8386b10 of 8 bytes by task 8909 on cpu 3:
      [   95.020918]  __i915_request_commit+0x177/0x220 [i915]
      [   95.021329]  i915_gem_do_execbuffer+0x38c4/0x4e50 [i915]
      [   95.021750]  i915_gem_execbuffer2_ioctl+0x2c3/0x580 [i915]
      [   95.021784]  drm_ioctl_kernel+0xe4/0x120
      [   95.021809]  drm_ioctl+0x297/0x4c7
      [   95.021832]  ksys_ioctl+0x89/0xb0
      [   95.021865]  __x64_sys_ioctl+0x42/0x60
      [   95.021901]  do_syscall_64+0x6e/0x2c0
      [   95.021927]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200310142403.5953-1-chris@chris-wilson.co.uk
      326611dd
    • Chris Wilson's avatar
      drm/i915/gt: Mark up racy reads for intel_context.inflight · 0690e504
      Chris Wilson authored
      When being used across multiple real engines inside a virtual engine,
      the intel_context.inflight is updated atomically, and so we must
      annotate the racy read from outside the owning context.
      
      [11142.482846] BUG: KCSAN: data-race in __execlists_submission_tasklet [i915] / __execlists_submission_tasklet [i915]
      [11142.482867]
      [11142.482878] write (marked) to 0xffff8881f257b5e0 of 8 bytes by interrupt on cpu 2:
      [11142.483107]  __execlists_submission_tasklet+0x1d33/0x2120 [i915]
      [11142.483336]  execlists_submission_tasklet+0xd3/0x170 [i915]
      [11142.483355]  tasklet_action_common.isra.0+0x42/0xa0
      [11142.483371]  __do_softirq+0xd7/0x2cd
      [11142.483384]  irq_exit+0xbe/0xe0
      [11142.483401]  do_IRQ+0x51/0x100
      [11142.483424]  ret_from_intr+0x0/0x1c
      [11142.483446]  do_idle+0x133/0x1f0
      [11142.483465]  cpu_startup_entry+0x14/0x16
      [11142.483483]  start_secondary+0x120/0x180
      [11142.483498]  secondary_startup_64+0xa4/0xb0
      [11142.483512]
      [11142.483528] read to 0xffff8881f257b5e0 of 8 bytes by interrupt on cpu 1:
      [11142.483755]  __execlists_submission_tasklet+0x14e/0x2120 [i915]
      [11142.483981]  execlists_submission_tasklet+0xd3/0x170 [i915]
      [11142.483999]  tasklet_action_common.isra.0+0x42/0xa0
      [11142.484014]  __do_softirq+0xd7/0x2cd
      [11142.484028]  do_softirq_own_stack+0x2a/0x40
      [11142.484046]  do_softirq.part.0+0x26/0x30
      [11142.484071]  __local_bh_enable_ip+0x46/0x50
      [11142.484299]  i915_gem_do_execbuffer+0x39c1/0x4e50 [i915]
      [11142.484528]  i915_gem_execbuffer2_ioctl+0x2c3/0x580 [i915]
      [11142.484546]  drm_ioctl_kernel+0xe4/0x120
      [11142.484559]  drm_ioctl+0x297/0x4c7
      [11142.484572]  ksys_ioctl+0x89/0xb0
      [11142.484586]  __x64_sys_ioctl+0x42/0x60
      [11142.484610]  do_syscall_64+0x6e/0x2c0
      [11142.484627]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200310141320.24149-1-chris@chris-wilson.co.uk
      0690e504
    • Chris Wilson's avatar
      drm/i915: Tweak scheduler's kick_submission() · 6cebcf74
      Chris Wilson authored
      Skip useless priority bumping on adding a new dependency by making sure
      that we do update the priority if we would have rescheduled the active
      cotnext.
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200310115947.6482-1-chris@chris-wilson.co.uk
      6cebcf74
    • Chris Wilson's avatar
      drm/i915: Defer semaphore priority bumping to a workqueue · 209df10b
      Chris Wilson authored
      Since the semaphore fence may be signaled from inside an interrupt
      handler from inside a request holding its request->lock, we cannot then
      enter into the engine->active.lock for processing the semaphore priority
      bump as we may traverse our call tree and end up on another held
      request.
      
      CPU 0:
      [ 2243.218864]  _raw_spin_lock_irqsave+0x9a/0xb0
      [ 2243.218867]  i915_schedule_bump_priority+0x49/0x80 [i915]
      [ 2243.218869]  semaphore_notify+0x6d/0x98 [i915]
      [ 2243.218871]  __i915_sw_fence_complete+0x61/0x420 [i915]
      [ 2243.218874]  ? kmem_cache_free+0x211/0x290
      [ 2243.218876]  i915_sw_fence_complete+0x58/0x80 [i915]
      [ 2243.218879]  dma_i915_sw_fence_wake+0x3e/0x80 [i915]
      [ 2243.218881]  signal_irq_work+0x571/0x690 [i915]
      [ 2243.218883]  irq_work_run_list+0xd7/0x120
      [ 2243.218885]  irq_work_run+0x1d/0x50
      [ 2243.218887]  smp_irq_work_interrupt+0x21/0x30
      [ 2243.218889]  irq_work_interrupt+0xf/0x20
      
      CPU 1:
      [ 2242.173107]  _raw_spin_lock+0x8f/0xa0
      [ 2242.173110]  __i915_request_submit+0x64/0x4a0 [i915]
      [ 2242.173112]  __execlists_submission_tasklet+0x8ee/0x2120 [i915]
      [ 2242.173114]  ? i915_sched_lookup_priolist+0x1e3/0x2b0 [i915]
      [ 2242.173117]  execlists_submit_request+0x2e8/0x2f0 [i915]
      [ 2242.173119]  submit_notify+0x8f/0xc0 [i915]
      [ 2242.173121]  __i915_sw_fence_complete+0x61/0x420 [i915]
      [ 2242.173124]  ? _raw_spin_unlock_irqrestore+0x39/0x40
      [ 2242.173137]  i915_sw_fence_complete+0x58/0x80 [i915]
      [ 2242.173140]  i915_sw_fence_commit+0x16/0x20 [i915]
      
      Closes: https://gitlab.freedesktop.org/drm/intel/issues/1318
      Fixes: b7404c7e ("drm/i915: Bump ready tasks ahead of busywaits")
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: <stable@vger.kernel.org> # v5.2+
      Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200310101720.9944-1-chris@chris-wilson.co.uk
      209df10b