Message ID | 1415459779-30961-1-git-send-email-robdclark@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
On 09.11.2014 00:16, Rob Clark wrote: > Let's make things a bit easier to debug when things go bad (potentially > under console_lock). > > Signed-off-by: Rob Clark <robdclark@gmail.com> > --- > drivers/gpu/drm/drm_irq.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c > index 5ef03c2..c4edea9 100644 > --- a/drivers/gpu/drm/drm_irq.c > +++ b/drivers/gpu/drm/drm_irq.c > @@ -1029,7 +1029,8 @@ void drm_vblank_put(struct drm_device *dev, int crtc) > { > struct drm_vblank_crtc *vblank = &dev->vblank[crtc]; > > - BUG_ON(atomic_read(&vblank->refcount) == 0); > + if (WARN_ON(atomic_read(&vblank->refcount) == 0)) > + return; > > if (WARN_ON(crtc >= dev->num_crtcs)) > return; > Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
On Sat, 08 Nov 2014, Rob Clark <robdclark@gmail.com> wrote: > Let's make things a bit easier to debug when things go bad (potentially > under console_lock). > > Signed-off-by: Rob Clark <robdclark@gmail.com> > --- > drivers/gpu/drm/drm_irq.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c > index 5ef03c2..c4edea9 100644 > --- a/drivers/gpu/drm/drm_irq.c > +++ b/drivers/gpu/drm/drm_irq.c > @@ -1029,7 +1029,8 @@ void drm_vblank_put(struct drm_device *dev, int crtc) > { > struct drm_vblank_crtc *vblank = &dev->vblank[crtc]; > > - BUG_ON(atomic_read(&vblank->refcount) == 0); > + if (WARN_ON(atomic_read(&vblank->refcount) == 0)) > + return; While I approve of the change, I'd like to promote the use of WARN with a message instead of WARN_ON. See [1]. In fact it lead to us redefining WARN_ON in i915 [2]. Thanks, Jani. [1] http://mid.gmane.org/87y4sfkoy4.fsf@intel.com [2] http://mid.gmane.org/1414510350-15713-1-git-send-email-miku@iki.fi > > if (WARN_ON(crtc >= dev->num_crtcs)) > return; > -- > 1.9.3 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/dri-devel
Hey, Op 10-11-14 om 12:01 schreef Jani Nikula: > On Sat, 08 Nov 2014, Rob Clark <robdclark@gmail.com> wrote: >> Let's make things a bit easier to debug when things go bad (potentially >> under console_lock). >> >> Signed-off-by: Rob Clark <robdclark@gmail.com> >> --- >> drivers/gpu/drm/drm_irq.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c >> index 5ef03c2..c4edea9 100644 >> --- a/drivers/gpu/drm/drm_irq.c >> +++ b/drivers/gpu/drm/drm_irq.c >> @@ -1029,7 +1029,8 @@ void drm_vblank_put(struct drm_device *dev, int crtc) >> { >> struct drm_vblank_crtc *vblank = &dev->vblank[crtc]; >> >> - BUG_ON(atomic_read(&vblank->refcount) == 0); >> + if (WARN_ON(atomic_read(&vblank->refcount) == 0)) >> + return; > While I approve of the change, I'd like to promote the use of WARN with > a message instead of WARN_ON. See [1]. In fact it lead to us redefining > WARN_ON in i915 [2]. I love the redefinition of WARN, but I think this should not be overridden locally, instead it should be a kernel debug option. ~Maarten
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index 5ef03c2..c4edea9 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c @@ -1029,7 +1029,8 @@ void drm_vblank_put(struct drm_device *dev, int crtc) { struct drm_vblank_crtc *vblank = &dev->vblank[crtc]; - BUG_ON(atomic_read(&vblank->refcount) == 0); + if (WARN_ON(atomic_read(&vblank->refcount) == 0)) + return; if (WARN_ON(crtc >= dev->num_crtcs)) return;
Let's make things a bit easier to debug when things go bad (potentially under console_lock). Signed-off-by: Rob Clark <robdclark@gmail.com> --- drivers/gpu/drm/drm_irq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)