summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorMichal Wajdeczko <michal.wajdeczko@intel.com>2026-01-27 20:37:26 +0100
committerMichal Wajdeczko <michal.wajdeczko@intel.com>2026-02-02 22:35:46 +0100
commit65b9886062137ad4d708045f2f4c92d06f285e8b (patch)
treeaf3e94513583d5d8e8cfc2346aee4654a8e485ea /drivers/gpu
parente116fd5c60c4950171fbe7773a34a5841a021b9f (diff)
downloadlwn-65b9886062137ad4d708045f2f4c92d06f285e8b.tar.gz
lwn-65b9886062137ad4d708045f2f4c92d06f285e8b.zip
drm/xe/guc: Allow second H2G retry on FLR
During VF FLR the scratch registers could be cleared both by the GuC and by the PF driver. Allow to retry more times once we find out that the HXG header was cleared and wait at least 256ms before resending the same message again to the GuC. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Link: https://patch.msgid.link/20260127193727.601-7-michal.wajdeczko@intel.com
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/xe/xe_guc.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/gpu/drm/xe/xe_guc.c b/drivers/gpu/drm/xe/xe_guc.c
index 6cc778e7cb57..d5910b0adbaa 100644
--- a/drivers/gpu/drm/xe/xe_guc.c
+++ b/drivers/gpu/drm/xe/xe_guc.c
@@ -1400,6 +1400,9 @@ int xe_guc_auth_huc(struct xe_guc *guc, u32 rsa_addr)
return xe_guc_ct_send_block(&guc->ct, action, ARRAY_SIZE(action));
}
+#define MAX_RETRIES_ON_FLR 2
+#define MIN_SLEEP_MS_ON_FLR 256
+
int xe_guc_mmio_send_recv(struct xe_guc *guc, const u32 *request,
u32 len, u32 *response_buf)
{
@@ -1410,7 +1413,7 @@ int xe_guc_mmio_send_recv(struct xe_guc *guc, const u32 *request,
MED_VF_SW_FLAG(0) : VF_SW_FLAG(0);
const u32 LAST_INDEX = VF_SW_FLAG_COUNT - 1;
unsigned int sleep_period_ms = 1;
- bool lost = false;
+ unsigned int lost = 0;
u32 header;
int ret;
int i;
@@ -1446,9 +1449,14 @@ retry:
50000, &header, false);
if (ret) {
/* scratch registers might be cleared during FLR, try once more */
- if (!header && !lost) {
+ if (!header) {
+ if (++lost > MAX_RETRIES_ON_FLR) {
+ xe_gt_err(gt, "GuC mmio request %#x: lost, too many retries %u\n",
+ request[0], lost);
+ return -ENOLINK;
+ }
xe_gt_dbg(gt, "GuC mmio request %#x: lost, trying again\n", request[0]);
- lost = true;
+ xe_sleep_relaxed_ms(MIN_SLEEP_MS_ON_FLR);
goto retry;
}
timeout: