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

drm/amdgpu/virt: don't check VALID bit for FLR completion message

The interrupt after FLR is missed sometimes due to hardware reason, so
guest driver get the notification of FLR completion via polling
message. Then host doesn't write VALID bit to avoid sending interrupt,
otherwise the completion will be handled twice.

So there's a valid message without VALID bit for FLR completion,
driver should handle it without checking.

Signed-off-by: Pixel Ding <Pixel.Ding@amd.com>
Reviewed-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Pixel Ding and committed by
Alex Deucher
ee73164a ad2fed9a

+6 -3
+6 -3
drivers/gpu/drm/amd/amdgpu/mxgpu_vi.c
··· 368 368 u32 reg; 369 369 u32 mask = REG_FIELD_MASK(MAILBOX_CONTROL, RCV_MSG_VALID); 370 370 371 - reg = RREG32_NO_KIQ(mmMAILBOX_CONTROL); 372 - if (!(reg & mask)) 373 - return -ENOENT; 371 + /* workaround: host driver doesn't set VALID for CMPL now */ 372 + if (event != IDH_FLR_NOTIFICATION_CMPL) { 373 + reg = RREG32_NO_KIQ(mmMAILBOX_CONTROL); 374 + if (!(reg & mask)) 375 + return -ENOENT; 376 + } 374 377 375 378 reg = RREG32_NO_KIQ(mmMAILBOX_MSGBUF_RCV_DW0); 376 379 if (reg != event)