[Intel-gfx] [PATCH] drm/i915: use in_interrupt() not in_irq() to check context

Jani Nikula jani.nikula at linux.intel.com
Tue Mar 10 02:59:47 PDT 2015


On Fri, 06 Mar 2015, Daniel Vetter <daniel at ffwll.ch> wrote:
> On Fri, Mar 06, 2015 at 03:34:26PM +0000, Dave Gordon wrote:
>> The kernel in_irq() function tests for hard-IRQ context only, so if a
>> system is run with the kernel 'threadirqs' option selected, the test in
>> intel_check_page_flip() generates lots of warnings, because then it gets
>> called in soft-IRQ context.
>> 
>> We can instead use in_interrupt() which allows for either type of
>> interrupt, while still detecting and complaining about misuse of the
>> page flip code if it is ever called from non-interrupt context.
>> 
>> Signed-off-by: Dave Gordon <david.s.gordon at intel.com>
>
> Makes sense.
>
> Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch>
> Cc: stable at vger.kernel.org

Pushed to drm-intel-fixes, thanks for the patch and review. Also added

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

BR,
Jani.

>
> Cheers, Daniel
>> ---
>>  drivers/gpu/drm/i915/intel_display.c |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
>> index 43d3575..73213a7 100644
>> --- a/drivers/gpu/drm/i915/intel_display.c
>> +++ b/drivers/gpu/drm/i915/intel_display.c
>> @@ -9817,7 +9817,7 @@ void intel_check_page_flip(struct drm_device *dev, int pipe)
>>  	struct drm_crtc *crtc = dev_priv->pipe_to_crtc_mapping[pipe];
>>  	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
>>  
>> -	WARN_ON(!in_irq());
>> +	WARN_ON(!in_interrupt());
>>  
>>  	if (crtc == NULL)
>>  		return;
>> -- 
>> 1.7.9.5
>> 
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
> -- 
> Daniel Vetter
> Software Engineer, Intel Corporation
> +41 (0) 79 365 57 48 - http://blog.ffwll.ch

-- 
Jani Nikula, Intel Open Source Technology Center


More information about the Intel-gfx mailing list