From: Xiang Liu <[email protected]>

GPU MCE handling queues bank data directly in the MCE FIFO and only
needs to wake the RAS processing thread. Requiring a separate event
request prevents this path from scheduling processing when no event
object is available.

Permit a NULL request to skip event queue insertion while still
incrementing the interrupt request count and waking the processing
thread.

Signed-off-by: Xiang Liu <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
---
 drivers/gpu/drm/amd/ras/core/ras_process.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/ras/core/ras_process.c 
b/drivers/gpu/drm/amd/ras/core/ras_process.c
index 395d10c94b195..f313f2021f243 100644
--- a/drivers/gpu/drm/amd/ras/core/ras_process.c
+++ b/drivers/gpu/drm/amd/ras/core/ras_process.c
@@ -311,13 +311,16 @@ static int ras_process_add_non_umc_interrupt_req(struct 
ras_core_context *ras_co
        struct ras_process *ras_proc = &ras_core->ras_proc;
        int ret;
 
-       ret = ras_process_put_event(ras_core, req);
-       if (!ret) {
-               atomic_inc(&ras_proc->ras_interrupt_req);
-               wake_up(&ras_proc->ras_process_wq);
+       if (req) {
+               ret = ras_process_put_event(ras_core, req);
+               if (ret)
+                       return ret;
        }
 
-       return ret;
+       atomic_inc(&ras_proc->ras_interrupt_req);
+       wake_up(&ras_proc->ras_process_wq);
+
+       return 0;
 }
 
 int ras_process_add_interrupt_req(struct ras_core_context *ras_core,
-- 
2.55.0

Reply via email to