Skip to contentSkip to conversation

drm: drm_vblank_cleanup: WARN when refcount > 0

PATCH Superseded PrasannaKumar Muralidharan 1 participant 2 messages Oct 13, 2017

Subsystems (2)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 drm: drm_vblank_cleanup: WARN when refcount > 0

Warn when refcount > 0 in drm_vblank_cleanup.

---
 drivers/gpu/drm/drm_vblank.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/drm_vblank.c +2 -0
index 70f2b95..3e61aeb 100644
@@ -405,6 +405,8 @@ void drm_vblank_cleanup(struct drm_device *dev)
 	for (pipe = 0; pipe < dev->num_crtcs; pipe++) {
 		struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
 
+		WARN_ON(atomic_read(&vblank->refcount) > 0);
+
 		WARN_ON(READ_ONCE(vblank->enabled) &&
 			drm_core_check_feature(dev, DRIVER_MODESET));
 
Signature · 6 lines
2.10.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

Hi,

Quoted 21 lines · PrasannaKumar Muralidharan

Warn when refcount > 0 in drm_vblank_cleanup.

---
 drivers/gpu/drm/drm_vblank.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/drm_vblank.c +2 -1
index 70f2b95..3e61aeb 100644
@@ -405,6 +405,8 @@ void drm_vblank_cleanup(struct drm_device *dev)
        for (pipe = 0; pipe < dev->num_crtcs; pipe++) {
                struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
 
+               WARN_ON(atomic_read(&vblank->refcount) > 0);
+
                WARN_ON(READ_ONCE(vblank->enabled) &&
                        drm_core_check_feature(dev, DRIVER_MODESET));
 
--
Quoted 2 lines

2.10.0

Looking at the CI logs, realised that the patch I used for testing had a problem. I used drm_crtc_vblank_put instead of drm_crtc_vblank_get. I do see that the warning is generated but I am wondering whether it is correct.

If it is not correct I will resend corrected test patch. Please let me know.

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