mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] vdpa_sim: init iommu lock
@ 2020-08-10 12:48 Michael S. Tsirkin
  2020-08-11  2:55 ` Jason Wang
  0 siblings, 1 reply; 2+ messages in thread
From: Michael S. Tsirkin @ 2020-08-10 12:48 UTC (permalink / raw)
  To: linux-kernel
  Cc: kernel test robot, Max Gurtovoy, Jason Wang, virtualization, LKML, lkp

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@intel.com>
Cc: Max Gurtovoy <maxg@mellanox.com>
Fixes: 0ea9ee430e74 ("vdpasim: protect concurrent access to iommu iotlb")
Signed-off-by: Michael S. Tsirkin <mst@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);
-- 
MST


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] vdpa_sim: init iommu lock
  2020-08-10 12:48 [PATCH] vdpa_sim: init iommu lock Michael S. Tsirkin
@ 2020-08-11  2:55 ` Jason Wang
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Wang @ 2020-08-11  2:55 UTC (permalink / raw)
  To: Michael S. Tsirkin, linux-kernel
  Cc: kernel test robot, Max Gurtovoy, virtualization, lkp


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@intel.com>
> Cc: Max Gurtovoy <maxg@mellanox.com>
> Fixes: 0ea9ee430e74 ("vdpasim: protect concurrent access to iommu iotlb")
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


Acked-by: Jason Wang <jasowang@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);


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-11  2:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-10 12:48 [PATCH] vdpa_sim: init iommu lock Michael S. Tsirkin
2020-08-11  2:55 ` Jason Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®