Skip to contentSkip to conversation

nouveau/gsp: add a 50ms delay between fbsr and driver unload rpcs

PATCH Applied Dave Airlie 3 participants 4 messages Jul 2, 2025 – Jul 3, 2025

Subsystems (3)
lore
Share & tools
lore

Dave Airlie

author maintainer
#0 lore raw

PATCH 1/1 nouveau/gsp: add a 50ms delay between fbsr and driver unload rpcs

From: Dave Airlie <[email protected]>

This fixes a bunch of command hangs after runtime suspend/resume.

This fixes a regression caused by code movement in the commit below, the commit seems to just change timings enough to cause this to happen now, and adding the sleep seems to avoid it.

I've spent some time trying to root cause it to no great avail, it seems like a bug on the firmware side, but it could be a bug in our rpc handling that I can't find.

Either way, we should land the workaround to fix the problem, while we continue to work out the root cause.

Cc Ben Skeggs <[email protected]>
Cc Danilo Krummrich <[email protected]>
Fixes 21b039715ce9 ("drm/nouveau/gsp: add hals for fbsr.suspend/resume()")
---
 drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/gsp.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/gsp.c +3 -0
index baf42339f93e..ff362a6d9f5c 100644
@@ -1744,6 +1744,9 @@ r535_gsp_fini(struct nvkm_gsp *gsp, bool suspend)
 			nvkm_gsp_sg_free(gsp->subdev.device, &gsp->sr.sgt);
 			return ret;
 		}
+
+		/* without this Turing ends up resetting all channels after resume. */
+		msleep(50);
 	}
 
 	ret = r535_gsp_rpc_unloading_guest_driver(gsp, suspend);
Signature · 1 line
2.49.0
maintainer
#1 lore raw
Quoted 8 lines · Dave Airlie

From: Dave Airlie <[email protected]>

This fixes a bunch of command hangs after runtime suspend/resume.

This fixes a regression caused by code movement in the commit below, the commit seems to just change timings enough to cause this to happen now, and adding the sleep seems to avoid it.

Quoted 6 lines

I've spent some time trying to root cause it to no great avail, it seems like a bug on the firmware side, but it could be a bug in our rpc handling that I can't find.

Either way, we should land the workaround to fix the problem, while we continue to work out the root cause.

I think we should add a TODO above the msleep(); what do you think would be a good comment here?

I can add it when applying the patch if you want.

Quoted 22 lines
Cc Ben Skeggs <[email protected]>
Cc Danilo Krummrich <[email protected]>
Fixes 21b039715ce9 ("drm/nouveau/gsp: add hals for fbsr.suspend/resume()")
---
  drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/gsp.c | 3 +++
  1 file changed, 3 insertions(+)
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/gsp.c +3 -0
index baf42339f93e..ff362a6d9f5c 100644
@@ -1744,6 +1744,9 @@ r535_gsp_fini(struct nvkm_gsp *gsp, bool suspend)
  			nvkm_gsp_sg_free(gsp->subdev.device, &gsp->sr.sgt);
  			return ret;
  		}
+
+		/* without this Turing ends up resetting all channels after resume. */
+		msleep(50);
  	}
 
  	ret = r535_gsp_rpc_unloading_guest_driver(gsp, suspend);
#2 lore raw
Quoted 14 lines · Danilo Krummrich
Quoted 12 lines · Dave Airlie

From: Dave Airlie <[email protected]>

This fixes a bunch of command hangs after runtime suspend/resume.

This fixes a regression caused by code movement in the commit below, the commit seems to just change timings enough to cause this to happen now, and adding the sleep seems to avoid it.

I've spent some time trying to root cause it to no great avail, it seems like a bug on the firmware side, but it could be a bug in our rpc handling that I can't find.

Quoted 5 lines
Quoted 2 lines

Either way, we should land the workaround to fix the problem, while we continue to work out the root cause.

I think we should add a TODO above the msleep(); what do you think would be a good comment here?

TODO: debug the gsp firmware or the rpc handling to find out why this is happening and why it's Turing specific.

Don't really have a lot to go on,

Dave.

Quoted 26 lines

I can add it when applying the patch if you want.

Quoted 22 lines
Cc Ben Skeggs <[email protected]>
Cc Danilo Krummrich <[email protected]>
Fixes 21b039715ce9 ("drm/nouveau/gsp: add hals for fbsr.suspend/resume()")
---
  drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/gsp.c | 3 +++
  1 file changed, 3 insertions(+)
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/gsp.c +3 -0
index baf42339f93e..ff362a6d9f5c 100644
@@ -1744,6 +1744,9 @@ r535_gsp_fini(struct nvkm_gsp *gsp, bool suspend)
                      nvkm_gsp_sg_free(gsp->subdev.device, &gsp->sr.sgt);
                      return ret;
              }
+
+             /* without this Turing ends up resetting all channels after resume. */
+             msleep(50);
      }
 
      ret = r535_gsp_rpc_unloading_guest_driver(gsp, suspend);
maintainer Applied
#3 lore raw
In reply to Dave Airlie
Quoted 12 lines · Dave Airlie

From: Dave Airlie <[email protected]>

This fixes a bunch of command hangs after runtime suspend/resume.

This fixes a regression caused by code movement in the commit below, the commit seems to just change timings enough to cause this to happen now, and adding the sleep seems to avoid it.

I've spent some time trying to root cause it to no great avail, it seems like a bug on the firmware side, but it could be a bug in our rpc handling that I can't find.

Quoted 7 lines

Either way, we should land the workaround to fix the problem, while we continue to work out the root cause.

Cc Ben Skeggs <[email protected]>
Cc Danilo Krummrich <[email protected]>
Fixes 21b039715ce9 ("drm/nouveau/gsp: add hals for fbsr.suspend/resume()")

Applied to drm-misc-fixes with the following diff.

drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/gsp.c +5 -1
index ff362a6d9f5c..23f80e167705 100644
@@ -1745,7 +1745,11 @@ r535_gsp_fini(struct nvkm_gsp *gsp, bool suspend)
                        return ret;
                }
 
-               /* without this Turing ends up resetting all channels after resume. */
+               /*
+                * TODO: Debug the GSP firmware / RPC handling to find out why
+                * without this Turing (but none of the other architectures)
+                * ends up resetting all channels after resume.
+                */
                msleep(50);
        }
 

I also changed the 'Fixes' tag to:

Fixes c21b039715ce ("drm/nouveau/gsp: add hals for fbsr.suspend/resume()")