1. 21 3月, 2022 1 次提交
  2. 24 11月, 2021 2 次提交
    • T
      drm/i915/gt: Hold RPM wakelock during PXP suspend · b8d84368
      Tejas Upadhyay 提交于
      selftest --r live shows failure in suspend tests when
      RPM wakelock is not acquired during suspend.
      
      This changes addresses below error :
      <4> [154.177535] RPM wakelock ref not held during HW access
      <4> [154.177575] WARNING: CPU: 4 PID: 5772 at
      drivers/gpu/drm/i915/intel_runtime_pm.h:113
      fwtable_write32+0x240/0x320 [i915]
      <4> [154.177974] Modules linked in: i915(+) vgem drm_shmem_helper
      fuse snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic
      ledtrig_audio mei_hdcp mei_pxp x86_pkg_temp_thermal coretemp
      crct10dif_pclmul crc32_pclmul ghash_clmulni_intel snd_intel_dspcfg
      snd_hda_codec snd_hwdep igc snd_hda_core ttm mei_me ptp
      snd_pcm prime_numbers mei i2c_i801 pps_core i2c_smbus intel_lpss_pci
      btusb btrtl btbcm btintel bluetooth ecdh_generic ecc [last unloaded: i915]
      <4> [154.178143] CPU: 4 PID: 5772 Comm: i915_selftest Tainted: G
      U            5.15.0-rc6-CI-Patchwork_21432+ #1
      <4> [154.178154] Hardware name: ASUS System Product Name/TUF GAMING
      Z590-PLUS WIFI, BIOS 0811 04/06/2021
      <4> [154.178160] RIP: 0010:fwtable_write32+0x240/0x320 [i915]
      <4> [154.178604] Code: 15 7b e1 0f 0b e9 34 fe ff ff 80 3d a9 89 31
      00 00 0f 85 31 fe ff ff 48 c7 c7 88 9e 4f a0 c6 05 95 89 31 00 01 e8
      c0 15 7b e1 <0f> 0b e9 17 fe ff ff 8b 05 0f 83 58 e2 85 c0 0f 85 8d
      00 00 00 48
      <4> [154.178614] RSP: 0018:ffffc900016279f0 EFLAGS: 00010286
      <4> [154.178626] RAX: 0000000000000000 RBX: ffff888204fe0ee0
      RCX: 0000000000000001
      <4> [154.178634] RDX: 0000000080000001 RSI: ffffffff823142b5
      RDI: 00000000ffffffff
      <4> [154.178641] RBP: 00000000000320f0 R08: 0000000000000000
      R09: c0000000ffffcd5a
      <4> [154.178647] R10: 00000000000f8c90 R11: ffffc90001627808
      R12: 0000000000000000
      <4> [154.178654] R13: 0000000040000000 R14: ffffffffa04d12e0
      R15: 0000000000000000
      <4> [154.178660] FS:  00007f7390aa4c00(0000) GS:ffff88844f000000(0000)
      knlGS:0000000000000000
      <4> [154.178669] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      <4> [154.178675] CR2: 000055bc40595028 CR3: 0000000204474005
      CR4: 0000000000770ee0
      <4> [154.178682] PKRU: 55555554
      <4> [154.178687] Call Trace:
      <4> [154.178706]  intel_pxp_fini_hw+0x23/0x30 [i915]
      <4> [154.179284]  intel_pxp_suspend+0x1f/0x30 [i915]
      <4> [154.179807]  live_gt_resume+0x5b/0x90 [i915]
      
      Changes since V2 :
      	- Remove boolean in intel_pxp_runtime_preapre for
      	  non-pxp configs. Solves build error
      Changes since V2 :
      	- Open-code intel_pxp_runtime_suspend - Daniele
      	- Remove boolean in intel_pxp_runtime_preapre - Daniele
      Changes since V1 :
      	- split the HW access parts in gt_suspend_late - Daniele
      	- Remove default PXP configs
      Signed-off-by: NTejas Upadhyay <tejaskumarx.surendrakumar.upadhyay@intel.com>
      Reviewed-by: NDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
      Fixes: 0cfab4cb ("drm/i915/pxp: Enable PXP power management")
      Signed-off-by: NDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20211117060321.3729343-1-tejaskumarx.surendrakumar.upadhyay@intel.com
      (cherry picked from commit d22d446f)
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      b8d84368
    • T
      drm/i915/gt: Hold RPM wakelock during PXP suspend · d22d446f
      Tejas Upadhyay 提交于
      selftest --r live shows failure in suspend tests when
      RPM wakelock is not acquired during suspend.
      
      This changes addresses below error :
      <4> [154.177535] RPM wakelock ref not held during HW access
      <4> [154.177575] WARNING: CPU: 4 PID: 5772 at
      drivers/gpu/drm/i915/intel_runtime_pm.h:113
      fwtable_write32+0x240/0x320 [i915]
      <4> [154.177974] Modules linked in: i915(+) vgem drm_shmem_helper
      fuse snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic
      ledtrig_audio mei_hdcp mei_pxp x86_pkg_temp_thermal coretemp
      crct10dif_pclmul crc32_pclmul ghash_clmulni_intel snd_intel_dspcfg
      snd_hda_codec snd_hwdep igc snd_hda_core ttm mei_me ptp
      snd_pcm prime_numbers mei i2c_i801 pps_core i2c_smbus intel_lpss_pci
      btusb btrtl btbcm btintel bluetooth ecdh_generic ecc [last unloaded: i915]
      <4> [154.178143] CPU: 4 PID: 5772 Comm: i915_selftest Tainted: G
      U            5.15.0-rc6-CI-Patchwork_21432+ #1
      <4> [154.178154] Hardware name: ASUS System Product Name/TUF GAMING
      Z590-PLUS WIFI, BIOS 0811 04/06/2021
      <4> [154.178160] RIP: 0010:fwtable_write32+0x240/0x320 [i915]
      <4> [154.178604] Code: 15 7b e1 0f 0b e9 34 fe ff ff 80 3d a9 89 31
      00 00 0f 85 31 fe ff ff 48 c7 c7 88 9e 4f a0 c6 05 95 89 31 00 01 e8
      c0 15 7b e1 <0f> 0b e9 17 fe ff ff 8b 05 0f 83 58 e2 85 c0 0f 85 8d
      00 00 00 48
      <4> [154.178614] RSP: 0018:ffffc900016279f0 EFLAGS: 00010286
      <4> [154.178626] RAX: 0000000000000000 RBX: ffff888204fe0ee0
      RCX: 0000000000000001
      <4> [154.178634] RDX: 0000000080000001 RSI: ffffffff823142b5
      RDI: 00000000ffffffff
      <4> [154.178641] RBP: 00000000000320f0 R08: 0000000000000000
      R09: c0000000ffffcd5a
      <4> [154.178647] R10: 00000000000f8c90 R11: ffffc90001627808
      R12: 0000000000000000
      <4> [154.178654] R13: 0000000040000000 R14: ffffffffa04d12e0
      R15: 0000000000000000
      <4> [154.178660] FS:  00007f7390aa4c00(0000) GS:ffff88844f000000(0000)
      knlGS:0000000000000000
      <4> [154.178669] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      <4> [154.178675] CR2: 000055bc40595028 CR3: 0000000204474005
      CR4: 0000000000770ee0
      <4> [154.178682] PKRU: 55555554
      <4> [154.178687] Call Trace:
      <4> [154.178706]  intel_pxp_fini_hw+0x23/0x30 [i915]
      <4> [154.179284]  intel_pxp_suspend+0x1f/0x30 [i915]
      <4> [154.179807]  live_gt_resume+0x5b/0x90 [i915]
      
      Changes since V2 :
      	- Remove boolean in intel_pxp_runtime_preapre for
      	  non-pxp configs. Solves build error
      Changes since V2 :
      	- Open-code intel_pxp_runtime_suspend - Daniele
      	- Remove boolean in intel_pxp_runtime_preapre - Daniele
      Changes since V1 :
      	- split the HW access parts in gt_suspend_late - Daniele
      	- Remove default PXP configs
      Signed-off-by: NTejas Upadhyay <tejaskumarx.surendrakumar.upadhyay@intel.com>
      Reviewed-by: NDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
      Fixes: 0cfab4cb ("drm/i915/pxp: Enable PXP power management")
      Signed-off-by: NDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20211117060321.3729343-1-tejaskumarx.surendrakumar.upadhyay@intel.com
      d22d446f
  3. 29 10月, 2021 1 次提交
    • U
      drm/i915/pmu: Connect engine busyness stats from GuC to pmu · 77cdd054
      Umesh Nerlige Ramappa 提交于
      With GuC handling scheduling, i915 is not aware of the time that a
      context is scheduled in and out of the engine. Since i915 pmu relies on
      this info to provide engine busyness to the user, GuC shares this info
      with i915 for all engines using shared memory. For each engine, this
      info contains:
      
      - total busyness: total time that the context was running (total)
      - id: id of the running context (id)
      - start timestamp: timestamp when the context started running (start)
      
      At the time (now) of sampling the engine busyness, if the id is valid
      (!= ~0), and start is non-zero, then the context is considered to be
      active and the engine busyness is calculated using the below equation
      
      	engine busyness = total + (now - start)
      
      All times are obtained from the gt clock base. For inactive contexts,
      engine busyness is just equal to the total.
      
      The start and total values provided by GuC are 32 bits and wrap around
      in a few minutes. Since perf pmu provides busyness as 64 bit
      monotonically increasing values, there is a need for this implementation
      to account for overflows and extend the time to 64 bits before returning
      busyness to the user. In order to do that, a worker runs periodically at
      frequency = 1/8th the time it takes for the timestamp to wrap. As an
      example, that would be once in 27 seconds for a gt clock frequency of
      19.2 MHz.
      
      Note:
      There might be an over-accounting of busyness due to the fact that GuC
      may be updating the total and start values while kmd is reading them.
      (i.e kmd may read the updated total and the stale start). In such a
      case, user may see higher busyness value followed by smaller ones which
      would eventually catch up to the higher value.
      
      v2: (Tvrtko)
      - Include details in commit message
      - Move intel engine busyness function into execlist code
      - Use union inside engine->stats
      - Use natural type for ping delay jiffies
      - Drop active_work condition checks
      - Use for_each_engine if iterating all engines
      - Drop seq locking, use spinlock at GuC level to update engine stats
      - Document worker specific details
      
      v3: (Tvrtko/Umesh)
      - Demarcate GuC and execlist stat objects with comments
      - Document known over-accounting issue in commit
      - Provide a consistent view of GuC state
      - Add hooks to gt park/unpark for GuC busyness
      - Stop/start worker in gt park/unpark path
      - Drop inline
      - Move spinlock and worker inits to GuC initialization
      - Drop helpers that are called only once
      
      v4: (Tvrtko/Matt/Umesh)
      - Drop addressed opens from commit message
      - Get runtime pm in ping, remove from the park path
      - Use cancel_delayed_work_sync in disable_submission path
      - Update stats during reset prepare
      - Skip ping if reset in progress
      - Explicitly name execlists and GuC stats objects
      - Since disable_submission is called from many places, move resetting
        stats to intel_guc_submission_reset_prepare
      
      v5: (Tvrtko)
      - Add a trylock helper that does not sleep and synchronize PMU event
        callbacks and worker with gt reset
      
      v6: (CI BAT failures)
      - DUTs using execlist submission failed to boot since __gt_unpark is
        called during i915 load. This ends up calling the GuC busyness unpark
        hook and results in kick-starting an uninitialized worker. Let
        park/unpark hooks check if GuC submission has been initialized.
      - drop cant_sleep() from trylock helper since rcu_read_lock takes care
        of that.
      
      v7: (CI) Fix igt@i915_selftest@live@gt_engines
      - For GuC mode of submission the engine busyness is derived from gt time
        domain. Use gt time elapsed as reference in the selftest.
      - Increase busyness calculation to 10ms duration to ensure batch runs
        longer and falls within the busyness tolerances in selftest.
      
      v8:
      - Use ktime_get in selftest as before
      - intel_reset_trylock_no_wait results in a lockdep splat that is not
        trivial to fix since the PMU callback runs in irq context and the
        reset paths are tightly knit into the driver. The test that uncovers
        this is igt@perf_pmu@faulting-read. Drop intel_reset_trylock_no_wait,
        instead use the reset_count to synchronize with gt reset during pmu
        callback. For the ping, continue to use intel_reset_trylock since ping
        is not run in irq context.
      
      - GuC PM timestamp does not tick when GuC is idle. This can potentially
        result in wrong busyness values when a context is active on the
        engine, but GuC is idle. Use the RING TIMESTAMP as GPU timestamp to
        process the GuC busyness stats. This works since both GuC timestamp and
        RING timestamp are synced with the same clock.
      
      - The busyness stats may get updated after the batch starts running.
        This delay causes the busyness reported for 100us duration to fall
        below 95% in the selftest. The only option at this time is to wait for
        GuC busyness to change from idle to active before we sample busyness
        over a 100us period.
      Signed-off-by: NJohn Harrison <John.C.Harrison@Intel.com>
      Signed-off-by: NUmesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
      Acked-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NMatthew Brost <matthew.brost@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20211027004821.66097-2-umesh.nerlige.ramappa@intel.com
      77cdd054
  4. 05 10月, 2021 1 次提交
  5. 24 9月, 2021 2 次提交
  6. 28 7月, 2021 2 次提交
  7. 22 7月, 2021 1 次提交
    • D
      drm/i915: Ditch i915 globals shrink infrastructure · 4f62a7e0
      Daniel Vetter 提交于
      This essentially reverts
      
      commit 84a10749
      Author: Chris Wilson <chris@chris-wilson.co.uk>
      Date:   Wed Jan 24 11:36:08 2018 +0000
      
          drm/i915: Shrink the GEM kmem_caches upon idling
      
      mm/vmscan.c:do_shrink_slab() is a thing, if there's an issue with it
      then we need to fix that there, not hand-roll our own slab shrinking
      code in i915.
      
      Also when this was added there was only one other caller of
      kmem_cache_shrink (added 2005 to the acpi code). Now there's a 2nd one
      outside of i915 code in a kunit test, which seems legit since that
      wants to very carefully control what's in the kmem_cache. This out of
      a total of over 500 calls to kmem_cache_create. This alone should have
      been warning sign enough that we're doing something silly.
      
      Noticed while reviewing a patch set from Jason to fix up some issues
      in our i915_init() and i915_exit() module load/cleanup code. Now that
      i915_globals.c isn't any different than normal init/exit functions, we
      should convert them over to one unified table and remove
      i915_globals.[hc] entirely.
      
      v2: Improve commit message (Jason)
      Reviewed-by: NJason Ekstrand <jason@jlekstrand.net>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Jason Ekstrand <jason@jlekstrand.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210721183229.4136488-1-daniel.vetter@ffwll.ch
      4f62a7e0
  8. 25 3月, 2021 1 次提交
  9. 18 12月, 2020 1 次提交
  10. 07 7月, 2020 1 次提交
  11. 03 6月, 2020 1 次提交
  12. 14 5月, 2020 1 次提交
    • C
      drm/i915/gt: Suspend tasklets before resume sanitization · 4a0ca47a
      Chris Wilson 提交于
      It is possible for a residual tasklet to be pending execution as we
      resume (whether that's some prior test kicking off the tasklet, or if we
      are in a suspend/resume stress test). As such, we do not want that
      tasklet to execute in the middle of our sanitization, such that it sees
      the poisoned state. For example,
      
      <4>[  449.386553] invalid opcode: 0000 [#1] PREEMPT SMP NOPTI
      <4>[  449.386555] CPU: 1 PID: 5115 Comm: i915_selftest Tainted: G     U  W         5.7.0-rc4-CI-CI_DRM_8472+ #1
      <4>[  449.386556] Hardware name: Intel Corporation Ice Lake Client Platform/IceLake U DDR4 SODIMM PD RVP TLC, BIOS ICLSFWR1.R00.3183.A00.1905020411 05/02/2019
      <4>[  449.386585] RIP: 0010:process_csb+0x6bf/0x830 [i915]
      <4>[  449.386588] Code: 00 48 c7 c2 10 bc 4c a0 48 c7 c7 d4 75 34 a0 e8 87 0e e6 e0 bf 01 00 00 00 e8 9d e0 e5 e0 31 f6 bf 09 00 00 00 e8 e1 ba d6 e0 <0f> 0b 8b 87 10 05 00 00 85 c0 0f 85 5f f9 ff ff 48 c7 c1 70 a5 4f
      <4>[  449.386591] RSP: 0018:ffffc90000170ea0 EFLAGS: 00010297
      <4>[  449.386594] RAX: 0000000080000101 RBX: 0000000000000000 RCX: 0000000000000000
      <4>[  449.386596] RDX: ffff88849d5bc040 RSI: 0000000000000000 RDI: 0000000000000009
      <4>[  449.386598] RBP: ffffc90000170f00 R08: 0000000000000000 R09: 0000000000000000
      <4>[  449.386600] R10: 0000000000000000 R11: 0000000000000000 R12: ffff88843ccea018
      <4>[  449.386602] R13: ffff88843ccea658 R14: ffff88843ccea640 R15: ffff88843ccea000
      <4>[  449.386605] FS:  00007f826a813300(0000) GS:ffff88849fe80000(0000) knlGS:0000000000000000
      <4>[  449.386607] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      <4>[  449.386609] CR2: 0000560366b94280 CR3: 000000048ba02002 CR4: 0000000000760ee0
      <4>[  449.386611] PKRU: 55555554
      <4>[  449.386613] Call Trace:
      <4>[  449.386616]  <IRQ>
      <4>[  449.386646]  ? execlists_submission_tasklet+0xcf/0x140 [i915]
      <4>[  449.386674]  execlists_submission_tasklet+0x2f/0x140 [i915]
      <4>[  449.386679]  tasklet_action_common.isra.16+0x6c/0x1c0
      <4>[  449.386684]  __do_softirq+0xdf/0x49e
      <4>[  449.386687]  irq_exit+0xba/0xc0
      <4>[  449.386690]  smp_apic_timer_interrupt+0xb7/0x280
      <4>[  449.386693]  apic_timer_interrupt+0xf/0x20
      <4>[  449.386695]  </IRQ>
      <4>[  449.386698] RIP: 0010:_raw_spin_unlock_irqrestore+0x49/0x60
      <4>[  449.386701] Code: c7 02 75 1f 53 9d e8 26 ab 75 ff bf 01 00 00 00 e8 7c a3 69 ff 65 8b 05 7d 9b 5c 7e 85 c0 74 0c 5b 5d c3 e8 09 aa 75 ff 53 9d <eb> df e8 ca 39 5b ff 5b 5d c3 0f 1f 00 66 2e 0f 1f 84 00 00 00 00
      <4>[  449.386703] RSP: 0018:ffffc90000a6b950 EFLAGS: 00000202 ORIG_RAX: ffffffffffffff13
      <4>[  449.386706] RAX: 0000000080000001 RBX: 0000000000000202 RCX: 0000000000000000
      <4>[  449.386708] RDX: ffff88849d5bc040 RSI: ffff88849d5bc900 RDI: ffffffff82386f12
      <4>[  449.386710] RBP: ffff88847d400f00 R08: ffff88849d5bc900 R09: 0000000000000000
      <4>[  449.386712] R10: 0000000000000000 R11: 0000000000000000 R12: 00000000ffff0b0b
      <4>[  449.386714] R13: 000000000000000c R14: ffff88847d40bf70 R15: ffff88847d40cef8
      <4>[  449.386742]  reset_csb_pointers+0x59/0x140 [i915]
      <4>[  449.386769]  execlists_sanitize+0x3e/0x60 [i915]
      <4>[  449.386797]  gt_sanitize+0xd6/0x260 [i915]
      
      As part of the reset preparation, engine->reset.prepare() prevents the
      tasklet from running, so pull the sanitization inside the critical
      section for reset.
      
      Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/1812
      Fixes: 23122a4d ("drm/i915/gt: Scrub execlists state on resume")
      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/20200513122826.27484-1-chris@chris-wilson.co.uk
      4a0ca47a
  13. 03 5月, 2020 1 次提交
  14. 27 4月, 2020 1 次提交
  15. 25 4月, 2020 1 次提交
  16. 17 4月, 2020 1 次提交
  17. 08 4月, 2020 1 次提交
  18. 17 3月, 2020 1 次提交
  19. 01 2月, 2020 1 次提交
  20. 03 1月, 2020 1 次提交
  21. 30 12月, 2019 1 次提交
  22. 26 12月, 2019 1 次提交
  23. 23 12月, 2019 1 次提交
  24. 22 12月, 2019 2 次提交
  25. 18 12月, 2019 1 次提交
  26. 14 12月, 2019 1 次提交
  27. 03 12月, 2019 1 次提交
  28. 27 11月, 2019 1 次提交
  29. 25 11月, 2019 2 次提交
  30. 21 11月, 2019 1 次提交
  31. 20 11月, 2019 2 次提交
  32. 16 11月, 2019 1 次提交
  33. 14 11月, 2019 1 次提交
    • I
      drm/i915/gen8+: Add RC6 CTX corruption WA · 2248a283
      Imre Deak 提交于
      In some circumstances the RC6 context can get corrupted. We can detect
      this and take the required action, that is disable RC6 and runtime PM.
      The HW recovers from the corrupted state after a system suspend/resume
      cycle, so detect the recovery and re-enable RC6 and runtime PM.
      
      v2: rebase (Mika)
      v3:
      - Move intel_suspend_gt_powersave() to the end of the GEM suspend
        sequence.
      - Add commit message.
      v4:
      - Rebased on intel_uncore_forcewake_put(i915->uncore, ...) API
        change.
      v5:
      - Rebased on latest upstream gt_pm refactoring.
      v6:
      - s/i915_rc6_/intel_rc6_/
      - Don't return a value from i915_rc6_ctx_wa_check().
      v7:
      - Rebased on latest gt rc6 refactoring.
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Signed-off-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      [airlied: pull this later version of this patch into drm-next
      to make resolving the conflict mess easier.]
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      2248a283
  34. 06 11月, 2019 1 次提交
    • I
      drm/i915/gen8+: Add RC6 CTX corruption WA · 7e34f4e4
      Imre Deak 提交于
      In some circumstances the RC6 context can get corrupted. We can detect
      this and take the required action, that is disable RC6 and runtime PM.
      The HW recovers from the corrupted state after a system suspend/resume
      cycle, so detect the recovery and re-enable RC6 and runtime PM.
      
      v2: rebase (Mika)
      v3:
      - Move intel_suspend_gt_powersave() to the end of the GEM suspend
        sequence.
      - Add commit message.
      v4:
      - Rebased on intel_uncore_forcewake_put(i915->uncore, ...) API
        change.
      v5: rebased on gem/gt split (Mika)
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Signed-off-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      7e34f4e4