[PATCH v4] drm: drm_vblank_cleanup: WARN when refcount > 0

PrasannaKumar Muralidharan prasannatsmkumar at gmail.com
Sun Nov 26 12:46:05 UTC 2017


Warn when refcount is > 0 in drm_vblank_cleanup.

Signed-off-by: PrasannaKumar Muralidharan <prasannatsmkumar at gmail.com>
---
Changes in v4:
* Print refcount value.

Changes in v3:
* Dropped i915 patch that is used for testing this.

No changes in v2.


 drivers/gpu/drm/drm_vblank.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
index 3e61aeb..062cc17 100644
--- a/drivers/gpu/drm/drm_vblank.c
+++ b/drivers/gpu/drm/drm_vblank.c
@@ -403,9 +403,15 @@ void drm_vblank_cleanup(struct drm_device *dev)
 		return;
 
 	for (pipe = 0; pipe < dev->num_crtcs; pipe++) {
+		unsigned int refcount;
 		struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
 
-		WARN_ON(atomic_read(&vblank->refcount) > 0);
+		refcount = atomic_read(&vblank->refcount);
+		if (refcount > 0) {
+			DRM_DEBUG("vblank refcount: %u in %s\n", refcount,
+				   __func__);
+			WARN_ON(refcount > 0);
+		}
 
 		WARN_ON(READ_ONCE(vblank->enabled) &&
 			drm_core_check_feature(dev, DRIVER_MODESET));
-- 
2.10.0



More information about the dri-devel mailing list