Skip to contentSkip to conversation

drm/rockchip: vop: call vop_cfg_done() under reg_lock

PATCH In review Emil Velikov 2 participants 3 messages May 5, 2020 – May 17, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/rockchip: vop: call vop_cfg_done() under reg_lock

From: Emil Velikov <[email protected]>

The function vop_cfg_done() is a simple VOP_REG_SET(). As such it should be done under a reg_lock. A quick look through the driver shows that all other instances (apart from driver init) have the lock. Do the same here

Cc Sandy Huang <[email protected]>
Cc Heiko Stübner <[email protected]>

---
Noticed while skimming through the code and thus untested.

---
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +2 -2
index 33463b79a37b..1d76455ca933 100644
@@ -645,10 +645,10 @@ static int vop_enable(struct drm_crtc *crtc, struct drm_crtc_state *old_state)
 		s->enable_afbc = false;
 	}
 
-	spin_unlock(&vop->reg_lock);
-
 	vop_cfg_done(vop);
 
+	spin_unlock(&vop->reg_lock);
+
 	/*
 	 * At here, vop clock & iommu is enable, R/W vop regs would be safe.
 	 */
Signature · 6 lines
2.25.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Reviewed-by on v1 1/1
#1 lore raw

Hi Emil Velikov,

Quoted 22 lines · Emil Velikov

From: Emil Velikov <[email protected]>

The function vop_cfg_done() is a simple VOP_REG_SET(). As such it should be done under a reg_lock. A quick look through the driver shows that all other instances (apart from driver init) have the lock. Do the same here

Cc Sandy Huang <[email protected]>
Cc Heiko Stübner <[email protected]>

---
Noticed while skimming through the code and thus untested.

---
  drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +0 -0
index 33463b79a37b..1d76455ca933 100644
@@ -645,10 +645,10 @@ static int vop_enable(struct drm_crtc *crtc, struct drm_crtc_state *old_state)
  		s->enable_afbc = false;
  	}

drivers/gpu/drm/rockchip/rockchip_drm_vop.c static int vop_enable(struct drm_crtc *crtc, struct drm_crtc_state *old_state) · line 654

Quoted 10 lines
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +2 -2
 
-	spin_unlock(&vop->reg_lock);
-
  	vop_cfg_done(vop);
 
+	spin_unlock(&vop->reg_lock);
+
  	/*
  	 * At here, vop clock & iommu is enable, R/W vop regs would be safe.
  	 */

thanks for your patch

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw
Quoted 31 lines · Sandy Huang

Hi Emil Velikov,

Quoted 27 lines · Emil Velikov

From: Emil Velikov <[email protected]>

The function vop_cfg_done() is a simple VOP_REG_SET(). As such it should be done under a reg_lock. A quick look through the driver shows that all other instances (apart from driver init) have the lock. Do the same here

Cc Sandy Huang <[email protected]>
Cc Heiko Stübner <[email protected]>

---
Noticed while skimming through the code and thus untested.

---
  drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +0 -2
index 33463b79a37b..1d76455ca933 100644
@@ -645,10 +645,10 @@ static int vop_enable(struct drm_crtc *crtc, struct drm_crtc_state *old_state)
              s->enable_afbc = false;
      }
 
-     spin_unlock(&vop->reg_lock);
-
      vop_cfg_done(vop);
 
Quoted 9 lines

drivers/gpu/drm/rockchip/rockchip_drm_vop.c static int vop_enable(struct drm_crtc *crtc, struct drm_crtc_state *old_state) · line 654

Quoted 5 lines
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +2 -0
+     spin_unlock(&vop->reg_lock);
+
      /*
       * At here, vop clock & iommu is enable, R/W vop regs would be safe.
       */

thanks for your patch

Thanks. Doesn't seems like this was merged, so I pushed it to drm-misc-next.

-Emil
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel