Skip to contentSkip to conversation

drm_atomic_helper_resume() locking changes in v4.12

DISCUSSION Jyri Sarha 2 participants 3 messages May 29, 2017

lore
Share & tools
lore

Jyri Sarha

author
#0 lore raw

Hi,
I have "WARN_ON(!drm_modeset_is_locked(&crtc->mutex))" in tilcdc crtc enable and disable callbacks. Now those warnings are firing when resuming from suspend and I see that "drm_modeset_lock_all(dev)" has been removed from "drm_atomic_helper_resume()".

I guess I should remove those warnings from tilcdc since no other driver has such warnings in place, but it still seems odd to me that the crtc enable or disable maybe called without the crtc modeset lock.

Is there something wrong with drm_atomic_helper_resume() locking or am just confused about how the locking in drm works? (The later is probably true in any case)

Best regards,
Jyri
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#1 lore raw
Quoted 6 lines · Jyri Sarha

Hi,
I have "WARN_ON(!drm_modeset_is_locked(&crtc->mutex))" in tilcdc crtc enable and disable callbacks. Now those warnings are firing when resuming from suspend and I see that "drm_modeset_lock_all(dev)" has been removed from "drm_atomic_helper_resume()".

Quoted 7 lines

I guess I should remove those warnings from tilcdc since no other driver has such warnings in place, but it still seems odd to me that the crtc enable or disable maybe called without the crtc modeset lock.

Is there something wrong with drm_atomic_helper_resume() locking or am just confused about how the locking in drm works? (The later is probably true in any case)

Oversight in the conversion, i.e. thanks for reporting this bug I'll type the patch to fix it asap :-)
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw
In reply to Jyri Sarha
Quoted 9 lines · Jyri Sarha

Hi,
I have "WARN_ON(!drm_modeset_is_locked(&crtc->mutex))" in tilcdc crtc enable and disable callbacks. Now those warnings are firing when resuming from suspend and I see that "drm_modeset_lock_all(dev)" has been removed from "drm_atomic_helper_resume()".

I guess I should remove those warnings from tilcdc since no other driver has such warnings in place, but it still seems odd to me that the crtc enable or disable maybe called without the crtc modeset lock.

Ok, thought about why no one else hit this, and the reason is that requiring the modeset locks in the commit function (well the hw commit in commit_tail when using the helpers) is indeed wrong: nonblocking commits don't hold the locks (it might block the next operation). You can check for the modeset locks in your ->mode_fixup or ->atomic_check callbacks though.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel