drm/amd/display: Don't use fsleep for PSR exit waits
authorNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Wed, 27 Sep 2023 19:06:41 +0000 (15:06 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Nov 2023 10:56:20 +0000 (11:56 +0100)
[ Upstream commit 79df45dc4bfb13d9bd3a75338b9d9dab948be3d6 ]

[Why]
These functions can be called from high IRQ levels and the OS will hang
if it tries to use a usleep_highres or a msleep.

[How]
Replace the fsleep with a udelay.

Reviewed-by: Aric Cyr <aric.cyr@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c
drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c

index b87bfecb7755ae5a55c7b1f8bedc2ec7836bfb4e..a8e79104b684ea973939439d9ff50a54d9dbe619 100644 (file)
@@ -586,7 +586,8 @@ static void dcn10_dmcu_set_psr_enable(struct dmcu *dmcu, bool enable, bool wait)
                                if (state == PSR_STATE0)
                                        break;
                        }
-                       fsleep(500);
+                       /* must *not* be fsleep - this can be called from high irq levels */
+                       udelay(500);
                }
 
                /* assert if max retry hit */
index 0f24b6fbd22013a86ad8f516d256aa9c9e8643e4..4704c9c85ee6f5c964d353696a0b71b01cdbe933 100644 (file)
@@ -216,7 +216,8 @@ static void dmub_psr_enable(struct dmub_psr *dmub, bool enable, bool wait, uint8
                                        break;
                        }
 
-                       fsleep(500);
+                       /* must *not* be fsleep - this can be called from high irq levels */
+                       udelay(500);
                }
 
                /* assert if max retry hit */