drm/vkms: Use spin_lock_irq in process context
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 6 Jun 2019 22:27:43 +0000 (00:27 +0200)
committerRodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Thu, 27 Jun 2019 01:56:40 +0000 (22:56 -0300)
The worker is always in process context, no need for the _irqsafe
version. Same for the set_source callback, that's only called from the
debugfs handler in a syscall.

Cc: Shayenne Moura <shayenneluzmoura@gmail.com>
Cc: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Cc: Haneen Mohammed <hamohammed.sa@gmail.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Reviewed-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Tested-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190606222751.32567-3-daniel.vetter@ffwll.ch
drivers/gpu/drm/vkms/vkms_crc.c

index e9fb4ebb789fdf40ecd45133ada285beedc0dff5..d8a2872c58dda81504a8d38cac649c04a20328c2 100644 (file)
@@ -167,16 +167,15 @@ void vkms_crc_work_handle(struct work_struct *work)
        u32 crc32 = 0;
        u64 frame_start, frame_end;
        bool crc_pending;
-       unsigned long flags;
 
-       spin_lock_irqsave(&out->state_lock, flags);
+       spin_lock_irq(&out->state_lock);
        frame_start = crtc_state->frame_start;
        frame_end = crtc_state->frame_end;
        crc_pending = crtc_state->crc_pending;
        crtc_state->frame_start = 0;
        crtc_state->frame_end = 0;
        crtc_state->crc_pending = false;
-       spin_unlock_irqrestore(&out->state_lock, flags);
+       spin_unlock_irq(&out->state_lock);
 
        /*
         * We raced with the vblank hrtimer and previous work already computed
@@ -255,7 +254,6 @@ int vkms_set_crc_source(struct drm_crtc *crtc, const char *src_name)
 {
        struct vkms_output *out = drm_crtc_to_vkms_output(crtc);
        bool enabled = false;
-       unsigned long flags;
        int ret = 0;
 
        ret = vkms_crc_parse_source(src_name, &enabled);
@@ -263,9 +261,9 @@ int vkms_set_crc_source(struct drm_crtc *crtc, const char *src_name)
        /* make sure nothing is scheduled on crtc workq */
        flush_workqueue(out->crc_workq);
 
-       spin_lock_irqsave(&out->lock, flags);
+       spin_lock_irq(&out->lock);
        out->crc_enabled = enabled;
-       spin_unlock_irqrestore(&out->lock, flags);
+       spin_unlock_irq(&out->lock);
 
        return ret;
 }