diff mbox series

[CI,1/2] drm/i915/guc: Enable guc logging on guc log relay write

Message ID 20190920170444.10192-1-robert.m.fosha@intel.com (mailing list archive)
State New, archived
Headers show
Series [CI,1/2] drm/i915/guc: Enable guc logging on guc log relay write | expand

Commit Message

Fosha, Robert M Sept. 20, 2019, 5:04 p.m. UTC
Creating and opening the GuC log relay file enables and starts
the relay potentially before the caller is ready to consume logs.
Change the behavior so that relay starts only on an explicit call
to the write function (with a value of '1'). Other values flush
the log relay as before.

v2: Style changes and fix typos. Add guc_log_relay_stop()
function. (Daniele)

Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Signed-off-by: Robert M. Fosha <robert.m.fosha@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
---
 drivers/gpu/drm/i915/gt/uc/intel_guc_log.c | 53 +++++++++++++++++-----
 drivers/gpu/drm/i915/gt/uc/intel_guc_log.h |  4 +-
 drivers/gpu/drm/i915/i915_debugfs.c        | 22 +++++++--
 3 files changed, 62 insertions(+), 17 deletions(-)

Comments

Fosha, Robert M Sept. 25, 2019, 8:59 p.m. UTC | #1
On 9/21/19 4:00 PM, Patchwork wrote:
> == Series Details ==
>
> Series: series starting with [CI,1/2] drm/i915/guc: Enable guc logging on guc log relay write
> URL   : https://patchwork.freedesktop.org/series/67009/
> State : failure
>
> == Summary ==
>
> CI Bug Log - changes from CI_DRM_6929_full -> Patchwork_14480_full
> ====================================================
>
> Summary
> -------
>
>    **FAILURE**
>
>    Serious unknown changes coming with Patchwork_14480_full absolutely need to be
>    verified manually.
>    
>    If you think the reported changes have nothing to do with the changes
>    introduced in Patchwork_14480_full, please notify your bug team to allow them
>    to document this new failure mode, which will reduce false positives in CI.
>
>    
>
> Possible new issues
> -------------------
>
>    Here are the unknown changes that may have been introduced in Patchwork_14480_full:
>
> ### IGT changes ###
>
> #### Possible regressions ####
>
>    * igt@i915_pm_rc6_residency@rc6-accuracy:
>      - shard-iclb:         [PASS][1] -> [SKIP][2]
>     [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-iclb8/igt@i915_pm_rc6_residency@rc6-accuracy.html
>     [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-iclb3/igt@i915_pm_rc6_residency@rc6-accuracy.html
Have looked and seen that this behavior (test is skipped) has occurred 
for other patches.
Appears to be sporadic and unrelated to this patch, so I think this 
patch should be safe to merge.

>    
> #### Suppressed ####
>
>    The following results come from untrusted machines, tests, or statuses.
>    They do not affect the overall result.
>
>    * {igt@i915_pm_dc@dc6-dpms}:
>      - shard-iclb:         [PASS][3] -> [FAIL][4]
>     [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-iclb2/igt@i915_pm_dc@dc6-dpms.html
>     [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-iclb3/igt@i915_pm_dc@dc6-dpms.html
>
>    
> Known issues
> ------------
>
>    Here are the changes found in Patchwork_14480_full that come from known issues:
>
> ### IGT changes ###
>
> #### Issues hit ####
>
>    * igt@gem_ctx_isolation@bcs0-s3:
>      - shard-apl:          [PASS][5] -> [DMESG-WARN][6] ([fdo#108566]) +8 similar issues
>     [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-apl2/igt@gem_ctx_isolation@bcs0-s3.html
>     [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-apl6/igt@gem_ctx_isolation@bcs0-s3.html
>
>    * igt@gem_eio@in-flight-contexts-immediate:
>      - shard-hsw:          [PASS][7] -> [FAIL][8] ([fdo#105957])
>     [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-hsw5/igt@gem_eio@in-flight-contexts-immediate.html
>     [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-hsw1/igt@gem_eio@in-flight-contexts-immediate.html
>
>    * igt@gem_exec_balancer@smoke:
>      - shard-iclb:         [PASS][9] -> [SKIP][10] ([fdo#110854])
>     [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-iclb1/igt@gem_exec_balancer@smoke.html
>     [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-iclb3/igt@gem_exec_balancer@smoke.html
>
>    * igt@gem_exec_schedule@wide-bsd:
>      - shard-iclb:         [PASS][11] -> [SKIP][12] ([fdo#111325]) +6 similar issues
>     [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-iclb6/igt@gem_exec_schedule@wide-bsd.html
>     [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-iclb2/igt@gem_exec_schedule@wide-bsd.html
>
>    * igt@i915_pm_rc6_residency@rc6-accuracy:
>      - shard-apl:          [PASS][13] -> [SKIP][14] ([fdo#109271])
>     [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-apl2/igt@i915_pm_rc6_residency@rc6-accuracy.html
>     [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-apl6/igt@i915_pm_rc6_residency@rc6-accuracy.html
>      - shard-glk:          [PASS][15] -> [SKIP][16] ([fdo#109271])
>     [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-glk1/igt@i915_pm_rc6_residency@rc6-accuracy.html
>     [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-glk1/igt@i915_pm_rc6_residency@rc6-accuracy.html
>      - shard-kbl:          [PASS][17] -> [SKIP][18] ([fdo#109271])
>     [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-kbl7/igt@i915_pm_rc6_residency@rc6-accuracy.html
>     [18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-kbl1/igt@i915_pm_rc6_residency@rc6-accuracy.html
>      - shard-skl:          [PASS][19] -> [SKIP][20] ([fdo#109271])
>     [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-skl8/igt@i915_pm_rc6_residency@rc6-accuracy.html
>     [20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-skl5/igt@i915_pm_rc6_residency@rc6-accuracy.html
>
>    * igt@i915_suspend@fence-restore-untiled:
>      - shard-kbl:          [PASS][21] -> [DMESG-WARN][22] ([fdo#103313])
>     [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-kbl7/igt@i915_suspend@fence-restore-untiled.html
>     [22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-kbl2/igt@i915_suspend@fence-restore-untiled.html
>
>    * igt@kms_cursor_crc@pipe-a-cursor-suspend:
>      - shard-kbl:          [PASS][23] -> [DMESG-WARN][24] ([fdo#108566]) +8 similar issues
>     [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-kbl6/igt@kms_cursor_crc@pipe-a-cursor-suspend.html
>     [24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-kbl6/igt@kms_cursor_crc@pipe-a-cursor-suspend.html
>
>    * igt@kms_cursor_legacy@2x-long-cursor-vs-flip-legacy:
>      - shard-hsw:          [PASS][25] -> [FAIL][26] ([fdo#105767])
>     [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-hsw5/igt@kms_cursor_legacy@2x-long-cursor-vs-flip-legacy.html
>     [26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-hsw6/igt@kms_cursor_legacy@2x-long-cursor-vs-flip-legacy.html
>
>    * igt@kms_cursor_legacy@pipe-c-forked-bo:
>      - shard-apl:          [PASS][27] -> [INCOMPLETE][28] ([fdo#103927]) +4 similar issues
>     [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-apl4/igt@kms_cursor_legacy@pipe-c-forked-bo.html
>     [28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-apl4/igt@kms_cursor_legacy@pipe-c-forked-bo.html
>
>    * igt@kms_flip@nonexisting-fb-interruptible:
>      - shard-iclb:         [PASS][29] -> [INCOMPLETE][30] ([fdo#107713])
>     [29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-iclb4/igt@kms_flip@nonexisting-fb-interruptible.html
>     [30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-iclb1/igt@kms_flip@nonexisting-fb-interruptible.html
>
>    * igt@kms_frontbuffer_tracking@fbc-1p-pri-indfb-multidraw:
>      - shard-iclb:         [PASS][31] -> [FAIL][32] ([fdo#103167]) +4 similar issues
>     [31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-iclb5/igt@kms_frontbuffer_tracking@fbc-1p-pri-indfb-multidraw.html
>     [32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-iclb1/igt@kms_frontbuffer_tracking@fbc-1p-pri-indfb-multidraw.html
>
>    * igt@kms_psr2_su@frontbuffer:
>      - shard-iclb:         [PASS][33] -> [SKIP][34] ([fdo#109642] / [fdo#111068])
>     [33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-iclb2/igt@kms_psr2_su@frontbuffer.html
>     [34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-iclb1/igt@kms_psr2_su@frontbuffer.html
>
>    * igt@kms_psr@psr2_cursor_render:
>      - shard-iclb:         [PASS][35] -> [SKIP][36] ([fdo#109441]) +2 similar issues
>     [35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-iclb2/igt@kms_psr@psr2_cursor_render.html
>     [36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-iclb3/igt@kms_psr@psr2_cursor_render.html
>
>    * igt@kms_vblank@pipe-a-ts-continuation-suspend:
>      - shard-skl:          [PASS][37] -> [INCOMPLETE][38] ([fdo#104108])
>     [37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-skl1/igt@kms_vblank@pipe-a-ts-continuation-suspend.html
>     [38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-skl1/igt@kms_vblank@pipe-a-ts-continuation-suspend.html
>
>    * igt@prime_busy@after-bsd2:
>      - shard-iclb:         [PASS][39] -> [SKIP][40] ([fdo#109276]) +15 similar issues
>     [39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-iclb2/igt@prime_busy@after-bsd2.html
>     [40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-iclb3/igt@prime_busy@after-bsd2.html
>
>    
> #### Possible fixes ####
>
>    * igt@gem_eio@reset-stress:
>      - shard-snb:          [FAIL][41] ([fdo#109661]) -> [PASS][42]
>     [41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-snb6/igt@gem_eio@reset-stress.html
>     [42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-snb7/igt@gem_eio@reset-stress.html
>
>    * igt@gem_exec_schedule@reorder-wide-bsd:
>      - shard-iclb:         [SKIP][43] ([fdo#111325]) -> [PASS][44] +3 similar issues
>     [43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-iclb1/igt@gem_exec_schedule@reorder-wide-bsd.html
>     [44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-iclb6/igt@gem_exec_schedule@reorder-wide-bsd.html
>
>    * igt@gem_exec_suspend@basic:
>      - shard-iclb:         [FAIL][45] ([fdo#111699]) -> [PASS][46]
>     [45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-iclb3/igt@gem_exec_suspend@basic.html
>     [46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-iclb5/igt@gem_exec_suspend@basic.html
>
>    * igt@gem_tiled_swapping@non-threaded:
>      - shard-apl:          [DMESG-WARN][47] ([fdo#108686]) -> [PASS][48]
>     [47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-apl4/igt@gem_tiled_swapping@non-threaded.html
>     [48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-apl1/igt@gem_tiled_swapping@non-threaded.html
>
>    * igt@gem_workarounds@suspend-resume-context:
>      - shard-skl:          [INCOMPLETE][49] ([fdo#104108]) -> [PASS][50]
>     [49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-skl6/igt@gem_workarounds@suspend-resume-context.html
>     [50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-skl3/igt@gem_workarounds@suspend-resume-context.html
>
>    * {igt@i915_pm_dc@dc6-psr}:
>      - shard-iclb:         [FAIL][51] -> [PASS][52]
>     [51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-iclb6/igt@i915_pm_dc@dc6-psr.html
>     [52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-iclb2/igt@i915_pm_dc@dc6-psr.html
>
>    * igt@kms_big_fb@x-tiled-32bpp-rotate-180:
>      - shard-kbl:          [DMESG-WARN][53] ([fdo#105604] / [fdo#105763]) -> [PASS][54]
>     [53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-kbl6/igt@kms_big_fb@x-tiled-32bpp-rotate-180.html
>     [54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-kbl6/igt@kms_big_fb@x-tiled-32bpp-rotate-180.html
>
>    * igt@kms_cursor_legacy@cursor-vs-flip-legacy:
>      - shard-hsw:          [FAIL][55] ([fdo#103355]) -> [PASS][56]
>     [55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-hsw1/igt@kms_cursor_legacy@cursor-vs-flip-legacy.html
>     [56]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-hsw1/igt@kms_cursor_legacy@cursor-vs-flip-legacy.html
>
>    * igt@kms_flip@flip-vs-expired-vblank:
>      - shard-skl:          [FAIL][57] ([fdo#105363]) -> [PASS][58] +1 similar issue
>     [57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-skl8/igt@kms_flip@flip-vs-expired-vblank.html
>     [58]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-skl8/igt@kms_flip@flip-vs-expired-vblank.html
>
>    * igt@kms_frontbuffer_tracking@fbc-suspend:
>      - shard-apl:          [DMESG-WARN][59] ([fdo#108566]) -> [PASS][60]
>     [59]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-apl7/igt@kms_frontbuffer_tracking@fbc-suspend.html
>     [60]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-apl8/igt@kms_frontbuffer_tracking@fbc-suspend.html
>
>    * igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-move:
>      - shard-iclb:         [FAIL][61] ([fdo#103167]) -> [PASS][62] +2 similar issues
>     [61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-iclb6/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-move.html
>     [62]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-iclb5/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-move.html
>
>    * igt@kms_plane_lowres@pipe-a-tiling-y:
>      - shard-iclb:         [FAIL][63] ([fdo#103166]) -> [PASS][64]
>     [63]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-iclb6/igt@kms_plane_lowres@pipe-a-tiling-y.html
>     [64]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-iclb5/igt@kms_plane_lowres@pipe-a-tiling-y.html
>
>    * igt@kms_psr@no_drrs:
>      - shard-iclb:         [FAIL][65] ([fdo#108341]) -> [PASS][66]
>     [65]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-iclb1/igt@kms_psr@no_drrs.html
>     [66]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-iclb6/igt@kms_psr@no_drrs.html
>
>    * igt@kms_psr@psr2_suspend:
>      - shard-iclb:         [SKIP][67] ([fdo#109441]) -> [PASS][68] +3 similar issues
>     [67]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-iclb6/igt@kms_psr@psr2_suspend.html
>     [68]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-iclb2/igt@kms_psr@psr2_suspend.html
>
>    * igt@kms_setmode@basic:
>      - shard-apl:          [FAIL][69] ([fdo#99912]) -> [PASS][70]
>     [69]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-apl2/igt@kms_setmode@basic.html
>     [70]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-apl6/igt@kms_setmode@basic.html
>      - shard-kbl:          [FAIL][71] ([fdo#99912]) -> [PASS][72]
>     [71]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-kbl4/igt@kms_setmode@basic.html
>     [72]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-kbl3/igt@kms_setmode@basic.html
>
>    * igt@kms_vblank@pipe-a-ts-continuation-suspend:
>      - shard-kbl:          [INCOMPLETE][73] ([fdo#103665]) -> [PASS][74] +1 similar issue
>     [73]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-kbl4/igt@kms_vblank@pipe-a-ts-continuation-suspend.html
>     [74]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-kbl1/igt@kms_vblank@pipe-a-ts-continuation-suspend.html
>
>    * igt@perf_pmu@cpu-hotplug:
>      - shard-kbl:          [TIMEOUT][75] ([fdo#111546]) -> [PASS][76]
>     [75]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-kbl3/igt@perf_pmu@cpu-hotplug.html
>     [76]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-kbl3/igt@perf_pmu@cpu-hotplug.html
>
>    * igt@prime_vgem@fence-wait-bsd2:
>      - shard-iclb:         [SKIP][77] ([fdo#109276]) -> [PASS][78] +17 similar issues
>     [77]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-iclb6/igt@prime_vgem@fence-wait-bsd2.html
>     [78]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-iclb2/igt@prime_vgem@fence-wait-bsd2.html
>
>    
> #### Warnings ####
>
>    * igt@gem_mocs_settings@mocs-settings-bsd2:
>      - shard-iclb:         [SKIP][79] ([fdo#109276]) -> [FAIL][80] ([fdo#111330])
>     [79]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-iclb8/igt@gem_mocs_settings@mocs-settings-bsd2.html
>     [80]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-iclb2/igt@gem_mocs_settings@mocs-settings-bsd2.html
>
>    * igt@kms_big_fb@linear-64bpp-rotate-0:
>      - shard-kbl:          [TIMEOUT][81] -> [SKIP][82] ([fdo#109271])
>     [81]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6929/shard-kbl3/igt@kms_big_fb@linear-64bpp-rotate-0.html
>     [82]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/shard-kbl3/igt@kms_big_fb@linear-64bpp-rotate-0.html
>
>    
>    {name}: This element is suppressed. This means it is ignored when computing
>            the status of the difference (SUCCESS, WARNING, or FAILURE).
>
>    [fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
>    [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
>    [fdo#103313]: https://bugs.freedesktop.org/show_bug.cgi?id=103313
>    [fdo#103355]: https://bugs.freedesktop.org/show_bug.cgi?id=103355
>    [fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
>    [fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
>    [fdo#104108]: https://bugs.freedesktop.org/show_bug.cgi?id=104108
>    [fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
>    [fdo#105604]: https://bugs.freedesktop.org/show_bug.cgi?id=105604
>    [fdo#105763]: https://bugs.freedesktop.org/show_bug.cgi?id=105763
>    [fdo#105767]: https://bugs.freedesktop.org/show_bug.cgi?id=105767
>    [fdo#105957]: https://bugs.freedesktop.org/show_bug.cgi?id=105957
>    [fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
>    [fdo#108341]: https://bugs.freedesktop.org/show_bug.cgi?id=108341
>    [fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
>    [fdo#108686]: https://bugs.freedesktop.org/show_bug.cgi?id=108686
>    [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
>    [fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
>    [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
>    [fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
>    [fdo#109661]: https://bugs.freedesktop.org/show_bug.cgi?id=109661
>    [fdo#110854]: https://bugs.freedesktop.org/show_bug.cgi?id=110854
>    [fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
>    [fdo#111325]: https://bugs.freedesktop.org/show_bug.cgi?id=111325
>    [fdo#111330]: https://bugs.freedesktop.org/show_bug.cgi?id=111330
>    [fdo#111546]: https://bugs.freedesktop.org/show_bug.cgi?id=111546
>    [fdo#111699]: https://bugs.freedesktop.org/show_bug.cgi?id=111699
>    [fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912
>
>
> Participating hosts (9 -> 9)
> ------------------------------
>
>    No changes in participating hosts
>
>
> Build changes
> -------------
>
>    * CI: CI-20190529 -> None
>    * Linux: CI_DRM_6929 -> Patchwork_14480
>
>    CI-20190529: 20190529
>    CI_DRM_6929: fceeceeb45e97b2e6e635c0e4459e4217f9f35a4 @ git://anongit.freedesktop.org/gfx-ci/linux
>    IGT_5195: ea29372bb4e261a0a8da371a1f434131750f18e0 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
>    Patchwork_14480: b1abc3243ba9e19d46a9eb0b431de8d8a31b997e @ git://anongit.freedesktop.org/gfx-ci/linux
>    piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
>
> == Logs ==
>
> For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14480/
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
index 36332064de9c..e26c7748358b 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
@@ -226,7 +226,7 @@  static void guc_read_update_log_buffer(struct intel_guc_log *log)
 
 	mutex_lock(&log->relay.lock);
 
-	if (WARN_ON(!intel_guc_log_relay_enabled(log)))
+	if (WARN_ON(!intel_guc_log_relay_created(log)))
 		goto out_unlock;
 
 	/* Get the pointer to shared GuC log buffer */
@@ -361,6 +361,7 @@  void intel_guc_log_init_early(struct intel_guc_log *log)
 {
 	mutex_init(&log->relay.lock);
 	INIT_WORK(&log->relay.flush_work, capture_logs_work);
+	log->relay.started = false;
 }
 
 static int guc_log_relay_create(struct intel_guc_log *log)
@@ -546,7 +547,7 @@  int intel_guc_log_set_level(struct intel_guc_log *log, u32 level)
 	return ret;
 }
 
-bool intel_guc_log_relay_enabled(const struct intel_guc_log *log)
+bool intel_guc_log_relay_created(const struct intel_guc_log *log)
 {
 	return log->relay.buf_addr;
 }
@@ -560,7 +561,7 @@  int intel_guc_log_relay_open(struct intel_guc_log *log)
 
 	mutex_lock(&log->relay.lock);
 
-	if (intel_guc_log_relay_enabled(log)) {
+	if (intel_guc_log_relay_created(log)) {
 		ret = -EEXIST;
 		goto out_unlock;
 	}
@@ -585,6 +586,21 @@  int intel_guc_log_relay_open(struct intel_guc_log *log)
 
 	mutex_unlock(&log->relay.lock);
 
+	return 0;
+
+out_relay:
+	guc_log_relay_destroy(log);
+out_unlock:
+	mutex_unlock(&log->relay.lock);
+
+	return ret;
+}
+
+int intel_guc_log_relay_start(struct intel_guc_log *log)
+{
+	if (log->relay.started)
+		return -EEXIST;
+
 	guc_log_enable_flush_events(log);
 
 	/*
@@ -594,14 +610,9 @@  int intel_guc_log_relay_open(struct intel_guc_log *log)
 	 */
 	queue_work(system_highpri_wq, &log->relay.flush_work);
 
-	return 0;
-
-out_relay:
-	guc_log_relay_destroy(log);
-out_unlock:
-	mutex_unlock(&log->relay.lock);
+	log->relay.started = true;
 
-	return ret;
+	return 0;
 }
 
 void intel_guc_log_relay_flush(struct intel_guc_log *log)
@@ -610,6 +621,9 @@  void intel_guc_log_relay_flush(struct intel_guc_log *log)
 	struct drm_i915_private *i915 = guc_to_gt(guc)->i915;
 	intel_wakeref_t wakeref;
 
+	if (!log->relay.started)
+		return;
+
 	/*
 	 * Before initiating the forceful flush, wait for any pending/ongoing
 	 * flush to complete otherwise forceful flush may not actually happen.
@@ -623,18 +637,33 @@  void intel_guc_log_relay_flush(struct intel_guc_log *log)
 	guc_log_capture_logs(log);
 }
 
-void intel_guc_log_relay_close(struct intel_guc_log *log)
+/*
+ * Stops the relay log. Called from intel_guc_log_relay_close(), so no
+ * possibility of race with start/flush since relay_write cannot race
+ * relay_close.
+ */
+static void guc_log_relay_stop(struct intel_guc_log *log)
 {
 	struct intel_guc *guc = log_to_guc(log);
 	struct drm_i915_private *i915 = guc_to_gt(guc)->i915;
 
+	if (!log->relay.started)
+		return;
+
 	guc_log_disable_flush_events(log);
 	intel_synchronize_irq(i915);
 
 	flush_work(&log->relay.flush_work);
 
+	log->relay.started = false;
+}
+
+void intel_guc_log_relay_close(struct intel_guc_log *log)
+{
+	guc_log_relay_stop(log);
+
 	mutex_lock(&log->relay.lock);
-	GEM_BUG_ON(!intel_guc_log_relay_enabled(log));
+	GEM_BUG_ON(!intel_guc_log_relay_created(log));
 	guc_log_unmap(log);
 	guc_log_relay_destroy(log);
 	mutex_unlock(&log->relay.lock);
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.h b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.h
index 6f764879acb1..c252c022c5fc 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.h
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.h
@@ -47,6 +47,7 @@  struct intel_guc_log {
 	struct i915_vma *vma;
 	struct {
 		void *buf_addr;
+		bool started;
 		struct work_struct flush_work;
 		struct rchan *channel;
 		struct mutex lock;
@@ -65,8 +66,9 @@  int intel_guc_log_create(struct intel_guc_log *log);
 void intel_guc_log_destroy(struct intel_guc_log *log);
 
 int intel_guc_log_set_level(struct intel_guc_log *log, u32 level);
-bool intel_guc_log_relay_enabled(const struct intel_guc_log *log);
+bool intel_guc_log_relay_created(const struct intel_guc_log *log);
 int intel_guc_log_relay_open(struct intel_guc_log *log);
+int intel_guc_log_relay_start(struct intel_guc_log *log);
 void intel_guc_log_relay_flush(struct intel_guc_log *log);
 void intel_guc_log_relay_close(struct intel_guc_log *log);
 
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 43db50095257..3f86f2b60b92 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1871,8 +1871,8 @@  static void i915_guc_log_info(struct seq_file *m,
 	struct intel_guc_log *log = &dev_priv->gt.uc.guc.log;
 	enum guc_log_buffer_type type;
 
-	if (!intel_guc_log_relay_enabled(log)) {
-		seq_puts(m, "GuC log relay disabled\n");
+	if (!intel_guc_log_relay_created(log)) {
+		seq_puts(m, "GuC log relay not created\n");
 		return;
 	}
 
@@ -2059,9 +2059,23 @@  i915_guc_log_relay_write(struct file *filp,
 			 loff_t *ppos)
 {
 	struct intel_guc_log *log = filp->private_data;
+	int val;
+	int ret;
 
-	intel_guc_log_relay_flush(log);
-	return cnt;
+	ret = kstrtoint_from_user(ubuf, cnt, 0, &val);
+	if (ret < 0)
+		return ret;
+
+	/*
+	 * Enable and start the guc log relay on value of 1.
+	 * Flush log relay for any other value.
+	 */
+	if (val == 1)
+		ret = intel_guc_log_relay_start(log);
+	else
+		intel_guc_log_relay_flush(log);
+
+	return ret ?: cnt;
 }
 
 static int i915_guc_log_relay_release(struct inode *inode, struct file *file)