diff mbox series

[V4] drm/i915/gt: Hold RPM wakelock during PXP suspend

Message ID 20211117060321.3729343-1-tejaskumarx.surendrakumar.upadhyay@intel.com (mailing list archive)
State New, archived
Headers show
Series [V4] drm/i915/gt: Hold RPM wakelock during PXP suspend | expand

Commit Message

Tejas Upadhyay Nov. 17, 2021, 6:03 a.m. UTC
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: Tejas Upadhyay <tejaskumarx.surendrakumar.upadhyay@intel.com>
---
 drivers/gpu/drm/i915/gt/intel_gt_pm.c   |  7 +++--
 drivers/gpu/drm/i915/pxp/intel_pxp_pm.c | 37 +++++++++++++++++--------
 drivers/gpu/drm/i915/pxp/intel_pxp_pm.h | 19 +++++++++++--
 3 files changed, 46 insertions(+), 17 deletions(-)

Comments

Tejas Upadhyay Nov. 18, 2021, 4:41 a.m. UTC | #1
Hi Daniele,

Would you please ack and merge the patch if it looks good? https://patchwork.freedesktop.org/series/96658/#rev3

Thanks,
Tejas


From: Patchwork <patchwork@emeril.freedesktop.org>
Sent: 17 November 2021 15:07
To: Surendrakumar Upadhyay, TejaskumarX <tejaskumarx.surendrakumar.upadhyay@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: ✓ Fi.CI.IGT: success for drm/i915/gt: Hold RPM wakelock during PXP suspend (rev3)

Patch Details
Series:
drm/i915/gt: Hold RPM wakelock during PXP suspend (rev3)
URL:
https://patchwork.freedesktop.org/series/96658/
State:
success
Details:
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/index.html
CI Bug Log - changes from CI_DRM_10888_full -> Patchwork_21610_full
Summary

SUCCESS

No regressions found.

Participating hosts (11 -> 10)

Missing (1): shard-rkl

Known issues

Here are the changes found in Patchwork_21610_full that come from known issues:

IGT changes
Issues hit

  *   igt@gem_eio@in-flight-contexts-immediate:

     *   shard-apl: PASS<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-apl2/igt@gem_eio@in-flight-contexts-immediate.html> -> TIMEOUT<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-apl6/igt@gem_eio@in-flight-contexts-immediate.html> ([i915#3063])

  *   igt@gem_exec_capture@pi@bcs0:

     *   shard-tglb: PASS<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-tglb6/igt@gem_exec_capture@pi@bcs0.html> -> INCOMPLETE<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-tglb3/igt@gem_exec_capture@pi@bcs0.html> ([i915#2369] / [i915#3371] / [i915#3731])

  *   igt@gem_exec_capture@pi@vcs0:

     *   shard-skl: NOTRUN -> INCOMPLETE<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-skl7/igt@gem_exec_capture@pi@vcs0.html> ([i915#2369])

  *   igt@gem_exec_fair@basic-flow@rcs0:

     *   shard-skl: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-skl7/igt@gem_exec_fair@basic-flow@rcs0.html> ([fdo#109271]) +30 similar issues

  *   igt@gem_exec_fair@basic-none-rrul@rcs0:

     *   shard-iclb: PASS<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-iclb7/igt@gem_exec_fair@basic-none-rrul@rcs0.html> -> FAIL<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-iclb8/igt@gem_exec_fair@basic-none-rrul@rcs0.html> ([i915#2852])

  *   igt@gem_exec_fair@basic-none-share@rcs0:

     *   shard-tglb: PASS<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-tglb8/igt@gem_exec_fair@basic-none-share@rcs0.html> -> FAIL<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-tglb3/igt@gem_exec_fair@basic-none-share@rcs0.html> ([i915#2842])

  *   igt@gem_exec_fair@basic-pace@vcs0:

     *   shard-iclb: NOTRUN -> FAIL<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-iclb5/igt@gem_exec_fair@basic-pace@vcs0.html> ([i915#2842]) +3 similar issues

  *   igt@gem_exec_fair@basic-pace@vecs0:

     *   shard-kbl: PASS<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-kbl6/igt@gem_exec_fair@basic-pace@vecs0.html> -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-kbl3/igt@gem_exec_fair@basic-pace@vecs0.html> ([fdo#109271])

  *   igt@gem_exec_suspend@basic-s0:

     *   shard-tglb: PASS<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-tglb1/igt@gem_exec_suspend@basic-s0.html> -> INCOMPLETE<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-tglb7/igt@gem_exec_suspend@basic-s0.html> ([i915#456])

  *   igt@gem_huc_copy@huc-copy:

     *   shard-tglb: PASS<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-tglb1/igt@gem_huc_copy@huc-copy.html> -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-tglb7/igt@gem_huc_copy@huc-copy.html> ([i915#2190])
     *   shard-kbl: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-kbl2/igt@gem_huc_copy@huc-copy.html> ([fdo#109271] / [i915#2190])

  *   igt@gem_media_vme:

     *   shard-tglb: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-tglb2/igt@gem_media_vme.html> ([i915#284])

  *   igt@gem_pwrite@basic-exhaustion:

     *   shard-kbl: NOTRUN -> WARN<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-kbl2/igt@gem_pwrite@basic-exhaustion.html> ([i915#2658])

  *   igt@gem_pxp@verify-pxp-stale-ctx-execution:

     *   shard-tglb: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-tglb6/igt@gem_pxp@verify-pxp-stale-ctx-execution.html> ([i915#4270]) +1 similar issue

  *   igt@gem_userptr_blits@dmabuf-unsync:

     *   shard-iclb: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-iclb5/igt@gem_userptr_blits@dmabuf-unsync.html> ([i915#3297])

  *   igt@gem_userptr_blits@input-checking:

     *   shard-skl: NOTRUN -> DMESG-WARN<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-skl7/igt@gem_userptr_blits@input-checking.html> ([i915#3002])

  *   igt@gem_workarounds@suspend-resume-context:

     *   shard-apl: PASS<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-apl2/igt@gem_workarounds@suspend-resume-context.html> -> DMESG-WARN<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-apl1/igt@gem_workarounds@suspend-resume-context.html> ([i915#180]) +3 similar issues

  *   igt@gem_workarounds@suspend-resume-fd:

     *   shard-kbl: NOTRUN -> DMESG-WARN<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-kbl3/igt@gem_workarounds@suspend-resume-fd.html> ([i915#180])

  *   igt@gen7_exec_parse@basic-allocation:

     *   shard-tglb: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-tglb5/igt@gen7_exec_parse@basic-allocation.html> ([fdo#109289])

  *   igt@gen9_exec_parse@bb-large:

     *   shard-tglb: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-tglb2/igt@gen9_exec_parse@bb-large.html> ([i915#2856]) +1 similar issue

  *   igt@i915_pm_dc@dc6-psr:

     *   shard-iclb: PASS<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-iclb1/igt@i915_pm_dc@dc6-psr.html> -> FAIL<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-iclb3/igt@i915_pm_dc@dc6-psr.html> ([i915#454])

  *   igt@i915_pm_rpm@dpms-mode-unset-non-lpsp:

     *   shard-tglb: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-tglb5/igt@i915_pm_rpm@dpms-mode-unset-non-lpsp.html> ([fdo#111644] / [i915#1397] / [i915#2411])

  *   igt@i915_selftest@perf@region:

     *   shard-tglb: PASS<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-tglb2/igt@i915_selftest@perf@region.html> -> DMESG-WARN<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-tglb8/igt@i915_selftest@perf@region.html> ([i915#2867]) +1 similar issue

  *   igt@kms_addfb_basic@size-max:

     *   shard-skl: PASS<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-skl9/igt@kms_addfb_basic@size-max.html> -> DMESG-WARN<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-skl7/igt@kms_addfb_basic@size-max.html> ([i915#1982])

  *   igt@kms_big_fb@x-tiled-16bpp-rotate-90:

     *   shard-tglb: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-tglb5/igt@kms_big_fb@x-tiled-16bpp-rotate-90.html> ([fdo#111614]) +1 similar issue

  *   igt@kms_big_fb@x-tiled-32bpp-rotate-0:

     *   shard-glk: PASS<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-glk9/igt@kms_big_fb@x-tiled-32bpp-rotate-0.html> -> DMESG-WARN<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-glk8/igt@kms_big_fb@x-tiled-32bpp-rotate-0.html> ([i915#118])

  *   igt@kms_big_fb@y-tiled-max-hw-stride-32bpp-rotate-0-hflip:

     *   shard-skl: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-skl7/igt@kms_big_fb@y-tiled-max-hw-stride-32bpp-rotate-0-hflip.html> ([fdo#109271] / [i915#3777])

  *   igt@kms_big_fb@yf-tiled-32bpp-rotate-180:

     *   shard-tglb: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-tglb5/igt@kms_big_fb@yf-tiled-32bpp-rotate-180.html> ([fdo#111615])

  *   igt@kms_ccs@pipe-a-ccs-on-another-bo-y_tiled_gen12_rc_ccs_cc:

     *   shard-iclb: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-iclb5/igt@kms_ccs@pipe-a-ccs-on-another-bo-y_tiled_gen12_rc_ccs_cc.html> ([fdo#109278] / [i915#3886])

  *   igt@kms_ccs@pipe-a-random-ccs-data-y_tiled_gen12_mc_ccs:

     *   shard-kbl: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-kbl4/igt@kms_ccs@pipe-a-random-ccs-data-y_tiled_gen12_mc_ccs.html> ([fdo#109271] / [i915#3886]) +1 similar issue

  *   igt@kms_ccs@pipe-b-ccs-on-another-bo-y_tiled_gen12_rc_ccs_cc:

     *   shard-skl: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-skl7/igt@kms_ccs@pipe-b-ccs-on-another-bo-y_tiled_gen12_rc_ccs_cc.html> ([fdo#109271] / [i915#3886]) +1 similar issue

  *   igt@kms_ccs@pipe-b-crc-sprite-planes-basic-y_tiled_gen12_mc_ccs:

     *   shard-tglb: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-tglb5/igt@kms_ccs@pipe-b-crc-sprite-planes-basic-y_tiled_gen12_mc_ccs.html> ([i915#3689] / [i915#3886]) +2 similar issues

  *   igt@kms_ccs@pipe-b-crc-sprite-planes-basic-y_tiled_gen12_rc_ccs_cc:

     *   shard-apl: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-apl8/igt@kms_ccs@pipe-b-crc-sprite-planes-basic-y_tiled_gen12_rc_ccs_cc.html> ([fdo#109271] / [i915#3886]) +6 similar issues

  *   igt@kms_ccs@pipe-d-bad-aux-stride-y_tiled_gen12_mc_ccs:

     *   shard-tglb: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-tglb5/igt@kms_ccs@pipe-d-bad-aux-stride-y_tiled_gen12_mc_ccs.html> ([i915#3689]) +1 similar issue

  *   igt@kms_ccs@pipe-d-crc-sprite-planes-basic-yf_tiled_ccs:

     *   shard-tglb: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-tglb5/igt@kms_ccs@pipe-d-crc-sprite-planes-basic-yf_tiled_ccs.html> ([fdo#111615] / [i915#3689]) +1 similar issue

  *   igt@kms_ccs@pipe-d-random-ccs-data-y_tiled_gen12_mc_ccs:

     *   shard-glk: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-glk7/igt@kms_ccs@pipe-d-random-ccs-data-y_tiled_gen12_mc_ccs.html> ([fdo#109271]) +6 similar issues

  *   igt@kms_chamelium@hdmi-edid-change-during-suspend:

     *   shard-apl: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-apl6/igt@kms_chamelium@hdmi-edid-change-during-suspend.html> ([fdo#109271] / [fdo#111827]) +7 similar issues

  *   igt@kms_color_chamelium@pipe-a-ctm-0-25:

     *   shard-tglb: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-tglb5/igt@kms_color_chamelium@pipe-a-ctm-0-25.html> ([fdo#109284] / [fdo#111827]) +2 similar issues

  *   igt@kms_color_chamelium@pipe-a-ctm-0-5:

     *   shard-skl: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-skl7/igt@kms_color_chamelium@pipe-a-ctm-0-5.html> ([fdo#109271] / [fdo#111827]) +2 similar issues

  *   igt@kms_color_chamelium@pipe-b-ctm-blue-to-red:

     *   shard-iclb: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-iclb5/igt@kms_color_chamelium@pipe-b-ctm-blue-to-red.html> ([fdo#109284] / [fdo#111827])

  *   igt@kms_color_chamelium@pipe-b-gamma:

     *   shard-glk: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-glk7/igt@kms_color_chamelium@pipe-b-gamma.html> ([fdo#109271] / [fdo#111827])

  *   igt@kms_color_chamelium@pipe-d-ctm-green-to-red:

     *   shard-iclb: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-iclb5/igt@kms_color_chamelium@pipe-d-ctm-green-to-red.html> ([fdo#109278] / [fdo#109284] / [fdo#111827])

  *   igt@kms_content_protection@content_type_change:

     *   shard-tglb: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-tglb6/igt@kms_content_protection@content_type_change.html> ([fdo#111828]) +1 similar issue

  *   igt@kms_cursor_crc@pipe-a-cursor-suspend:

     *   shard-tglb: PASS<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-tglb5/igt@kms_cursor_crc@pipe-a-cursor-suspend.html> -> INCOMPLETE<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-tglb7/igt@kms_cursor_crc@pipe-a-cursor-suspend.html> ([i915#2411] / [i915#2828] / [i915#456])

  *   igt@kms_cursor_crc@pipe-b-cursor-32x10-random:

     *   shard-kbl: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-kbl4/igt@kms_cursor_crc@pipe-b-cursor-32x10-random.html> ([fdo#109271]) +21 similar issues

  *   igt@kms_cursor_crc@pipe-c-cursor-max-size-random:

     *   shard-iclb: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-iclb5/igt@kms_cursor_crc@pipe-c-cursor-max-size-random.html> ([fdo#109278]) +5 similar issues

  *   igt@kms_cursor_crc@pipe-d-cursor-512x170-rapid-movement:

     *   shard-tglb: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-tglb5/igt@kms_cursor_crc@pipe-d-cursor-512x170-rapid-movement.html> ([i915#3359]) +5 similar issues

  *   igt@kms_cursor_legacy@pipe-d-single-bo:

     *   shard-apl: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-apl6/igt@kms_cursor_legacy@pipe-d-single-bo.html> ([fdo#109271] / [i915#533])

  *   igt@kms_flip@wf_vblank-ts-check-interruptible@a-hdmi-a1:

     *   shard-glk: PASS<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-glk3/igt@kms_flip@wf_vblank-ts-check-interruptible@a-hdmi-a1.html> -> FAIL<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-glk5/igt@kms_flip@wf_vblank-ts-check-interruptible@a-hdmi-a1.html> ([i915#2122])

  *   igt@kms_flip_scaled_crc@flip-32bpp-ytile-to-32bpp-ytilegen12rcccs:

     *   shard-apl: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-apl6/igt@kms_flip_scaled_crc@flip-32bpp-ytile-to-32bpp-ytilegen12rcccs.html> ([fdo#109271] / [i915#2672])

  *   igt@kms_flip_scaled_crc@flip-32bpp-ytileccs-to-64bpp-ytile:

     *   shard-iclb: PASS<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-iclb8/igt@kms_flip_scaled_crc@flip-32bpp-ytileccs-to-64bpp-ytile.html> -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-iclb2/igt@kms_flip_scaled_crc@flip-32bpp-ytileccs-to-64bpp-ytile.html> ([i915#3701])

  *   igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-move:

     *   shard-glk: PASS<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-glk9/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-move.html> -> FAIL<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-glk8/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-move.html> ([i915#2546])

  *   igt@kms_frontbuffer_tracking@fbcpsr-2p-scndscrn-spr-indfb-draw-mmap-gtt:

     *   shard-iclb: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-iclb5/igt@kms_frontbuffer_tracking@fbcpsr-2p-scndscrn-spr-indfb-draw-mmap-gtt.html> ([fdo#109280])

  *   igt@kms_frontbuffer_tracking@psr-2p-scndscrn-spr-indfb-draw-pwrite:

     *   shard-tglb: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-tglb5/igt@kms_frontbuffer_tracking@psr-2p-scndscrn-spr-indfb-draw-pwrite.html> ([fdo#111825]) +15 similar issues

  *   igt@kms_hdmi_inject@inject-audio:

     *   shard-tglb: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-tglb2/igt@kms_hdmi_inject@inject-audio.html> ([i915#433])

  *   igt@kms_hdr@bpc-switch-suspend:

     *   shard-kbl: PASS<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-kbl2/igt@kms_hdr@bpc-switch-suspend.html> -> DMESG-WARN<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-kbl1/igt@kms_hdr@bpc-switch-suspend.html> ([i915#180]) +8 similar issues
     *   shard-skl: PASS<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-skl7/igt@kms_hdr@bpc-switch-suspend.html> -> FAIL<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-skl4/igt@kms_hdr@bpc-switch-suspend.html> ([i915#1188])

  *   igt@kms_plane_alpha_blend@pipe-b-constant-alpha-max:

     *   shard-apl: NOTRUN -> FAIL<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-apl8/igt@kms_plane_alpha_blend@pipe-b-constant-alpha-max.html> ([fdo#108145] / [i915#265]) +1 similar issue

  *   igt@kms_plane_alpha_blend@pipe-c-coverage-7efc:

     *   shard-skl: PASS<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-skl7/igt@kms_plane_alpha_blend@pipe-c-coverage-7efc.html> -> FAIL<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-skl4/igt@kms_plane_alpha_blend@pipe-c-coverage-7efc.html> ([fdo#108145] / [i915#265])

  *   igt@kms_plane_lowres@pipe-d-tiling-x:

     *   shard-tglb: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-tglb2/igt@kms_plane_lowres@pipe-d-tiling-x.html> ([i915#3536])

  *   igt@kms_psr2_sf@overlay-plane-update-sf-dmg-area-3:

     *   shard-apl: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-apl6/igt@kms_psr2_sf@overlay-plane-update-sf-dmg-area-3.html> ([fdo#109271] / [i915#658]) +1 similar issue

  *   igt@kms_psr2_sf@primary-plane-update-sf-dmg-area-1:

     *   shard-tglb: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-tglb5/igt@kms_psr2_sf@primary-plane-update-sf-dmg-area-1.html> ([i915#2920])

  *   igt@kms_psr2_su@page_flip:

     *   shard-iclb: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-iclb5/igt@kms_psr2_su@page_flip.html> ([fdo#109642] / [fdo#111068] / [i915#658])

  *   igt@kms_psr@psr2_sprite_mmap_gtt:

     *   shard-iclb: PASS<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-iclb2/igt@kms_psr@psr2_sprite_mmap_gtt.html> -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-iclb7/igt@kms_psr@psr2_sprite_mmap_gtt.html> ([fdo#109441]) +1 similar issue

  *   igt@kms_universal_plane@universal-plane-pipe-d-functional:

     *   shard-apl: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-apl6/igt@kms_universal_plane@universal-plane-pipe-d-functional.html> ([fdo#109271]) +53 similar issues

  *   igt@kms_vblank@pipe-d-ts-continuation-suspend:

     *   shard-tglb: PASS<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-tglb3/igt@kms_vblank@pipe-d-ts-continuation-suspend.html> -> INCOMPLETE<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-tglb7/igt@kms_vblank@pipe-d-ts-continuation-suspend.html> ([i915#3896])

  *   igt@kms_vrr@flipline:

     *   shard-iclb: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-iclb5/igt@kms_vrr@flipline.html> ([fdo#109502])

  *   igt@kms_writeback@writeback-fb-id:

     *   shard-tglb: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-tglb2/igt@kms_writeback@writeback-fb-id.html> ([i915#2437])

  *   igt@perf@blocking:

     *   shard-skl: PASS<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-skl9/igt@perf@blocking.html> -> FAIL<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-skl10/igt@perf@blocking.html> ([i915#1542])

  *   igt@prime_nv_test@nv_write_i915_cpu_mmap_read:

     *   shard-iclb: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-iclb5/igt@prime_nv_test@nv_write_i915_cpu_mmap_read.html> ([fdo#109291])

  *   igt@sysfs_clients@fair-3:

     *   shard-tglb: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-tglb5/igt@sysfs_clients@fair-3.html> ([i915#2994])

  *   igt@sysfs_clients@split-50:

     *   shard-apl: NOTRUN -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-apl6/igt@sysfs_clients@split-50.html> ([fdo#109271] / [i915#2994]) +2 similar issues

Possible fixes

  *   igt@gem_eio@in-flight-suspend:

     *   shard-kbl: DMESG-WARN<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-kbl1/igt@gem_eio@in-flight-suspend.html> ([i915#180]) -> PASS<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-kbl3/igt@gem_eio@in-flight-suspend.html> +2 similar issues

  *   igt@gem_exec_whisper@basic-contexts-forked:

     *   shard-glk: DMESG-WARN<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-glk2/igt@gem_exec_whisper@basic-contexts-forked.html> ([i915#118]) -> PASS<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-glk4/igt@gem_exec_whisper@basic-contexts-forked.html> +1 similar issue

  *   igt@i915_suspend@fence-restore-tiled2untiled:

     *   shard-tglb: INCOMPLETE<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-tglb7/igt@i915_suspend@fence-restore-tiled2untiled.html> ([i915#456] / [i915#750]) -> PASS<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-tglb2/igt@i915_suspend@fence-restore-tiled2untiled.html>

  *   igt@i915_suspend@fence-restore-untiled:

     *   shard-tglb: INCOMPLETE<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-tglb7/igt@i915_suspend@fence-restore-untiled.html> ([i915#456]) -> PASS<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-tglb6/igt@i915_suspend@fence-restore-untiled.html>

  *   igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size:

     *   shard-skl: FAIL<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-skl7/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size.html> ([i915#2346] / [i915#533]) -> PASS<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-skl10/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size.html>

  *   igt@kms_fbcon_fbt@psr-suspend:

     *   shard-tglb: INCOMPLETE<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-tglb7/igt@kms_fbcon_fbt@psr-suspend.html> ([i915#2411] / [i915#456]) -> PASS<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-tglb5/igt@kms_fbcon_fbt@psr-suspend.html>

  *   igt@kms_flip@2x-flip-vs-expired-vblank@ab-hdmi-a1-hdmi-a2:

     *   shard-glk: FAIL<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-glk5/igt@kms_flip@2x-flip-vs-expired-vblank@ab-hdmi-a1-hdmi-a2.html> ([i915#2122]) -> PASS<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-glk1/igt@kms_flip@2x-flip-vs-expired-vblank@ab-hdmi-a1-hdmi-a2.html>

  *   igt@kms_flip@flip-vs-expired-vblank@a-edp1:

     *   shard-skl: FAIL<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-skl8/igt@kms_flip@flip-vs-expired-vblank@a-edp1.html> ([i915#79]) -> PASS<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-skl8/igt@kms_flip@flip-vs-expired-vblank@a-edp1.html> +2 similar issues

  *   igt@kms_flip_scaled_crc@flip-64bpp-ytile-to-32bpp-ytile:

     *   shard-iclb: SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-iclb2/igt@kms_flip_scaled_crc@flip-64bpp-ytile-to-32bpp-ytile.html> ([i915#3701]) -> PASS<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-iclb7/igt@kms_flip_scaled_crc@flip-64bpp-ytile-to-32bpp-ytile.html>

  *   igt@kms_hdr@bpc-switch-dpms:

     *   shard-skl: FAIL<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-skl4/igt@kms_hdr@bpc-switch-dpms.html> ([i915#1188]) -> PASS<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-skl9/igt@kms_hdr@bpc-switch-dpms.html>

  *   igt@kms_plane@plane-panning-bottom-right-suspend@pipe-a-planes:

     *   shard-apl: DMESG-WARN<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-apl3/igt@kms_plane@plane-panning-bottom-right-suspend@pipe-a-planes.html> ([i915#180]) -> PASS<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-apl4/igt@kms_plane@plane-panning-bottom-right-suspend@pipe-a-planes.html> +5 similar issues

  *   igt@kms_psr@psr2_cursor_mmap_cpu:

     *   shard-iclb: SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-iclb8/igt@kms_psr@psr2_cursor_mmap_cpu.html> ([fdo#109441]) -> PASS<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-iclb2/igt@kms_psr@psr2_cursor_mmap_cpu.html> +2 similar issues

  *   igt@perf@polling-small-buf:

     *   shard-skl: FAIL<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-skl10/igt@perf@polling-small-buf.html> ([i915#1722]) -> PASS<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-skl7/igt@perf@polling-small-buf.html>

  *   igt@sysfs_heartbeat_interval@mixed@rcs0:

     *   shard-skl: FAIL<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-skl10/igt@sysfs_heartbeat_interval@mixed@rcs0.html> ([i915#1731]) -> PASS<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-skl7/igt@sysfs_heartbeat_interval@mixed@rcs0.html>

Warnings

  *   igt@i915_pm_rc6_residency@rc6-fence:

     *   shard-iclb: WARN<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-iclb2/igt@i915_pm_rc6_residency@rc6-fence.html> ([i915#2684]) -> WARN<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-iclb7/igt@i915_pm_rc6_residency@rc6-fence.html> ([i915#1804] / [i915#2684])

  *   igt@kms_ccs@pipe-d-bad-rotation-90-yf_tiled_ccs:

     *   shard-tglb: SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-tglb2/igt@kms_ccs@pipe-d-bad-rotation-90-yf_tiled_ccs.html> ([i915#3689]) -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-tglb8/igt@kms_ccs@pipe-d-bad-rotation-90-yf_tiled_ccs.html> ([fdo#111615] / [i915#3689]) +27 similar issues

  *   igt@kms_plane_lowres@pipe-d-tiling-yf:

     *   shard-tglb: SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-tglb2/igt@kms_plane_lowres@pipe-d-tiling-yf.html> ([fdo#112054]) -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-tglb3/igt@kms_plane_lowres@pipe-d-tiling-yf.html> ([fdo#111615] / [fdo#112054]) +4 similar issues

  *   igt@kms_psr2_sf@plane-move-sf-dmg-area-0:

     *   shard-iclb: SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-iclb3/igt@kms_psr2_sf@plane-move-sf-dmg-area-0.html> ([i915#658]) -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-iclb2/igt@kms_psr2_sf@plane-move-sf-dmg-area-0.html> ([i915#2920]) +2 similar issues

  *   igt@kms_psr2_sf@primary-plane-update-sf-dmg-area-2:

     *   shard-iclb: SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-iclb2/igt@kms_psr2_sf@primary-plane-update-sf-dmg-area-2.html> ([i915#2920]) -> SKIP<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-iclb7/igt@kms_psr2_sf@primary-plane-update-sf-dmg-area-2.html> ([i915#658]) +1 similar issue

  *   igt@runner@aborted:

     *   shard-kbl: (FAIL<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-kbl7/igt@runner@aborted.html>, FAIL<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-kbl7/igt@runner@aborted.html>, FAIL<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-kbl7/igt@runner@aborted.html>, FAIL<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-kbl7/igt@runner@aborted.html>, FAIL<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-kbl3/igt@runner@aborted.html>, FAIL<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-kbl1/igt@runner@aborted.html>, FAIL<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-kbl1/igt@runner@aborted.html>, FAIL<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-kbl4/igt@runner@aborted.html>, FAIL<https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10888/shard-kbl1/igt@runner@aborted.html>) ([fdo#109271] / [i915#1436] / [i915#180] / [i915#1814] / [i915#3002] / [i915#3363] / [i915#4312]) -> (FAIL<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-kbl7/igt@runner@aborted.html>, FAIL<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-kbl7/igt@runner@aborted.html>, FAIL<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-kbl1/igt@runner@aborted.html>, FAIL<https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21610/shard-kbl3/igt@runner@abo>, [FAIL][146], [FAIL][147], [FAIL][148], [FAIL][149], [FAIL][150], [FAIL][151], [FAIL][152], [FAIL][153]) ([fdo#109271] / [i915#1436] / [i915#180] / [i915#1814] / [i915#3363] / [i915#4312])
Daniele Ceraolo Spurio Nov. 18, 2021, 7:35 p.m. UTC | #2
On 11/16/2021 10:03 PM, Tejas Upadhyay wrote:
> 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: Tejas Upadhyay <tejaskumarx.surendrakumar.upadhyay@intel.com>

Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>

Can you send a trybot with the PXP config enabled before we merge this, 
just to make sure the issue is gone?

Thanks,
Daniele

> ---
>   drivers/gpu/drm/i915/gt/intel_gt_pm.c   |  7 +++--
>   drivers/gpu/drm/i915/pxp/intel_pxp_pm.c | 37 +++++++++++++++++--------
>   drivers/gpu/drm/i915/pxp/intel_pxp_pm.h | 19 +++++++++++--
>   3 files changed, 46 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_gt_pm.c b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
> index b4a8594bc46c..c0fa41e4c803 100644
> --- a/drivers/gpu/drm/i915/gt/intel_gt_pm.c
> +++ b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
> @@ -303,7 +303,7 @@ void intel_gt_suspend_prepare(struct intel_gt *gt)
>   	user_forcewake(gt, true);
>   	wait_for_suspend(gt);
>   
> -	intel_pxp_suspend(&gt->pxp, false);
> +	intel_pxp_suspend_prepare(&gt->pxp);
>   }
>   
>   static suspend_state_t pm_suspend_target(void)
> @@ -328,6 +328,7 @@ void intel_gt_suspend_late(struct intel_gt *gt)
>   	GEM_BUG_ON(gt->awake);
>   
>   	intel_uc_suspend(&gt->uc);
> +	intel_pxp_suspend(&gt->pxp);
>   
>   	/*
>   	 * On disabling the device, we want to turn off HW access to memory
> @@ -355,7 +356,7 @@ void intel_gt_suspend_late(struct intel_gt *gt)
>   
>   void intel_gt_runtime_suspend(struct intel_gt *gt)
>   {
> -	intel_pxp_suspend(&gt->pxp, true);
> +	intel_pxp_runtime_suspend(&gt->pxp);
>   	intel_uc_runtime_suspend(&gt->uc);
>   
>   	GT_TRACE(gt, "\n");
> @@ -373,7 +374,7 @@ int intel_gt_runtime_resume(struct intel_gt *gt)
>   	if (ret)
>   		return ret;
>   
> -	intel_pxp_resume(&gt->pxp);
> +	intel_pxp_runtime_resume(&gt->pxp);
>   
>   	return 0;
>   }
> diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp_pm.c b/drivers/gpu/drm/i915/pxp/intel_pxp_pm.c
> index 23fd86de5a24..6a7d4e2ee138 100644
> --- a/drivers/gpu/drm/i915/pxp/intel_pxp_pm.c
> +++ b/drivers/gpu/drm/i915/pxp/intel_pxp_pm.c
> @@ -7,26 +7,29 @@
>   #include "intel_pxp_irq.h"
>   #include "intel_pxp_pm.h"
>   #include "intel_pxp_session.h"
> +#include "i915_drv.h"
>   
> -void intel_pxp_suspend(struct intel_pxp *pxp, bool runtime)
> +void intel_pxp_suspend_prepare(struct intel_pxp *pxp)
>   {
>   	if (!intel_pxp_is_enabled(pxp))
>   		return;
>   
>   	pxp->arb_is_valid = false;
>   
> -	/*
> -	 * Contexts using protected objects keep a runtime PM reference, so we
> -	 * can only runtime suspend when all of them have been either closed
> -	 * or banned. Therefore, there is no need to invalidate in that
> -	 * scenario.
> -	 */
> -	if (!runtime)
> -		intel_pxp_invalidate(pxp);
> +	intel_pxp_invalidate(pxp);
> +}
>   
> -	intel_pxp_fini_hw(pxp);
> +void intel_pxp_suspend(struct intel_pxp *pxp)
> +{
> +	intel_wakeref_t wakeref;
>   
> -	pxp->hw_state_invalidated = false;
> +	if (!intel_pxp_is_enabled(pxp))
> +		return;
> +
> +	with_intel_runtime_pm(&pxp_to_gt(pxp)->i915->runtime_pm, wakeref) {
> +		intel_pxp_fini_hw(pxp);
> +		pxp->hw_state_invalidated = false;
> +	}
>   }
>   
>   void intel_pxp_resume(struct intel_pxp *pxp)
> @@ -44,3 +47,15 @@ void intel_pxp_resume(struct intel_pxp *pxp)
>   
>   	intel_pxp_init_hw(pxp);
>   }
> +
> +void intel_pxp_runtime_suspend(struct intel_pxp *pxp)
> +{
> +	if (!intel_pxp_is_enabled(pxp))
> +		return;
> +
> +	pxp->arb_is_valid = false;
> +
> +	intel_pxp_fini_hw(pxp);
> +
> +	pxp->hw_state_invalidated = false;
> +}
> diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp_pm.h b/drivers/gpu/drm/i915/pxp/intel_pxp_pm.h
> index c89e97a0c3d0..16990a3f2f85 100644
> --- a/drivers/gpu/drm/i915/pxp/intel_pxp_pm.h
> +++ b/drivers/gpu/drm/i915/pxp/intel_pxp_pm.h
> @@ -9,16 +9,29 @@
>   #include "intel_pxp_types.h"
>   
>   #ifdef CONFIG_DRM_I915_PXP
> -void intel_pxp_suspend(struct intel_pxp *pxp, bool runtime);
> +void intel_pxp_suspend_prepare(struct intel_pxp *pxp);
> +void intel_pxp_suspend(struct intel_pxp *pxp);
>   void intel_pxp_resume(struct intel_pxp *pxp);
> +void intel_pxp_runtime_suspend(struct intel_pxp *pxp);
>   #else
> -static inline void intel_pxp_suspend(struct intel_pxp *pxp, bool runtime)
> +static inline void intel_pxp_suspend_prepare(struct intel_pxp *pxp)
> +{
> +}
> +
> +static inline void intel_pxp_suspend(struct intel_pxp *pxp)
>   {
>   }
>   
>   static inline void intel_pxp_resume(struct intel_pxp *pxp)
>   {
>   }
> -#endif
>   
> +static inline void intel_pxp_runtime_suspend(struct intel_pxp *pxp)
> +{
> +}
> +#endif
> +static inline void intel_pxp_runtime_resume(struct intel_pxp *pxp)
> +{
> +	intel_pxp_resume(pxp);
> +}
>   #endif /* __INTEL_PXP_PM_H__ */
Daniele Ceraolo Spurio Nov. 22, 2021, 4:56 p.m. UTC | #3
On 11/18/2021 11:35 AM, Daniele Ceraolo Spurio wrote:
>
>
> On 11/16/2021 10:03 PM, Tejas Upadhyay wrote:
>> 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
>>

Just realized this is also missing a fixes tag:

Fixes: 0cfab4cb3c4e ("drm/i915/pxp: Enable PXP power management")

Daniele

>> Signed-off-by: Tejas Upadhyay 
>> <tejaskumarx.surendrakumar.upadhyay@intel.com>
>
> Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
>
> Can you send a trybot with the PXP config enabled before we merge 
> this, just to make sure the issue is gone?
>
> Thanks,
> Daniele
>
>> ---
>>   drivers/gpu/drm/i915/gt/intel_gt_pm.c   |  7 +++--
>>   drivers/gpu/drm/i915/pxp/intel_pxp_pm.c | 37 +++++++++++++++++--------
>>   drivers/gpu/drm/i915/pxp/intel_pxp_pm.h | 19 +++++++++++--
>>   3 files changed, 46 insertions(+), 17 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/gt/intel_gt_pm.c 
>> b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
>> index b4a8594bc46c..c0fa41e4c803 100644
>> --- a/drivers/gpu/drm/i915/gt/intel_gt_pm.c
>> +++ b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
>> @@ -303,7 +303,7 @@ void intel_gt_suspend_prepare(struct intel_gt *gt)
>>       user_forcewake(gt, true);
>>       wait_for_suspend(gt);
>>   -    intel_pxp_suspend(&gt->pxp, false);
>> +    intel_pxp_suspend_prepare(&gt->pxp);
>>   }
>>     static suspend_state_t pm_suspend_target(void)
>> @@ -328,6 +328,7 @@ void intel_gt_suspend_late(struct intel_gt *gt)
>>       GEM_BUG_ON(gt->awake);
>>         intel_uc_suspend(&gt->uc);
>> +    intel_pxp_suspend(&gt->pxp);
>>         /*
>>        * On disabling the device, we want to turn off HW access to 
>> memory
>> @@ -355,7 +356,7 @@ void intel_gt_suspend_late(struct intel_gt *gt)
>>     void intel_gt_runtime_suspend(struct intel_gt *gt)
>>   {
>> -    intel_pxp_suspend(&gt->pxp, true);
>> +    intel_pxp_runtime_suspend(&gt->pxp);
>>       intel_uc_runtime_suspend(&gt->uc);
>>         GT_TRACE(gt, "\n");
>> @@ -373,7 +374,7 @@ int intel_gt_runtime_resume(struct intel_gt *gt)
>>       if (ret)
>>           return ret;
>>   -    intel_pxp_resume(&gt->pxp);
>> +    intel_pxp_runtime_resume(&gt->pxp);
>>         return 0;
>>   }
>> diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp_pm.c 
>> b/drivers/gpu/drm/i915/pxp/intel_pxp_pm.c
>> index 23fd86de5a24..6a7d4e2ee138 100644
>> --- a/drivers/gpu/drm/i915/pxp/intel_pxp_pm.c
>> +++ b/drivers/gpu/drm/i915/pxp/intel_pxp_pm.c
>> @@ -7,26 +7,29 @@
>>   #include "intel_pxp_irq.h"
>>   #include "intel_pxp_pm.h"
>>   #include "intel_pxp_session.h"
>> +#include "i915_drv.h"
>>   -void intel_pxp_suspend(struct intel_pxp *pxp, bool runtime)
>> +void intel_pxp_suspend_prepare(struct intel_pxp *pxp)
>>   {
>>       if (!intel_pxp_is_enabled(pxp))
>>           return;
>>         pxp->arb_is_valid = false;
>>   -    /*
>> -     * Contexts using protected objects keep a runtime PM reference, 
>> so we
>> -     * can only runtime suspend when all of them have been either 
>> closed
>> -     * or banned. Therefore, there is no need to invalidate in that
>> -     * scenario.
>> -     */
>> -    if (!runtime)
>> -        intel_pxp_invalidate(pxp);
>> +    intel_pxp_invalidate(pxp);
>> +}
>>   -    intel_pxp_fini_hw(pxp);
>> +void intel_pxp_suspend(struct intel_pxp *pxp)
>> +{
>> +    intel_wakeref_t wakeref;
>>   -    pxp->hw_state_invalidated = false;
>> +    if (!intel_pxp_is_enabled(pxp))
>> +        return;
>> +
>> + with_intel_runtime_pm(&pxp_to_gt(pxp)->i915->runtime_pm, wakeref) {
>> +        intel_pxp_fini_hw(pxp);
>> +        pxp->hw_state_invalidated = false;
>> +    }
>>   }
>>     void intel_pxp_resume(struct intel_pxp *pxp)
>> @@ -44,3 +47,15 @@ void intel_pxp_resume(struct intel_pxp *pxp)
>>         intel_pxp_init_hw(pxp);
>>   }
>> +
>> +void intel_pxp_runtime_suspend(struct intel_pxp *pxp)
>> +{
>> +    if (!intel_pxp_is_enabled(pxp))
>> +        return;
>> +
>> +    pxp->arb_is_valid = false;
>> +
>> +    intel_pxp_fini_hw(pxp);
>> +
>> +    pxp->hw_state_invalidated = false;
>> +}
>> diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp_pm.h 
>> b/drivers/gpu/drm/i915/pxp/intel_pxp_pm.h
>> index c89e97a0c3d0..16990a3f2f85 100644
>> --- a/drivers/gpu/drm/i915/pxp/intel_pxp_pm.h
>> +++ b/drivers/gpu/drm/i915/pxp/intel_pxp_pm.h
>> @@ -9,16 +9,29 @@
>>   #include "intel_pxp_types.h"
>>     #ifdef CONFIG_DRM_I915_PXP
>> -void intel_pxp_suspend(struct intel_pxp *pxp, bool runtime);
>> +void intel_pxp_suspend_prepare(struct intel_pxp *pxp);
>> +void intel_pxp_suspend(struct intel_pxp *pxp);
>>   void intel_pxp_resume(struct intel_pxp *pxp);
>> +void intel_pxp_runtime_suspend(struct intel_pxp *pxp);
>>   #else
>> -static inline void intel_pxp_suspend(struct intel_pxp *pxp, bool 
>> runtime)
>> +static inline void intel_pxp_suspend_prepare(struct intel_pxp *pxp)
>> +{
>> +}
>> +
>> +static inline void intel_pxp_suspend(struct intel_pxp *pxp)
>>   {
>>   }
>>     static inline void intel_pxp_resume(struct intel_pxp *pxp)
>>   {
>>   }
>> -#endif
>>   +static inline void intel_pxp_runtime_suspend(struct intel_pxp *pxp)
>> +{
>> +}
>> +#endif
>> +static inline void intel_pxp_runtime_resume(struct intel_pxp *pxp)
>> +{
>> +    intel_pxp_resume(pxp);
>> +}
>>   #endif /* __INTEL_PXP_PM_H__ */
>
Daniele Ceraolo Spurio Nov. 23, 2021, 9:36 p.m. UTC | #4
On 11/22/2021 8:56 AM, Daniele Ceraolo Spurio wrote:
>
>
> On 11/18/2021 11:35 AM, Daniele Ceraolo Spurio wrote:
>>
>>
>> On 11/16/2021 10:03 PM, Tejas Upadhyay wrote:
>>> 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
>>>
>
> Just realized this is also missing a fixes tag:
>
> Fixes: 0cfab4cb3c4e ("drm/i915/pxp: Enable PXP power management")
>
> Daniele
>
>>> Signed-off-by: Tejas Upadhyay 
>>> <tejaskumarx.surendrakumar.upadhyay@intel.com>
>>
>> Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
>>
>> Can you send a trybot with the PXP config enabled before we merge 
>> this, just to make sure the issue is gone?
>>

Trybot came back ok for this change, so pushed to gt-next (fixes tag 
included).

Thanks,
Daniele

>> Thanks,
>> Daniele
>>
>>> ---
>>>   drivers/gpu/drm/i915/gt/intel_gt_pm.c   |  7 +++--
>>>   drivers/gpu/drm/i915/pxp/intel_pxp_pm.c | 37 
>>> +++++++++++++++++--------
>>>   drivers/gpu/drm/i915/pxp/intel_pxp_pm.h | 19 +++++++++++--
>>>   3 files changed, 46 insertions(+), 17 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/i915/gt/intel_gt_pm.c 
>>> b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
>>> index b4a8594bc46c..c0fa41e4c803 100644
>>> --- a/drivers/gpu/drm/i915/gt/intel_gt_pm.c
>>> +++ b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
>>> @@ -303,7 +303,7 @@ void intel_gt_suspend_prepare(struct intel_gt *gt)
>>>       user_forcewake(gt, true);
>>>       wait_for_suspend(gt);
>>>   -    intel_pxp_suspend(&gt->pxp, false);
>>> +    intel_pxp_suspend_prepare(&gt->pxp);
>>>   }
>>>     static suspend_state_t pm_suspend_target(void)
>>> @@ -328,6 +328,7 @@ void intel_gt_suspend_late(struct intel_gt *gt)
>>>       GEM_BUG_ON(gt->awake);
>>>         intel_uc_suspend(&gt->uc);
>>> +    intel_pxp_suspend(&gt->pxp);
>>>         /*
>>>        * On disabling the device, we want to turn off HW access to 
>>> memory
>>> @@ -355,7 +356,7 @@ void intel_gt_suspend_late(struct intel_gt *gt)
>>>     void intel_gt_runtime_suspend(struct intel_gt *gt)
>>>   {
>>> -    intel_pxp_suspend(&gt->pxp, true);
>>> +    intel_pxp_runtime_suspend(&gt->pxp);
>>>       intel_uc_runtime_suspend(&gt->uc);
>>>         GT_TRACE(gt, "\n");
>>> @@ -373,7 +374,7 @@ int intel_gt_runtime_resume(struct intel_gt *gt)
>>>       if (ret)
>>>           return ret;
>>>   -    intel_pxp_resume(&gt->pxp);
>>> +    intel_pxp_runtime_resume(&gt->pxp);
>>>         return 0;
>>>   }
>>> diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp_pm.c 
>>> b/drivers/gpu/drm/i915/pxp/intel_pxp_pm.c
>>> index 23fd86de5a24..6a7d4e2ee138 100644
>>> --- a/drivers/gpu/drm/i915/pxp/intel_pxp_pm.c
>>> +++ b/drivers/gpu/drm/i915/pxp/intel_pxp_pm.c
>>> @@ -7,26 +7,29 @@
>>>   #include "intel_pxp_irq.h"
>>>   #include "intel_pxp_pm.h"
>>>   #include "intel_pxp_session.h"
>>> +#include "i915_drv.h"
>>>   -void intel_pxp_suspend(struct intel_pxp *pxp, bool runtime)
>>> +void intel_pxp_suspend_prepare(struct intel_pxp *pxp)
>>>   {
>>>       if (!intel_pxp_is_enabled(pxp))
>>>           return;
>>>         pxp->arb_is_valid = false;
>>>   -    /*
>>> -     * Contexts using protected objects keep a runtime PM 
>>> reference, so we
>>> -     * can only runtime suspend when all of them have been either 
>>> closed
>>> -     * or banned. Therefore, there is no need to invalidate in that
>>> -     * scenario.
>>> -     */
>>> -    if (!runtime)
>>> -        intel_pxp_invalidate(pxp);
>>> +    intel_pxp_invalidate(pxp);
>>> +}
>>>   -    intel_pxp_fini_hw(pxp);
>>> +void intel_pxp_suspend(struct intel_pxp *pxp)
>>> +{
>>> +    intel_wakeref_t wakeref;
>>>   -    pxp->hw_state_invalidated = false;
>>> +    if (!intel_pxp_is_enabled(pxp))
>>> +        return;
>>> +
>>> + with_intel_runtime_pm(&pxp_to_gt(pxp)->i915->runtime_pm, wakeref) {
>>> +        intel_pxp_fini_hw(pxp);
>>> +        pxp->hw_state_invalidated = false;
>>> +    }
>>>   }
>>>     void intel_pxp_resume(struct intel_pxp *pxp)
>>> @@ -44,3 +47,15 @@ void intel_pxp_resume(struct intel_pxp *pxp)
>>>         intel_pxp_init_hw(pxp);
>>>   }
>>> +
>>> +void intel_pxp_runtime_suspend(struct intel_pxp *pxp)
>>> +{
>>> +    if (!intel_pxp_is_enabled(pxp))
>>> +        return;
>>> +
>>> +    pxp->arb_is_valid = false;
>>> +
>>> +    intel_pxp_fini_hw(pxp);
>>> +
>>> +    pxp->hw_state_invalidated = false;
>>> +}
>>> diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp_pm.h 
>>> b/drivers/gpu/drm/i915/pxp/intel_pxp_pm.h
>>> index c89e97a0c3d0..16990a3f2f85 100644
>>> --- a/drivers/gpu/drm/i915/pxp/intel_pxp_pm.h
>>> +++ b/drivers/gpu/drm/i915/pxp/intel_pxp_pm.h
>>> @@ -9,16 +9,29 @@
>>>   #include "intel_pxp_types.h"
>>>     #ifdef CONFIG_DRM_I915_PXP
>>> -void intel_pxp_suspend(struct intel_pxp *pxp, bool runtime);
>>> +void intel_pxp_suspend_prepare(struct intel_pxp *pxp);
>>> +void intel_pxp_suspend(struct intel_pxp *pxp);
>>>   void intel_pxp_resume(struct intel_pxp *pxp);
>>> +void intel_pxp_runtime_suspend(struct intel_pxp *pxp);
>>>   #else
>>> -static inline void intel_pxp_suspend(struct intel_pxp *pxp, bool 
>>> runtime)
>>> +static inline void intel_pxp_suspend_prepare(struct intel_pxp *pxp)
>>> +{
>>> +}
>>> +
>>> +static inline void intel_pxp_suspend(struct intel_pxp *pxp)
>>>   {
>>>   }
>>>     static inline void intel_pxp_resume(struct intel_pxp *pxp)
>>>   {
>>>   }
>>> -#endif
>>>   +static inline void intel_pxp_runtime_suspend(struct intel_pxp *pxp)
>>> +{
>>> +}
>>> +#endif
>>> +static inline void intel_pxp_runtime_resume(struct intel_pxp *pxp)
>>> +{
>>> +    intel_pxp_resume(pxp);
>>> +}
>>>   #endif /* __INTEL_PXP_PM_H__ */
>>
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gt/intel_gt_pm.c b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
index b4a8594bc46c..c0fa41e4c803 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt_pm.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
@@ -303,7 +303,7 @@  void intel_gt_suspend_prepare(struct intel_gt *gt)
 	user_forcewake(gt, true);
 	wait_for_suspend(gt);
 
-	intel_pxp_suspend(&gt->pxp, false);
+	intel_pxp_suspend_prepare(&gt->pxp);
 }
 
 static suspend_state_t pm_suspend_target(void)
@@ -328,6 +328,7 @@  void intel_gt_suspend_late(struct intel_gt *gt)
 	GEM_BUG_ON(gt->awake);
 
 	intel_uc_suspend(&gt->uc);
+	intel_pxp_suspend(&gt->pxp);
 
 	/*
 	 * On disabling the device, we want to turn off HW access to memory
@@ -355,7 +356,7 @@  void intel_gt_suspend_late(struct intel_gt *gt)
 
 void intel_gt_runtime_suspend(struct intel_gt *gt)
 {
-	intel_pxp_suspend(&gt->pxp, true);
+	intel_pxp_runtime_suspend(&gt->pxp);
 	intel_uc_runtime_suspend(&gt->uc);
 
 	GT_TRACE(gt, "\n");
@@ -373,7 +374,7 @@  int intel_gt_runtime_resume(struct intel_gt *gt)
 	if (ret)
 		return ret;
 
-	intel_pxp_resume(&gt->pxp);
+	intel_pxp_runtime_resume(&gt->pxp);
 
 	return 0;
 }
diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp_pm.c b/drivers/gpu/drm/i915/pxp/intel_pxp_pm.c
index 23fd86de5a24..6a7d4e2ee138 100644
--- a/drivers/gpu/drm/i915/pxp/intel_pxp_pm.c
+++ b/drivers/gpu/drm/i915/pxp/intel_pxp_pm.c
@@ -7,26 +7,29 @@ 
 #include "intel_pxp_irq.h"
 #include "intel_pxp_pm.h"
 #include "intel_pxp_session.h"
+#include "i915_drv.h"
 
-void intel_pxp_suspend(struct intel_pxp *pxp, bool runtime)
+void intel_pxp_suspend_prepare(struct intel_pxp *pxp)
 {
 	if (!intel_pxp_is_enabled(pxp))
 		return;
 
 	pxp->arb_is_valid = false;
 
-	/*
-	 * Contexts using protected objects keep a runtime PM reference, so we
-	 * can only runtime suspend when all of them have been either closed
-	 * or banned. Therefore, there is no need to invalidate in that
-	 * scenario.
-	 */
-	if (!runtime)
-		intel_pxp_invalidate(pxp);
+	intel_pxp_invalidate(pxp);
+}
 
-	intel_pxp_fini_hw(pxp);
+void intel_pxp_suspend(struct intel_pxp *pxp)
+{
+	intel_wakeref_t wakeref;
 
-	pxp->hw_state_invalidated = false;
+	if (!intel_pxp_is_enabled(pxp))
+		return;
+
+	with_intel_runtime_pm(&pxp_to_gt(pxp)->i915->runtime_pm, wakeref) {
+		intel_pxp_fini_hw(pxp);
+		pxp->hw_state_invalidated = false;
+	}
 }
 
 void intel_pxp_resume(struct intel_pxp *pxp)
@@ -44,3 +47,15 @@  void intel_pxp_resume(struct intel_pxp *pxp)
 
 	intel_pxp_init_hw(pxp);
 }
+
+void intel_pxp_runtime_suspend(struct intel_pxp *pxp)
+{
+	if (!intel_pxp_is_enabled(pxp))
+		return;
+
+	pxp->arb_is_valid = false;
+
+	intel_pxp_fini_hw(pxp);
+
+	pxp->hw_state_invalidated = false;
+}
diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp_pm.h b/drivers/gpu/drm/i915/pxp/intel_pxp_pm.h
index c89e97a0c3d0..16990a3f2f85 100644
--- a/drivers/gpu/drm/i915/pxp/intel_pxp_pm.h
+++ b/drivers/gpu/drm/i915/pxp/intel_pxp_pm.h
@@ -9,16 +9,29 @@ 
 #include "intel_pxp_types.h"
 
 #ifdef CONFIG_DRM_I915_PXP
-void intel_pxp_suspend(struct intel_pxp *pxp, bool runtime);
+void intel_pxp_suspend_prepare(struct intel_pxp *pxp);
+void intel_pxp_suspend(struct intel_pxp *pxp);
 void intel_pxp_resume(struct intel_pxp *pxp);
+void intel_pxp_runtime_suspend(struct intel_pxp *pxp);
 #else
-static inline void intel_pxp_suspend(struct intel_pxp *pxp, bool runtime)
+static inline void intel_pxp_suspend_prepare(struct intel_pxp *pxp)
+{
+}
+
+static inline void intel_pxp_suspend(struct intel_pxp *pxp)
 {
 }
 
 static inline void intel_pxp_resume(struct intel_pxp *pxp)
 {
 }
-#endif
 
+static inline void intel_pxp_runtime_suspend(struct intel_pxp *pxp)
+{
+}
+#endif
+static inline void intel_pxp_runtime_resume(struct intel_pxp *pxp)
+{
+	intel_pxp_resume(pxp);
+}
 #endif /* __INTEL_PXP_PM_H__ */