Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+11 -3
+11 -3
drivers/gpu/drm/xe/xe_guc.c
··· 1400 1400 return xe_guc_ct_send_block(&guc->ct, action, ARRAY_SIZE(action)); 1401 1401 } 1402 1402 1403 + #define MAX_RETRIES_ON_FLR 2 1404 + #define MIN_SLEEP_MS_ON_FLR 256 1405 + 1403 1406 int xe_guc_mmio_send_recv(struct xe_guc *guc, const u32 *request, 1404 1407 u32 len, u32 *response_buf) 1405 1408 { ··· 1413 1410 MED_VF_SW_FLAG(0) : VF_SW_FLAG(0); 1414 1411 const u32 LAST_INDEX = VF_SW_FLAG_COUNT - 1; 1415 1412 unsigned int sleep_period_ms = 1; 1416 - bool lost = false; 1413 + unsigned int lost = 0; 1417 1414 u32 header; 1418 1415 int ret; 1419 1416 int i; ··· 1449 1446 50000, &header, false); 1450 1447 if (ret) { 1451 1448 /* scratch registers might be cleared during FLR, try once more */ 1452 - if (!header && !lost) { 1449 + if (!header) { 1450 + if (++lost > MAX_RETRIES_ON_FLR) { 1451 + xe_gt_err(gt, "GuC mmio request %#x: lost, too many retries %u\n", 1452 + request[0], lost); 1453 + return -ENOLINK; 1454 + } 1453 1455 xe_gt_dbg(gt, "GuC mmio request %#x: lost, trying again\n", request[0]); 1454 - lost = true; 1456 + xe_sleep_relaxed_ms(MIN_SLEEP_MS_ON_FLR); 1455 1457 goto retry; 1456 1458 } 1457 1459 timeout: