diff --git a/drivers/video/rockchip/mpp/mpp_iommu.c b/drivers/video/rockchip/mpp/mpp_iommu.c index 1abbfb74f4e2..b19da6e67c0a 100644 --- a/drivers/video/rockchip/mpp/mpp_iommu.c +++ b/drivers/video/rockchip/mpp/mpp_iommu.c @@ -529,7 +529,8 @@ mpp_iommu_probe(struct device *dev) goto err_put_group; } - init_rwsem(&info->rw_sem); + init_rwsem(&info->rw_sem_self); + info->rw_sem = &info->rw_sem_self; spin_lock_init(&info->dev_lock); info->dev = dev; info->pdev = pdev; diff --git a/drivers/video/rockchip/mpp/mpp_iommu.h b/drivers/video/rockchip/mpp/mpp_iommu.h index 87d1b5c612d2..2787fc069df7 100644 --- a/drivers/video/rockchip/mpp/mpp_iommu.h +++ b/drivers/video/rockchip/mpp/mpp_iommu.h @@ -68,7 +68,8 @@ struct mpp_rk_iommu { struct mpp_dev; struct mpp_iommu_info { - struct rw_semaphore rw_sem; + struct rw_semaphore *rw_sem; + struct rw_semaphore rw_sem_self; struct device *dev; struct platform_device *pdev; @@ -126,7 +127,7 @@ int mpp_iommu_dev_deactivate(struct mpp_iommu_info *info, struct mpp_dev *dev); static inline int mpp_iommu_down_read(struct mpp_iommu_info *info) { if (info) - down_read(&info->rw_sem); + down_read(info->rw_sem); return 0; } @@ -134,7 +135,7 @@ static inline int mpp_iommu_down_read(struct mpp_iommu_info *info) static inline int mpp_iommu_up_read(struct mpp_iommu_info *info) { if (info) - up_read(&info->rw_sem); + up_read(info->rw_sem); return 0; } @@ -142,7 +143,7 @@ static inline int mpp_iommu_up_read(struct mpp_iommu_info *info) static inline int mpp_iommu_down_write(struct mpp_iommu_info *info) { if (info) - down_write(&info->rw_sem); + down_write(info->rw_sem); return 0; } @@ -150,7 +151,7 @@ static inline int mpp_iommu_down_write(struct mpp_iommu_info *info) static inline int mpp_iommu_up_write(struct mpp_iommu_info *info) { if (info) - up_write(&info->rw_sem); + up_write(info->rw_sem); return 0; }