diff mbox

drm/i915: use in_interrupt() not in_irq() to check context

Message ID 1425656066-2913-1-git-send-email-david.s.gordon@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Dave Gordon March 6, 2015, 3:34 p.m. UTC
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@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Daniel Vetter March 6, 2015, 4:46 p.m. UTC | #1
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@intel.com>

Makes sense.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: stable@vger.kernel.org

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@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Shuang He March 6, 2015, 8:20 p.m. UTC | #2
Tested-By: PRC QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com)
Task id: 5907
-------------------------------------Summary-------------------------------------
Platform          Delta          drm-intel-nightly          Series Applied
PNV                 -4              275/275              271/275
ILK                                  307/307              307/307
SNB                 -1              284/284              283/284
IVB                                  375/375              375/375
BYT                                  294/294              294/294
HSW                 -1              385/385              384/385
BDW                 -1              314/314              313/314
-------------------------------------Detailed-------------------------------------
Platform  Test                                drm-intel-nightly          Series Applied
*PNV  igt_gem_fence_thrash_bo-write-verify-none      PASS(3)      FAIL(1)PASS(1)
*PNV  igt_gem_fence_thrash_bo-write-verify-x      PASS(3)      FAIL(1)PASS(1)
*PNV  igt_gem_fence_thrash_bo-write-verify-y      PASS(3)      FAIL(1)PASS(1)
 PNV  igt_gen3_render_tiledx_blits      FAIL(1)PASS(5)      FAIL(1)PASS(1)
*SNB  igt_gem_fence_thrash_bo-write-verify-none      PASS(2)      DMESG_WARN(1)PASS(1)
*HSW  igt_pm_rpm_reg-read-ioctl      PASS(2)      DMESG_FAIL(1)PASS(1)
*BDW  igt_gem_gtt_hog      PASS(4)      DMESG_WARN(1)PASS(1)
Note: You need to pay more attention to line start with '*'
Jani Nikula March 10, 2015, 9:59 a.m. UTC | #3
On Fri, 06 Mar 2015, Daniel Vetter <daniel@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@intel.com>
>
> Makes sense.
>
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: stable@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@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
diff mbox

Patch

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;