[PATCH] vdpa_sim: init iommu lock

Jason Wang
Tue, 11 Aug 2020 02:55:03 -0000

On 2020/8/10 ??8:48, Michael S. Tsirkin wrote:
> The patch adding the iommu lock did not initialize it.
> The struct is zero-initialized so this is mostly a problem
> when using lockdep.
>
> Reported-by: kernel test robot <rong.a.chen at intel.com>
> Cc: Max Gurtovoy <maxg at mellanox.com>
> Fixes: 0ea9ee430e74 ("vdpasim: protect concurrent access to iommu
iotlb")
> Signed-off-by: Michael S. Tsirkin <mst at redhat.com>


Acked-by: Jason Wang <jasowang at redhat.com>


> ---
>   drivers/vdpa/vdpa_sim/vdpa_sim.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c
b/drivers/vdpa/vdpa_sim/vdpa_sim.c
> index df3224b138ee..604d9d25ca47 100644
> --- a/drivers/vdpa/vdpa_sim/vdpa_sim.c
> +++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c
> @@ -358,6 +358,7 @@ static struct vdpasim *vdpasim_create(void)
>
>   	INIT_WORK(&vdpasim->work, vdpasim_work);
>   	spin_lock_init(&vdpasim->lock);
> +	spin_lock_init(&vdpasim->iommu_lock);
>
>   	dev = &vdpasim->vdpa.dev;
>   	dev->coherent_dma_mask = DMA_BIT_MASK(64);