Add gfx v11_0_3 fed irq handling for sriov.

Signed-off-by: YiPeng Chai <yipeng.c...@amd.com>
Reviewed-by: Hawking Zhang <hawking.zh...@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v11_0_3.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0_3.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0_3.c
index b07a72ca25d9..068b9586a223 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0_3.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0_3.c
@@ -62,10 +62,18 @@ static int gfx_v11_0_3_rlc_gc_fed_irq(struct amdgpu_device 
*adev,
                return -EINVAL;
        }
 
-       ih_data.head = *ras_if;
-
        dev_warn(adev->dev, "RLC %s FED IRQ\n", ras_if->name);
-       amdgpu_ras_interrupt_dispatch(adev, &ih_data);
+
+       if (!amdgpu_sriov_vf(adev)) {
+               ih_data.head = *ras_if;
+               amdgpu_ras_interrupt_dispatch(adev, &ih_data);
+       } else {
+               if (adev->virt.ops && adev->virt.ops->ras_poison_handler)
+                       adev->virt.ops->ras_poison_handler(adev);
+               else
+                       dev_warn(adev->dev,
+                               "No ras_poison_handler interface in SRIOV for 
%s!\n", ras_if->name);
+       }
 
        return 0;
 }
-- 
2.34.1

Reply via email to