Re: [PATCH v2 21/25] nvdimm: virtio_pmem: drop owner assignment

2024-03-31 Thread Pankaj Gupta
virtio core already sets the .owner, so driver does not need to.
>
> Acked-by: Dave Jiang 
> Signed-off-by: Krzysztof Kozlowski 
>
Reviewed-by: Pankaj Gupta 
> Depends on the first patch.
> ---
>  drivers/nvdimm/virtio_pmem.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/drivers/nvdimm/virtio_pmem.c b/drivers/nvdimm/virtio_pmem.c
> index 4ceced5cefcf..c9b97aeabf85 100644
> --- a/drivers/nvdimm/virtio_pmem.c
> +++ b/drivers/nvdimm/virtio_pmem.c
> @@ -151,7 +151,6 @@ static struct virtio_driver virtio_pmem_driver = {
> .feature_table  = features,
> .feature_table_size = ARRAY_SIZE(features),
> .driver.name= KBUILD_MODNAME,
> -   .driver.owner   = THIS_MODULE,
> .id_table   = id_table,
> .validate   = virtio_pmem_validate,
> .probe  = virtio_pmem_probe,
>
> --
> 2.34.1
>
>


Re: [PATCH RFC] virtio: wrap config->reset calls

2021-10-13 Thread Pankaj Gupta
an clean up the queues. */
> -   vb->vdev->config->reset(vb->vdev);
> +   virtio_reset_device(vb->vdev);
>
> vb->vdev->config->del_vqs(vb->vdev);
>  }
> diff --git a/drivers/virtio/virtio_input.c b/drivers/virtio/virtio_input.c
> index ce51ae165943..3aa46703872d 100644
> --- a/drivers/virtio/virtio_input.c
> +++ b/drivers/virtio/virtio_input.c
> @@ -347,7 +347,7 @@ static void virtinput_remove(struct virtio_device *vdev)
> spin_unlock_irqrestore(>lock, flags);
>
> input_unregister_device(vi->idev);
> -   vdev->config->reset(vdev);
> +   virtio_reset_device(vdev);
> while ((buf = virtqueue_detach_unused_buf(vi->sts)) != NULL)
> kfree(buf);
> vdev->config->del_vqs(vdev);
> diff --git a/drivers/virtio/virtio_mem.c b/drivers/virtio/virtio_mem.c
> index bef8ad6bf466..3bab0a625a4b 100644
> --- a/drivers/virtio/virtio_mem.c
> +++ b/drivers/virtio/virtio_mem.c
> @@ -2722,7 +2722,7 @@ static void virtio_mem_remove(struct virtio_device 
> *vdev)
> }
>
> /* reset the device and cleanup the queues */
> -   vdev->config->reset(vdev);
> +   virtio_reset_device(vdev);
> vdev->config->del_vqs(vdev);
>
> kfree(vm);
> diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c
> index 0ad89c6629d7..27c3b74070a2 100644
> --- a/fs/fuse/virtio_fs.c
> +++ b/fs/fuse/virtio_fs.c
> @@ -895,7 +895,7 @@ static int virtio_fs_probe(struct virtio_device *vdev)
> return 0;
>
>  out_vqs:
> -   vdev->config->reset(vdev);
> +   virtio_reset_device(vdev);
> virtio_fs_cleanup_vqs(vdev, fs);
> kfree(fs->vqs);
>
> @@ -927,7 +927,7 @@ static void virtio_fs_remove(struct virtio_device *vdev)
> list_del_init(>list);
> virtio_fs_stop_all_queues(fs);
> virtio_fs_drain_all_queues_locked(fs);
> -   vdev->config->reset(vdev);
> +   virtio_reset_device(vdev);
> virtio_fs_cleanup_vqs(vdev, fs);
>
> vdev->priv = NULL;
> diff --git a/include/linux/virtio.h b/include/linux/virtio.h
> index 41edbc01ffa4..72292a62cd90 100644
> --- a/include/linux/virtio.h
> +++ b/include/linux/virtio.h
> @@ -138,6 +138,7 @@ int virtio_finalize_features(struct virtio_device *dev);
>  int virtio_device_freeze(struct virtio_device *dev);
>  int virtio_device_restore(struct virtio_device *dev);
>  #endif
> +void virtio_reset_device(struct virtio_device *dev);
>
>  size_t virtio_max_dma_size(struct virtio_device *vdev);
>
> diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
> index 490a4c900339..19c69821dd04 100644
> --- a/net/9p/trans_virtio.c
> +++ b/net/9p/trans_virtio.c
> @@ -721,7 +721,7 @@ static void p9_virtio_remove(struct virtio_device *vdev)
>
> mutex_unlock(_9p_lock);
>
> -   vdev->config->reset(vdev);
> +   virtio_reset_device(vdev);
> vdev->config->del_vqs(vdev);
>
> sysfs_remove_file(&(vdev->dev.kobj), _attr_mount_tag.attr);
> diff --git a/net/vmw_vsock/virtio_transport.c 
> b/net/vmw_vsock/virtio_transport.c
> index 4f7c99dfd16c..fb3302fff627 100644
> --- a/net/vmw_vsock/virtio_transport.c
> +++ b/net/vmw_vsock/virtio_transport.c
> @@ -665,7 +665,7 @@ static void virtio_vsock_remove(struct virtio_device 
> *vdev)
> vsock_for_each_connected_socket(virtio_vsock_reset_sock);
>
> /* Stop all work handlers to make sure no one is accessing the device,
> -* so we can safely call vdev->config->reset().
> +* so we can safely call virtio_reset_device().
>  */
> mutex_lock(>rx_lock);
> vsock->rx_run = false;
> @@ -682,7 +682,7 @@ static void virtio_vsock_remove(struct virtio_device 
> *vdev)
> /* Flush all device writes and interrupts, device will not use any
>  * more buffers.
>  */
> -   vdev->config->reset(vdev);
> +   virtio_reset_device(vdev);
>
> mutex_lock(>rx_lock);
> while ((pkt = virtqueue_detach_unused_buf(vsock->vqs[VSOCK_VQ_RX])))
> diff --git a/sound/virtio/virtio_card.c b/sound/virtio/virtio_card.c
> index 150ab3e37013..e2847c040f75 100644
> --- a/sound/virtio/virtio_card.c
> +++ b/sound/virtio/virtio_card.c
> @@ -350,7 +350,7 @@ static void virtsnd_remove(struct virtio_device *vdev)
> snd_card_free(snd->card);
>
> vdev->config->del_vqs(vdev);
> -   vdev->config->reset(vdev);
> +   virtio_reset_device(vdev);
>
> for (i = 0; snd->substreams && i < snd->nsubstreams; ++i) {
> struct virtio_pcm_substream *vss = >substreams[i];
> @@ -379,7 +379,7 @@ static int virtsnd_freeze(struct virtio_device *vdev)
> virtsnd_ctl_msg_cancel_all(snd);
>
> vdev->config->del_vqs(vdev);
> -   vdev->config->reset(vdev);
> +   virtio_reset_device(vdev);
>
> for (i = 0; i < snd->nsubstreams; ++i)
> cancel_work_sync(>substreams[i].elapsed_period);

Reviewed-by: Pankaj Gupta 


Re: [PATCH v7 1/9] fs: Constify vma argument to vma_is_dax

2020-03-26 Thread Pankaj Gupta
> From: "Thomas Hellstrom (VMware)" 
>
> The function is used by upcoming vma_is_special_huge() with which we want
> to use a const vma argument. Since for vma_is_dax() the vma argument is
> only dereferenced for reading, constify it.
>
> Cc: Andrew Morton 
> Cc: Michal Hocko 
> Cc: "Matthew Wilcox (Oracle)" 
> Cc: "Kirill A. Shutemov" 
> Cc: Ralph Campbell 
> Cc: "Jérôme Glisse" 
> Cc: "Christian König" 
> Cc: Dan Williams 
> Signed-off-by: Thomas Hellstrom (VMware) 
> Reviewed-by: Roland Scheidegger 
> Acked-by: Christian König 
> ---
>  include/linux/fs.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index 3cd4fe6b845e..2b38ce5b73ad 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -3391,7 +3391,7 @@ static inline bool io_is_direct(struct file *filp)
> return (filp->f_flags & O_DIRECT) || IS_DAX(filp->f_mapping->host);
>  }
>
> -static inline bool vma_is_dax(struct vm_area_struct *vma)
> +static inline bool vma_is_dax(const struct vm_area_struct *vma)
>  {
> return vma->vm_file && IS_DAX(vma->vm_file->f_mapping->host);
>  }
> --
Acked-by: Pankaj Gupta 

> 2.21.1
>
>
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel