mirror of
https://github.com/torvalds/linux.git
synced 2026-04-25 18:12:26 -04:00
The CI results for the 'fast request' patch set (enables error return codes for fire-and-forget H2G messages) hit an issue with the KMD sending context submission requests on an invalid context. That was caused by a fault injection probe failing the context creation of a kernel context. However, there was no return code checking on any of the kernel context registration paths. So the driver kept going and tried to use the kernel context for the record defaults process. This would not cause any actual problems. The invalid requests would be rejected by GuC and ultimately the start up sequence would correctly wedge due to the context creation failure. But fixing the issue correctly rather ignoring it means we won't get CI complaining when the fast request patch lands and enables the extra error checking. So fix it by checking for errors and aborting as appropriate when creating kernel contexts. While at it, clean up some other submission init related failure cleanup paths. Also, rename guc_init_lrc_mapping to guc_init_submission as the former name hasn't been valid in a long time. v2: Add another wrapper to keep the flow balanced (Daniele) Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230217223308.3449737-3-John.C.Harrison@Intel.com
57 lines
1.7 KiB
C
57 lines
1.7 KiB
C
/* SPDX-License-Identifier: MIT */
|
|
/*
|
|
* Copyright © 2014-2019 Intel Corporation
|
|
*/
|
|
|
|
#ifndef _INTEL_GUC_SUBMISSION_H_
|
|
#define _INTEL_GUC_SUBMISSION_H_
|
|
|
|
#include <linux/types.h>
|
|
|
|
#include "intel_guc.h"
|
|
|
|
struct drm_printer;
|
|
struct intel_engine_cs;
|
|
|
|
void intel_guc_submission_init_early(struct intel_guc *guc);
|
|
int intel_guc_submission_init(struct intel_guc *guc);
|
|
int intel_guc_submission_enable(struct intel_guc *guc);
|
|
void intel_guc_submission_disable(struct intel_guc *guc);
|
|
void intel_guc_submission_fini(struct intel_guc *guc);
|
|
int intel_guc_preempt_work_create(struct intel_guc *guc);
|
|
void intel_guc_preempt_work_destroy(struct intel_guc *guc);
|
|
int intel_guc_submission_setup(struct intel_engine_cs *engine);
|
|
void intel_guc_submission_print_info(struct intel_guc *guc,
|
|
struct drm_printer *p);
|
|
void intel_guc_submission_print_context_info(struct intel_guc *guc,
|
|
struct drm_printer *p);
|
|
void intel_guc_dump_active_requests(struct intel_engine_cs *engine,
|
|
struct i915_request *hung_rq,
|
|
struct drm_printer *m);
|
|
void intel_guc_busyness_park(struct intel_gt *gt);
|
|
void intel_guc_busyness_unpark(struct intel_gt *gt);
|
|
|
|
bool intel_guc_virtual_engine_has_heartbeat(const struct intel_engine_cs *ve);
|
|
|
|
int intel_guc_wait_for_pending_msg(struct intel_guc *guc,
|
|
atomic_t *wait_var,
|
|
bool interruptible,
|
|
long timeout);
|
|
|
|
static inline bool intel_guc_submission_is_supported(struct intel_guc *guc)
|
|
{
|
|
return guc->submission_supported;
|
|
}
|
|
|
|
static inline bool intel_guc_submission_is_wanted(struct intel_guc *guc)
|
|
{
|
|
return guc->submission_selected;
|
|
}
|
|
|
|
static inline bool intel_guc_submission_is_used(struct intel_guc *guc)
|
|
{
|
|
return intel_guc_is_used(guc) && intel_guc_submission_is_wanted(guc);
|
|
}
|
|
|
|
#endif
|