1. 14 Jan, 2022 1 commit
  2. 10 Jan, 2022 5 commits
    • Matthew Auld's avatar
      drm/i915/ttm: ensure we unmap when purging · 6ef295e3
      Matthew Auld authored
      Purging can happen during swapping out, or directly invoked with the
      madvise ioctl. In such cases this doesn't involve a ttm move, which
      skips umapping the object.
      
      v2(Thomas):
      - add ttm_truncate helper, and just call into i915_ttm_move_notify() to
        handle the unmapping step
      
      Fixes: 213d5092 ("drm/i915/ttm: Introduce a TTM i915 gem object backend")
      Signed-off-by: default avatarMatthew Auld <matthew.auld@intel.com>
      Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
      Reviewed-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20220106174910.280616-4-matthew.auld@intel.com
      (cherry picked from commit ab4911b7)
      Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      6ef295e3
    • Matthew Auld's avatar
      drm/i915/ttm: add unmap_virtual callback · 8ee262ba
      Matthew Auld authored
      Ensure we call ttm_bo_unmap_virtual when releasing the pages.
      Importantly this should now handle the ttm swapping case, and all other
      places that already call into i915_ttm_move_notify().
      
      v2: fix up the selftest
      
      Fixes: cf3e3e86 ("drm/i915: Use ttm mmap handling for ttm bo's.")
      Signed-off-by: default avatarMatthew Auld <matthew.auld@intel.com>
      Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
      Reviewed-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20220106174910.280616-3-matthew.auld@intel.com
      (cherry picked from commit 903e0387)
      Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      8ee262ba
    • Matthew Auld's avatar
      drm/i915/ttm: only fault WILLNEED objects · 03ee5956
      Matthew Auld authored
      Don't attempt to fault and re-populate purged objects. By some fluke
      this passes the dontneed-after-mmap IGT, but for the wrong reasons.
      
      Fixes: cf3e3e86 ("drm/i915: Use ttm mmap handling for ttm bo's.")
      Signed-off-by: default avatarMatthew Auld <matthew.auld@intel.com>
      Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
      Reviewed-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20220106174910.280616-2-matthew.auld@intel.com
      (cherry picked from commit f3cb4a2d)
      Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      03ee5956
    • Matthew Auld's avatar
      drm/i915: don't call free_mmap_offset when purging · 4c2602ba
      Matthew Auld authored
      The TTM backend is in theory the only user here(also purge should only
      be called once we have dropped the pages), where it is setup at object
      creation and is only removed once the object is destroyed. Also
      resetting the node here might be iffy since the ttm fault handler
      uses the stored fake offset to determine the page offset within the pages
      array.
      
      This also blows up in the dontneed-before-mmap test, since the
      expectation is that the vma_node will live on, until the object is
      destroyed:
      
      <2> [749.062902] kernel BUG at drivers/gpu/drm/i915/gem/i915_gem_ttm.c:943!
      <4> [749.062923] invalid opcode: 0000 [#1] PREEMPT SMP NOPTI
      <4> [749.062928] CPU: 0 PID: 1643 Comm: gem_madvise Tainted: G     U  W         5.16.0-rc8-CI-CI_DRM_11046+ #1
      <4> [749.062933] Hardware name: Gigabyte Technology Co., Ltd. GB-Z390 Garuda/GB-Z390 Garuda-CF, BIOS IG1c 11/19/2019
      <4> [749.062937] RIP: 0010:i915_ttm_mmap_offset.cold.35+0x5b/0x5d [i915]
      <4> [749.063044] Code: 00 48 c7 c2 a0 23 4e a0 48 c7 c7 26 df 4a a0 e8 95 1d d0 e0 bf 01 00 00 00 e8 8b ec cf e0 31 f6 bf 09 00 00 00 e8 5f 30 c0 e0 <0f> 0b 48 c7 c1 24 4b 56 a0 ba 5b 03 00 00 48 c7 c6 c0 23 4e a0 48
      <4> [749.063052] RSP: 0018:ffffc90002ab7d38 EFLAGS: 00010246
      <4> [749.063056] RAX: 0000000000000240 RBX: ffff88811f2e61c0 RCX: 0000000000000006
      <4> [749.063060] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000009
      <4> [749.063063] RBP: ffffc90002ab7e58 R08: 0000000000000001 R09: 0000000000000001
      <4> [749.063067] R10: 000000000123d0f8 R11: ffffc90002ab7b20 R12: ffff888112a1a000
      <4> [749.063071] R13: 0000000000000004 R14: ffff88811f2e61c0 R15: ffff888112a1a000
      <4> [749.063074] FS:  00007f6e5fcad500(0000) GS:ffff8884ad600000(0000) knlGS:0000000000000000
      <4> [749.063078] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      <4> [749.063081] CR2: 00007efd264e39f0 CR3: 0000000115fd6005 CR4: 00000000003706f0
      <4> [749.063085] Call Trace:
      <4> [749.063087]  <TASK>
      <4> [749.063089]  __assign_mmap_offset+0x41/0x300 [i915]
      <4> [749.063171]  __assign_mmap_offset_handle+0x159/0x270 [i915]
      <4> [749.063248]  ? i915_gem_dumb_mmap_offset+0x70/0x70 [i915]
      <4> [749.063325]  drm_ioctl_kernel+0xae/0x140
      <4> [749.063330]  drm_ioctl+0x201/0x3d0
      <4> [749.063333]  ? i915_gem_dumb_mmap_offset+0x70/0x70 [i915]
      <4> [749.063409]  ? do_user_addr_fault+0x200/0x670
      <4> [749.063415]  __x64_sys_ioctl+0x6d/0xa0
      <4> [749.063419]  do_syscall_64+0x3a/0xb0
      <4> [749.063423]  entry_SYSCALL_64_after_hwframe+0x44/0xae
      <4> [749.063428] RIP: 0033:0x7f6e5f100317
      
      Testcase: igt/gem_madvise/dontneed-before-mmap
      Fixes: cf3e3e86 ("drm/i915: Use ttm mmap handling for ttm bo's.")
      Signed-off-by: default avatarMatthew Auld <matthew.auld@intel.com>
      Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
      Reviewed-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20220106174910.280616-1-matthew.auld@intel.com
      (cherry picked from commit 658a0c63)
      Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      4c2602ba
    • Juston Li's avatar
      drm/i915/pxp: Hold RPM wakelock during PXP unbind · f9535d28
      Juston Li authored
      Similar to commit b8d84368 ("drm/i915/gt: Hold RPM wakelock during
      PXP suspend") but to fix the same warning for unbind during shutdown:
      
      ------------[ cut here ]------------
      RPM wakelock ref not held during HW access
      WARNING: CPU: 0 PID: 4139 at drivers/gpu/drm/i915/intel_runtime_pm.h:115
      gen12_fwtable_write32+0x1b7/0
      Modules linked in: 8021q ccm rfcomm cmac algif_hash algif_skcipher
      af_alg uinput snd_hda_codec_hdmi vf industrialio iwl7000_mac80211
      cros_ec_sensorhub lzo_rle lzo_compress zram iwlwifi cfg80211 joydev
      CPU: 0 PID: 4139 Comm: halt Tainted: G     U  W
      5.10.84 #13 344e11e079c4a03940d949e537eab645f6
      RIP: 0010:gen12_fwtable_write32+0x1b7/0x200
      Code: 48 c7 c7 fc b3 b5 89 31 c0 e8 2c f3 ad ff 0f 0b e9 04 ff ff ff c6
      05 71 e9 1d 01 01 48 c7 c7 d67
      RSP: 0018:ffffa09ec0bb3bb0 EFLAGS: 00010246
      RAX: 12dde97bbd260300 RBX: 00000000000320f0 RCX: ffffffff89e60ea0
      RDX: 0000000000000000 RSI: 00000000ffffdfff RDI: ffffffff89e60e70
      RBP: ffffa09ec0bb3bd8 R08: 0000000000000000 R09: ffffa09ec0bb3950
      R10: 00000000ffffdfff R11: ffffffff89e91160 R12: 0000000000000000
      R13: 0000000028121969 R14: ffff9515c32f0990 R15: 0000000040000000
      FS:  0000790dcf225740(0000) GS:ffff951737800000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 000058b25efae147 CR3: 0000000133ea6001 CR4: 0000000000770ef0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000ffff07f0 DR7: 0000000000000400
      PKRU: 55555554
      Call Trace:
       intel_pxp_fini_hw+0x2f/0x39
       i915_pxp_tee_component_unbind+0x1c/0x42
       component_unbind+0x32/0x48
       component_unbind_all+0x80/0x9d
       take_down_master+0x24/0x36
       component_master_del+0x56/0x70
       mei_pxp_remove+0x2c/0x68
       mei_cl_device_remove+0x35/0x68
       device_release_driver_internal+0x100/0x1a1
       mei_cl_bus_remove_device+0x21/0x79
       mei_cl_bus_remove_devices+0x3b/0x51
       mei_stop+0x3b/0xae
       mei_me_shutdown+0x23/0x58
       device_shutdown+0x144/0x1d3
       kernel_power_off+0x13/0x4c
       __se_sys_reboot+0x1d4/0x1e9
       do_syscall_64+0x43/0x55
       entry_SYSCALL_64_after_hwframe+0x44/0xa9
      RIP: 0033:0x790dcf316273
      Code: 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00
      00 89 fa be 69 19 12 28 bf ad8
      RSP: 002b:00007ffca0df9198 EFLAGS: 00000202 ORIG_RAX: 00000000000000a9
      RAX: ffffffffffffffda RBX: 000000004321fedc RCX: 0000790dcf316273
      RDX: 000000004321fedc RSI: 0000000028121969 RDI: 00000000fee1dead
      RBP: 00007ffca0df9200 R08: 0000000000000007 R09: 0000563ce8cd8970
      R10: 0000000000000000 R11: 0000000000000202 R12: 00007ffca0df9308
      R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000003
      ---[ end trace 2f501b01b348f114 ]---
      ACPI: Preparing to enter system sleep state S5
      reboot: Power down
      
      Changes since v1:
       - Rebase to latest drm-tip
      
      Fixes: 0cfab4cb ("drm/i915/pxp: Enable PXP power management")
      Suggested-by: default avatarLee Shawn C <shawn.c.lee@intel.com>
      Signed-off-by: default avatarJuston Li <juston.li@intel.com>
      Reviewed-by: default avatarDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
      Signed-off-by: default avatarJohn Harrison <John.C.Harrison@Intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20220106200236.489656-2-juston.li@intel.com
      (cherry picked from commit 57ded5fc)
      Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      f9535d28
  3. 31 Dec, 2021 1 commit
  4. 30 Dec, 2021 33 commits