diff mbox

drm_modeset_lock oops in next

Message ID 43aba628-71c3-58ca-eaa8-e1098fd20046@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Maarten Lankhorst April 8, 2017, 8:52 a.m. UTC
Hey,

Op 07-04-17 om 17:56 schreef Tony Lindgren:
> Hi,
>
> Looks like current next now oopses at least for omapdrm
> when starting X. Reverting commit d20afeb3e2f9 ("Merge
> remote-tracking branch 'drm-misc/for-linux-next'") makes
> things work again.
>
> Any ideas what might be causing the oops below?
Looks like fallout from the acquire_ctx patches?

Could you test the below?

Comments

Tony Lindgren April 8, 2017, 4:46 p.m. UTC | #1
* Maarten Lankhorst <maarten.lankhorst@linux.intel.com> [170408 01:55]:
> Hey,
> 
> Op 07-04-17 om 17:56 schreef Tony Lindgren:
> > Hi,
> >
> > Looks like current next now oopses at least for omapdrm
> > when starting X. Reverting commit d20afeb3e2f9 ("Merge
> > remote-tracking branch 'drm-misc/for-linux-next'") makes
> > things work again.
> >
> > Any ideas what might be causing the oops below?
> Looks like fallout from the acquire_ctx patches?
> 
> Could you test the below?

Yes thanks Daniel Vetter already posted a similar fix as
"[PATCH] drm: Only take cursor locks when the cursor plane exists".

Regards,

Tony
Maarten Lankhorst April 10, 2017, 7:02 a.m. UTC | #2
Op 08-04-17 om 18:46 schreef Tony Lindgren:
> * Maarten Lankhorst <maarten.lankhorst@linux.intel.com> [170408 01:55]:
>> Hey,
>>
>> Op 07-04-17 om 17:56 schreef Tony Lindgren:
>>> Hi,
>>>
>>> Looks like current next now oopses at least for omapdrm
>>> when starting X. Reverting commit d20afeb3e2f9 ("Merge
>>> remote-tracking branch 'drm-misc/for-linux-next'") makes
>>> things work again.
>>>
>>> Any ideas what might be causing the oops below?
>> Looks like fallout from the acquire_ctx patches?
>>
>> Could you test the below?
> Yes thanks Daniel Vetter already posted a similar fix as
> "[PATCH] drm: Only take cursor locks when the cursor plane exists".
>
> Regards,
>
> Tony

Yeah saw it later, no worries. :)
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c
index 838ca742a28b..2c5b5bf68e3d 100644
--- a/drivers/gpu/drm/drm_plane.c
+++ b/drivers/gpu/drm/drm_plane.c
@@ -720,15 +720,16 @@  static int drm_mode_cursor_common(struct drm_device *dev,
 	ret = drm_modeset_lock(&crtc->mutex, &ctx);
 	if (ret)
 		goto out;
-	ret = drm_modeset_lock(&crtc->cursor->mutex, &ctx);
-	if (ret)
-		goto out;
 
 	/*
 	 * If this crtc has a universal cursor plane, call that plane's update
 	 * handler rather than using legacy cursor handlers.
 	 */
 	if (crtc->cursor) {
+		ret = drm_modeset_lock(&crtc->cursor->mutex, &ctx);
+		if (ret)
+			goto out;
+
 		ret = drm_mode_cursor_universal(crtc, req, file_priv, &ctx);
 		goto out;
 	}