drm/xe/pf: Reset GuC VF config when unprovisioning critical resource
authorMichal Wajdeczko <michal.wajdeczko@intel.com>
Wed, 29 Jan 2025 19:59:47 +0000 (20:59 +0100)
committerMichal Wajdeczko <michal.wajdeczko@intel.com>
Thu, 30 Jan 2025 16:10:41 +0000 (17:10 +0100)
commit33f17e2cbd930a2a00eb007d9b241b6db010a880
tree44e25bb11d225be7960b3749cecd2a1e02211684
parent21ccac0e22aaf27b767f9de4bf573e7c47f619c8
drm/xe/pf: Reset GuC VF config when unprovisioning critical resource

GuC firmware counts received VF configuration KLVs and may start
validation of the complete VF config even if some resources where
unprovisioned in the meantime, leading to unexpected errors like:

 $ echo 1 | sudo tee /sys/kernel/debug/dri/0000:00:02.0/gt0/vf1/contexts_quota
 $ echo 0 | sudo tee /sys/kernel/debug/dri/0000:00:02.0/gt0/vf1/contexts_quota
 $ echo 1 | sudo tee /sys/kernel/debug/dri/0000:00:02.0/gt0/vf1/doorbells_quota
 $ echo 0 | sudo tee /sys/kernel/debug/dri/0000:00:02.0/gt0/vf1/doorbells_quota
 $ echo 1 | sudo tee /sys/kernel/debug/dri/0000:00:02.0/gt0/vf1/ggtt_quota
 tee: '/sys/kernel/debug/dri/0000:00:02.0/gt0/vf1/ggtt_quota': Input/output error

To mitigate this problem trigger explicit VF config reset after
unprovisioning any of the critical resources (GGTT, context or
doorbell IDs) that GuC is monitoring.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: MichaƂ Winiarski <michal.winiarski@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250129195947.764-3-michal.wajdeczko@intel.com
drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c