• Alan Previn's avatar
    drm/i915/selftest/gsc: Ensure GSC Proxy init completes before selftests · b1cef13e
    Alan Previn authored
    On MTL, if the GSC Proxy init flows haven't completed, submissions to the
    GSC engine will fail. Those init flows are dependent on the mei's
    gsc_proxy component that is loaded in parallel with i915 and a
    worker that could potentially start after i915 driver init is done.
    
    That said, all subsytems that access the GSC engine today does check
    for such init flow completion before using the GSC engine. However,
    selftests currently don't wait on anything before starting.
    
    To fix this, add a waiter function at the start of __run_selftests
    that waits for gsc-proxy init flows to complete. Selftests shouldn't
    care if the proxy-init failed as that should be flagged elsewhere.
    
    Difference from prior versions:
       v7: - Change the fw status to INTEL_UC_FIRMWARE_LOAD_FAIL if the
             proxy-init fails so that intel_gsc_uc_fw_proxy_get_status
             catches it. (Daniele)
       v6: - Add a helper that returns something more than a boolean
             so we selftest can stop waiting if proxy-init hadn't
             completed but failed (Daniele).
       v5: - Move the call to __wait_gsc_proxy_completed from common
             __run_selftests dispatcher to the group-level selftest
             function (Trvtko).
           - change the pr_info to pr_warn if we hit the timeout.
       v4: - Remove generalized waiters function table framework (Tvrtko).
           - Remove mention of CI-framework-timeout from comments (Tvrtko).
       v3: - Rebase to latest drm-tip.
       v2: - Based on internal testing, increase the timeout for gsc-proxy
             specific case to 8 seconds.
    Signed-off-by: default avatarAlan Previn <alan.previn.teres.alexis@intel.com>
    Reviewed-by: default avatarDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
    Signed-off-by: default avatarDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20230720230126.375566-1-alan.previn.teres.alexis@intel.com
    b1cef13e
i915_selftest.c 10.6 KB