[PATCH v2] radeon: Use mdelay() instead of msleep() when we can't sleep in atom_op_delay().

Michel Dänzer michel at daenzer.net
Wed Jan 4 02:33:40 PST 2012


From: Michel Dänzer <michel.daenzer at amd.com>

It can be the case e.g. when switching to console for panic output.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43941

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---

v2: Still call msleep() in the normal case. Only compile tested.

 drivers/gpu/drm/radeon/atom.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c
index 14cc88a..4092e59 100644
--- a/drivers/gpu/drm/radeon/atom.c
+++ b/drivers/gpu/drm/radeon/atom.c
@@ -665,6 +665,8 @@ static void atom_op_delay(atom_exec_context *ctx, int *ptr, int arg)
 	SDEBUG("   count: %d\n", count);
 	if (arg == ATOM_UNIT_MICROSEC)
 		udelay(count);
+	else if (in_interrupt() || irqs_disabled() || in_atomic())
+		mdelay(count);
 	else
 		msleep(count);
 }
-- 
1.7.7.3



More information about the dri-devel mailing list