drm/crc-debugfs: Also sprinkle irqrestore over early exits
diff mbox series

Message ID 20190606211544.5389-1-daniel.vetter@ffwll.ch
State New
Headers show
Series
  • drm/crc-debugfs: Also sprinkle irqrestore over early exits
Related show

Commit Message

Daniel Vetter June 6, 2019, 9:15 p.m. UTC
I. was. blind.

Caught with vkms, which has some really slow crc computation function.

Fixes: 1882018a70e0 ("drm/crc-debugfs: User irqsafe spinlock in drm_crtc_add_crc_entry")
Cc: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Cc: Emil Velikov <emil.velikov@collabora.com>
Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/drm_debugfs_crc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Emil Velikov June 7, 2019, 10:05 a.m. UTC | #1
On Thu, 6 Jun 2019 at 22:15, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
>
> I. was. blind.
>
> Caught with vkms, which has some really slow crc computation function.
>
> Fixes: 1882018a70e0 ("drm/crc-debugfs: User irqsafe spinlock in drm_crtc_add_crc_entry")
> Cc: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
> Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>
> Cc: Emil Velikov <emil.velikov@collabora.com>
> Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>

-Emil
Benjamin Gaignard June 7, 2019, 11:14 a.m. UTC | #2
Le ven. 7 juin 2019 à 12:07, Emil Velikov <emil.l.velikov@gmail.com> a écrit :
>
> On Thu, 6 Jun 2019 at 22:15, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> >
> > I. was. blind.
> >
> > Caught with vkms, which has some really slow crc computation function.
> >
> > Fixes: 1882018a70e0 ("drm/crc-debugfs: User irqsafe spinlock in drm_crtc_add_crc_entry")
> > Cc: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
> > Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>
> > Cc: Emil Velikov <emil.velikov@collabora.com>
> > Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org>
> > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
>
> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>

Reviewed-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>

>
> -Emil
Daniel Vetter June 7, 2019, 2:49 p.m. UTC | #3
On Fri, Jun 07, 2019 at 01:14:57PM +0200, Benjamin Gaignard wrote:
> Le ven. 7 juin 2019 à 12:07, Emil Velikov <emil.l.velikov@gmail.com> a écrit :
> >
> > On Thu, 6 Jun 2019 at 22:15, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> > >
> > > I. was. blind.
> > >
> > > Caught with vkms, which has some really slow crc computation function.
> > >
> > > Fixes: 1882018a70e0 ("drm/crc-debugfs: User irqsafe spinlock in drm_crtc_add_crc_entry")
> > > Cc: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
> > > Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>
> > > Cc: Emil Velikov <emil.velikov@collabora.com>
> > > Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org>
> > > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> >
> > Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
> 
> Reviewed-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>

Thanks for the reviews, applied to -misc-next.
-Daniel

Patch
diff mbox series

diff --git a/drivers/gpu/drm/drm_debugfs_crc.c b/drivers/gpu/drm/drm_debugfs_crc.c
index 7f35b5ba1924..d2f102f01515 100644
--- a/drivers/gpu/drm/drm_debugfs_crc.c
+++ b/drivers/gpu/drm/drm_debugfs_crc.c
@@ -402,7 +402,7 @@  int drm_crtc_add_crc_entry(struct drm_crtc *crtc, bool has_frame,
 
 	/* Caller may not have noticed yet that userspace has stopped reading */
 	if (!crc->entries) {
-		spin_unlock(&crc->lock);
+		spin_unlock_irqrestore(&crc->lock, flags);
 		return -EINVAL;
 	}
 
@@ -413,7 +413,7 @@  int drm_crtc_add_crc_entry(struct drm_crtc *crtc, bool has_frame,
 		bool was_overflow = crc->overflow;
 
 		crc->overflow = true;
-		spin_unlock(&crc->lock);
+		spin_unlock_irqrestore(&crc->lock, flags);
 
 		if (!was_overflow)
 			DRM_ERROR("Overflow of CRC buffer, userspace reads too slow.\n");