Skip to contentSkip to conversation

drm/i915: No need to save/restore irq status in __i915_request_irq_complete

PATCH In review Tvrtko Ursulin 4 participants 8 messages Mar 6, 2017 – Mar 7, 2017

Subsystems (2)
lore
Share & tools
lore

Tvrtko Ursulin

author maintainer
#0 lore raw

PATCH 1/3 drm/i915: No need to save/restore irq status in __i915_request_irq_complete

From: Tvrtko Ursulin <[email protected]>

It is always called from thread context.

---
 drivers/gpu/drm/i915/i915_drv.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +2 -3
index 1fd4128a10b1..b7ec6636e2a0 100644
@@ -4086,7 +4086,6 @@ __i915_request_irq_complete(const struct drm_i915_gem_request *req)
 	if (engine->irq_seqno_barrier &&
 	    test_and_clear_bit(ENGINE_IRQ_BREADCRUMB, &engine->irq_posted)) {
 		struct intel_breadcrumbs *b = &engine->breadcrumbs;
-		unsigned long flags;
 
 		/* The ordering of irq_posted versus applying the barrier
 		 * is crucial. The clearing of the current irq_posted must
@@ -4108,7 +4107,7 @@ __i915_request_irq_complete(const struct drm_i915_gem_request *req)
 		 * the seqno before we believe it coherent since they see
 		 * irq_posted == false but we are still running).
 		 */
-		spin_lock_irqsave(&b->irq_lock, flags);
+		spin_lock_irq(&b->irq_lock);
 		if (b->irq_wait && b->irq_wait->tsk != current)
 			/* Note that if the bottom-half is changed as we
 			 * are sending the wake-up, the new bottom-half will
@@ -4117,7 +4116,7 @@ __i915_request_irq_complete(const struct drm_i915_gem_request *req)
 			 * ourself.
 			 */
 			wake_up_process(b->irq_wait->tsk);
-		spin_unlock_irqrestore(&b->irq_lock, flags);
+		spin_unlock_irq(&b->irq_lock);
 
 		if (__i915_gem_request_completed(req, seqno))
 			return true;
Signature · 6 lines
2.9.3

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
author maintainer
#1 lore raw

PATCH 2/3 drm/i915: No need to save/restore irq status in intel_breadcrumbs_fake_irq

From: Tvrtko Ursulin <[email protected]>

Timer callback is a known context so it is correct to always disable interrupts.

---
 drivers/gpu/drm/i915/intel_breadcrumbs.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_breadcrumbs.c +2 -3
index 619d99b074c1..b66618e5ff1e 100644
@@ -110,7 +110,6 @@ static void intel_breadcrumbs_fake_irq(unsigned long data)
 {
 	struct intel_engine_cs *engine = (struct intel_engine_cs *)data;
 	struct intel_breadcrumbs *b = &engine->breadcrumbs;
-	unsigned long flags;
 
 	/*
 	 * The timer persists in case we cannot enable interrupts,
@@ -120,10 +119,10 @@ static void intel_breadcrumbs_fake_irq(unsigned long data)
 	 * coherent seqno check.
 	 */
 
-	spin_lock_irqsave(&b->irq_lock, flags);
+	spin_lock_irq(&b->irq_lock);
 	if (!__intel_breadcrumbs_wakeup(b))
 		__intel_engine_disarm_breadcrumbs(engine);
-	spin_unlock_irqrestore(&b->irq_lock, flags);
+	spin_unlock_irq(&b->irq_lock);
 	if (!b->irq_armed)
 		return;
 
Signature · 6 lines
2.9.3

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
author maintainer
#2 lore raw

PATCH 3/3 drm/i915: No need to save/restore irq status in intel_engine_wakeup

In reply to Tvrtko Ursulin

From: Tvrtko Ursulin <[email protected]>

It is called from either the process or timer context so it is correct to always disable interrupts.

---
 drivers/gpu/drm/i915/intel_breadcrumbs.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_breadcrumbs.c +2 -3
index b66618e5ff1e..2a1ed6d7ad4d 100644
@@ -47,12 +47,11 @@ static unsigned int __intel_breadcrumbs_wakeup(struct intel_breadcrumbs *b)
 unsigned int intel_engine_wakeup(struct intel_engine_cs *engine)
 {
 	struct intel_breadcrumbs *b = &engine->breadcrumbs;
-	unsigned long flags;
 	unsigned int result;
 
-	spin_lock_irqsave(&b->irq_lock, flags);
+	spin_lock_irq(&b->irq_lock);
 	result = __intel_breadcrumbs_wakeup(b);
-	spin_unlock_irqrestore(&b->irq_lock, flags);
+	spin_unlock_irq(&b->irq_lock);
 
 	return result;
 }
Signature · 6 lines
2.9.3

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 3/3
#3 lore raw

Re: [PATCH 3/3] drm/i915: No need to save/restore irq status in intel_engine_wakeup

Quoted 7 lines · Tvrtko Ursulin

From: Tvrtko Ursulin <[email protected]>

It is called from either the process or timer context so it is correct to always disable interrupts.

All 3 look ok to me, I was uncertain about the timer context allowing just a spin_lock_irq, but if lockdep is happy I was overly conservation.

-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw

Re: [PATCH 3/3] drm/i915: No need to save/restore irq status in intel_engine_wakeup

Quoted 11 lines · Chris Wilson
Quoted 7 lines · Tvrtko Ursulin

From: Tvrtko Ursulin <[email protected]>

It is called from either the process or timer context so it is correct to always disable interrupts.

All 3 look ok to me, I was uncertain about the timer context allowing just a spin_lock_irq, but if lockdep is happy I was overly conservation.

*conversative.

Some days I just dispair over what my fingers type. -Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw

Re: [PATCH 3/3] drm/i915: No need to save/restore irq status in intel_engine_wakeup

In reply to Chris Wilson
Quoted 6 lines · Chris Wilson
Quoted 5 lines · Tvrtko Ursulin

From: Tvrtko Ursulin <[email protected]>

It is called from either the process or timer context so it is correct to always disable interrupts.

Quoted 7 lines
Quoted 2 lines

All 3 look ok to me, I was uncertain about the timer context allowing just a spin_lock_irq, but if lockdep is happy I was overly conservation.

Thanks, I've spotted those while starting to catch up with the some of the changes that landed while I wasn't 100% present.

Timers are softirq and lockdep is happy.

Regards,

Tvrtko
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#6 lore raw

✓ Fi.CI.BAT: success for series starting with [1/3] drm/i915: No need to save/restore irq status in __i915_request_irq_complete

In reply to Tvrtko Ursulin
== Series Details ==

== Series Details ==

Series: series starting with [1/3] drm/i915: No need to save/restore irq status in __i915_request_irq_complete
URL : https://patchwork.freedesktop.org/series/20769/
State : success

== Summary ==

Series 20769v1 Series without cover letter
https://patchwork.freedesktop.org/api/1.0/series/20769/revisions/1/mbox/

Test gem_exec_flush:

        Subgroup basic-batch-kernel-default-uc:
                pass       -> FAIL       (fi-snb-2600) fdo#100007
Test gem_mmap_gtt:
        Subgroup basic-small-bo:
                dmesg-warn -> PASS       (fi-bsw-n3050)

fdo#100007 https://bugs.freedesktop.org/show_bug.cgi?id=100007

fi-bdw-5557u     total:278  pass:267  dwarn:0   dfail:0   fail:0   skip:11  time: 477s
fi-bsw-n3050     total:278  pass:239  dwarn:0   dfail:0   fail:0   skip:39  time: 614s
fi-bxt-j4205     total:278  pass:259  dwarn:0   dfail:0   fail:0   skip:19  time: 530s
fi-bxt-t5700     total:278  pass:258  dwarn:0   dfail:0   fail:0   skip:20  time: 611s
fi-byt-j1900     total:278  pass:251  dwarn:0   dfail:0   fail:0   skip:27  time: 506s
fi-byt-n2820     total:278  pass:247  dwarn:0   dfail:0   fail:0   skip:31  time: 514s
fi-hsw-4770      total:278  pass:262  dwarn:0   dfail:0   fail:0   skip:16  time: 436s
fi-hsw-4770r     total:278  pass:262  dwarn:0   dfail:0   fail:0   skip:16  time: 436s
fi-ilk-650       total:278  pass:228  dwarn:0   dfail:0   fail:0   skip:50  time: 441s
fi-ivb-3520m     total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time: 507s
fi-ivb-3770      total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time: 493s
fi-kbl-7500u     total:278  pass:259  dwarn:1   dfail:0   fail:0   skip:18  time: 478s
fi-skl-6260u     total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10  time: 512s
fi-skl-6700hq    total:278  pass:261  dwarn:0   dfail:0   fail:0   skip:17  time: 596s
fi-skl-6700k     total:278  pass:256  dwarn:4   dfail:0   fail:0   skip:18  time: 500s
fi-skl-6770hq    total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10  time: 564s
fi-snb-2520m     total:278  pass:250  dwarn:0   dfail:0   fail:0   skip:28  time: 557s
fi-snb-2600      total:278  pass:248  dwarn:0   dfail:0   fail:1   skip:29  time: 420s

e06000745435e65b4c056fe8f5bf149b298a0526 drm-tip: 2017y-03m-06d-14h-39m-38s UTC integration manifest 849a75a drm/i915: No need to save/restore irq status in intel_engine_wakeup
855e35c drm/i915: No need to save/restore irq status in intel_breadcrumbs_fake_irq 82ab664 drm/i915: No need to save/restore irq status in __i915_request_irq_complete

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_4075/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#7 lore raw

Re: ✓ Fi.CI.BAT: success for series starting with [1/3] drm/i915: No need to save/restore irq status in __i915_request_irq_complete

Quoted 39 lines · Patchwork

== Series Details ==

Series: series starting with [1/3] drm/i915: No need to save/restore irq status in __i915_request_irq_complete
URL : https://patchwork.freedesktop.org/series/20769/
State : success

== Summary ==

Series 20769v1 Series without cover letter
https://patchwork.freedesktop.org/api/1.0/series/20769/revisions/1/mbox/

Test gem_exec_flush:

        Subgroup basic-batch-kernel-default-uc:
                pass       -> FAIL       (fi-snb-2600) fdo#100007
Test gem_mmap_gtt:
        Subgroup basic-small-bo:
                dmesg-warn -> PASS       (fi-bsw-n3050)

fdo#100007 https://bugs.freedesktop.org/show_bug.cgi?id=100007

fi-bdw-5557u     total:278  pass:267  dwarn:0   dfail:0   fail:0   skip:11  time: 477s
fi-bsw-n3050     total:278  pass:239  dwarn:0   dfail:0   fail:0   skip:39  time: 614s
fi-bxt-j4205     total:278  pass:259  dwarn:0   dfail:0   fail:0   skip:19  time: 530s
fi-bxt-t5700     total:278  pass:258  dwarn:0   dfail:0   fail:0   skip:20  time: 611s
fi-byt-j1900     total:278  pass:251  dwarn:0   dfail:0   fail:0   skip:27  time: 506s
fi-byt-n2820     total:278  pass:247  dwarn:0   dfail:0   fail:0   skip:31  time: 514s
fi-hsw-4770      total:278  pass:262  dwarn:0   dfail:0   fail:0   skip:16  time: 436s
fi-hsw-4770r     total:278  pass:262  dwarn:0   dfail:0   fail:0   skip:16  time: 436s
fi-ilk-650       total:278  pass:228  dwarn:0   dfail:0   fail:0   skip:50  time: 441s
fi-ivb-3520m     total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time: 507s
fi-ivb-3770      total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time: 493s
fi-kbl-7500u     total:278  pass:259  dwarn:1   dfail:0   fail:0   skip:18  time: 478s
fi-skl-6260u     total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10  time: 512s
fi-skl-6700hq    total:278  pass:261  dwarn:0   dfail:0   fail:0   skip:17  time: 596s
fi-skl-6700k     total:278  pass:256  dwarn:4   dfail:0   fail:0   skip:18  time: 500s
fi-skl-6770hq    total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10  time: 564s
fi-snb-2520m     total:278  pass:250  dwarn:0   dfail:0   fail:0   skip:28  time: 557s
fi-snb-2600      total:278  pass:248  dwarn:0   dfail:0   fail:1   skip:29  time: 420s
Quoted 4 lines

e06000745435e65b4c056fe8f5bf149b298a0526 drm-tip: 2017y-03m-06d-14h-39m-38s UTC integration manifest 849a75a drm/i915: No need to save/restore irq status in intel_engine_wakeup
855e35c drm/i915: No need to save/restore irq status in intel_breadcrumbs_fake_irq 82ab664 drm/i915: No need to save/restore irq status in __i915_request_irq_complete

Pushed, thanks for the review!

Regards,

Tvrtko

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx