drm/rockchip: Don't use spin_lock_irqsave in interrupt context
The rockchip DRM driver is quite careful to disable interrupts when taking a lock that is also taken in interrupt context, which is a good thing. What is a bit over the top is to use spin_lock_irqsave when already in interrupt context, as you cannot take another interrupt again, and disabling interrupt is just pure overhead. Switching to the non _irqsave version in interrupt context is more logical, and less heavy handed. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patchwork.freedesktop.org/patch/msgid/20180220130120.5254-4-marc.zyngier@arm.com
This commit is contained in:
parent
76f1416e64
commit
1c85f2fa68
|
@ -1147,15 +1147,14 @@ static void vop_handle_vblank(struct vop *vop)
|
||||||
{
|
{
|
||||||
struct drm_device *drm = vop->drm_dev;
|
struct drm_device *drm = vop->drm_dev;
|
||||||
struct drm_crtc *crtc = &vop->crtc;
|
struct drm_crtc *crtc = &vop->crtc;
|
||||||
unsigned long flags;
|
|
||||||
|
|
||||||
spin_lock_irqsave(&drm->event_lock, flags);
|
spin_lock(&drm->event_lock);
|
||||||
if (vop->event) {
|
if (vop->event) {
|
||||||
drm_crtc_send_vblank_event(crtc, vop->event);
|
drm_crtc_send_vblank_event(crtc, vop->event);
|
||||||
drm_crtc_vblank_put(crtc);
|
drm_crtc_vblank_put(crtc);
|
||||||
vop->event = NULL;
|
vop->event = NULL;
|
||||||
}
|
}
|
||||||
spin_unlock_irqrestore(&drm->event_lock, flags);
|
spin_unlock(&drm->event_lock);
|
||||||
|
|
||||||
if (test_and_clear_bit(VOP_PENDING_FB_UNREF, &vop->pending))
|
if (test_and_clear_bit(VOP_PENDING_FB_UNREF, &vop->pending))
|
||||||
drm_flip_work_commit(&vop->fb_unref_work, system_unbound_wq);
|
drm_flip_work_commit(&vop->fb_unref_work, system_unbound_wq);
|
||||||
|
@ -1166,21 +1165,20 @@ static irqreturn_t vop_isr(int irq, void *data)
|
||||||
struct vop *vop = data;
|
struct vop *vop = data;
|
||||||
struct drm_crtc *crtc = &vop->crtc;
|
struct drm_crtc *crtc = &vop->crtc;
|
||||||
uint32_t active_irqs;
|
uint32_t active_irqs;
|
||||||
unsigned long flags;
|
|
||||||
int ret = IRQ_NONE;
|
int ret = IRQ_NONE;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* interrupt register has interrupt status, enable and clear bits, we
|
* interrupt register has interrupt status, enable and clear bits, we
|
||||||
* must hold irq_lock to avoid a race with enable/disable_vblank().
|
* must hold irq_lock to avoid a race with enable/disable_vblank().
|
||||||
*/
|
*/
|
||||||
spin_lock_irqsave(&vop->irq_lock, flags);
|
spin_lock(&vop->irq_lock);
|
||||||
|
|
||||||
active_irqs = VOP_INTR_GET_TYPE(vop, status, INTR_MASK);
|
active_irqs = VOP_INTR_GET_TYPE(vop, status, INTR_MASK);
|
||||||
/* Clear all active interrupt sources */
|
/* Clear all active interrupt sources */
|
||||||
if (active_irqs)
|
if (active_irqs)
|
||||||
VOP_INTR_SET_TYPE(vop, clear, active_irqs, 1);
|
VOP_INTR_SET_TYPE(vop, clear, active_irqs, 1);
|
||||||
|
|
||||||
spin_unlock_irqrestore(&vop->irq_lock, flags);
|
spin_unlock(&vop->irq_lock);
|
||||||
|
|
||||||
/* This is expected for vop iommu irqs, since the irq is shared */
|
/* This is expected for vop iommu irqs, since the irq is shared */
|
||||||
if (!active_irqs)
|
if (!active_irqs)
|
||||||
|
|
Loading…
Reference in New Issue