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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jan 04, 2012 at 11:33:40AM +0100, Michel Dänzer wrote:
> From: Michel Dänzer <michel.daenzer@xxxxxxx>
> 
> 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@xxxxxxx>
> ---
> 
> 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);

Afaics in_atomic subsumes in_interrupt. irqs_disabled looks like a nice
addition to cover up the !CONFIG_PREEMPT case. i915 (in intel_drv.h) also
checks for in_dbg_master() to take care of kdbg.

Can I bother you to create a small helper like in_atomic_kms_context that
checks these three things (and also use it in drm/i915)?

Cheers, Daniel
-- 
Daniel Vetter
Mail: daniel@xxxxxxxx
Mobile: +41 (0)79 365 57 48
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux