Displaying 20 results from an estimated 111 matches for "dma_dev".
2020 Mar 04
1
[PATCH V5 3/5] vDPA: introduce vDPA bus
On Wed, Feb 26, 2020 at 02:04:54PM +0800, Jason Wang wrote:
> +struct vdpa_device *vdpa_alloc_device(struct device *parent,
> + struct device *dma_dev,
> + const struct vdpa_config_ops *config)
> +{
> + struct vdpa_device *vdev;
> + int err = -ENOMEM;
> +
> + if (!parent || !dma_dev || !config)
> + goto err;
> +
> + vdev = kzalloc(sizeof(*vdev), GFP_KERNEL);
> + if (!vdev)
> + goto err;
> +
> + er...
2019 May 23
0
[PATCH v2 2/8] s390/cio: introduce DMA pools to cio
...ubsystem_reinit(void);
extern void css_schedule_reprobe(void);
+extern void *cio_dma_zalloc(size_t size);
+extern void cio_dma_free(void *cpu_addr, size_t size);
+extern struct device *cio_get_dma_css_dev(void);
+
+struct gen_pool;
+void *cio_gp_dma_zalloc(struct gen_pool *gp_dma, struct device *dma_dev,
+ size_t size);
+void cio_gp_dma_free(struct gen_pool *gp_dma, void *cpu_addr, size_t size);
+void cio_gp_dma_destroy(struct gen_pool *gp_dma, struct device *dma_dev);
+struct gen_pool *cio_gp_dma_create(struct device *dma_dev, int nr_pages);
+
/* Function from drivers/s390/cio/chsc.c */
int c...
2019 Apr 26
0
[PATCH 05/10] s390/cio: introduce DMA pools to cio
...ubsystem_reinit(void);
extern void css_schedule_reprobe(void);
+extern void *cio_dma_zalloc(size_t size);
+extern void cio_dma_free(void *cpu_addr, size_t size);
+extern struct device *cio_get_dma_css_dev(void);
+
+struct gen_pool;
+void *cio_gp_dma_zalloc(struct gen_pool *gp_dma, struct device *dma_dev,
+ size_t size);
+void cio_gp_dma_free(struct gen_pool *gp_dma, void *cpu_addr, size_t size);
+void cio_gp_dma_destroy(struct gen_pool *gp_dma, struct device *dma_dev);
+struct gen_pool *cio_gp_dma_create(struct device *dma_dev, int nr_pages);
+
/* Function from drivers/s390/cio/chsc.c */
int c...
2023 Apr 02
2
[PATCH] virtio-vdpa: add VIRTIO_F_NOTIFICATION_DATA feature support
...otification_data(vq);
+
+ ops->kick_vq_with_data(vdpa, data);
+
+ return true;
+}
+
static irqreturn_t virtio_vdpa_config_cb(void *private)
{
struct virtio_vdpa_device *vd_dev = private;
@@ -138,6 +149,7 @@ virtio_vdpa_setup_vq(struct virtio_device *vdev, unsigned int index,
struct device *dma_dev;
const struct vdpa_config_ops *ops = vdpa->config;
struct virtio_vdpa_vq_info *info;
+ bool (*notify)(struct virtqueue *vq);
struct vdpa_callback cb;
struct virtqueue *vq;
u64 desc_addr, driver_addr, device_addr;
@@ -154,6 +166,11 @@ virtio_vdpa_setup_vq(struct virtio_device *vdev, uns...
2019 May 29
0
[PATCH v3 2/8] s390/cio: introduce DMA pools to cio
...ubsystem_reinit(void);
extern void css_schedule_reprobe(void);
+extern void *cio_dma_zalloc(size_t size);
+extern void cio_dma_free(void *cpu_addr, size_t size);
+extern struct device *cio_get_dma_css_dev(void);
+
+struct gen_pool;
+void *cio_gp_dma_zalloc(struct gen_pool *gp_dma, struct device *dma_dev,
+ size_t size);
+void cio_gp_dma_free(struct gen_pool *gp_dma, void *cpu_addr, size_t size);
+void cio_gp_dma_destroy(struct gen_pool *gp_dma, struct device *dma_dev);
+struct gen_pool *cio_gp_dma_create(struct device *dma_dev, int nr_pages);
+
/* Function from drivers/s390/cio/chsc.c */
int c...
2019 May 27
3
[PATCH v2 2/8] s390/cio: introduce DMA pools to cio
...only a single css */
This comment looks misplaced.
> +#define CIO_DMA_GFP (GFP_KERNEL | __GFP_ZERO)
> +
> +
> +struct device *cio_get_dma_css_dev(void)
> +{
> + return &channel_subsystems[0]->device;
> +}
> +
> +struct gen_pool *cio_gp_dma_create(struct device *dma_dev, int nr_pages)
> +{
> + struct gen_pool *gp_dma;
> + void *cpu_addr;
> + dma_addr_t dma_addr;
> + int i;
> +
> + gp_dma = gen_pool_create(3, -1);
> + if (!gp_dma)
> + return NULL;
> + for (i = 0; i < nr_pages; ++i) {
> + cpu_addr = dma_alloc_coherent(dma_dev, P...
2019 May 27
3
[PATCH v2 2/8] s390/cio: introduce DMA pools to cio
...only a single css */
This comment looks misplaced.
> +#define CIO_DMA_GFP (GFP_KERNEL | __GFP_ZERO)
> +
> +
> +struct device *cio_get_dma_css_dev(void)
> +{
> + return &channel_subsystems[0]->device;
> +}
> +
> +struct gen_pool *cio_gp_dma_create(struct device *dma_dev, int nr_pages)
> +{
> + struct gen_pool *gp_dma;
> + void *cpu_addr;
> + dma_addr_t dma_addr;
> + int i;
> +
> + gp_dma = gen_pool_create(3, -1);
> + if (!gp_dma)
> + return NULL;
> + for (i = 0; i < nr_pages; ++i) {
> + cpu_addr = dma_alloc_coherent(dma_dev, P...
2019 Jun 06
0
[PATCH v4 2/8] s390/cio: introduce DMA pools to cio
...k)
void channel_subsystem_reinit(void);
extern void css_schedule_reprobe(void);
+extern void *cio_dma_zalloc(size_t size);
+extern void cio_dma_free(void *cpu_addr, size_t size);
+extern struct device *cio_get_dma_css_dev(void);
+
+void *cio_gp_dma_zalloc(struct gen_pool *gp_dma, struct device *dma_dev,
+ size_t size);
+void cio_gp_dma_free(struct gen_pool *gp_dma, void *cpu_addr, size_t size);
+void cio_gp_dma_destroy(struct gen_pool *gp_dma, struct device *dma_dev);
+struct gen_pool *cio_gp_dma_create(struct device *dma_dev, int nr_pages);
+
/* Function from drivers/s390/cio/chsc.c */
int c...
2019 Jun 12
0
[PATCH v5 2/8] s390/cio: introduce DMA pools to cio
...k)
void channel_subsystem_reinit(void);
extern void css_schedule_reprobe(void);
+extern void *cio_dma_zalloc(size_t size);
+extern void cio_dma_free(void *cpu_addr, size_t size);
+extern struct device *cio_get_dma_css_dev(void);
+
+void *cio_gp_dma_zalloc(struct gen_pool *gp_dma, struct device *dma_dev,
+ size_t size);
+void cio_gp_dma_free(struct gen_pool *gp_dma, void *cpu_addr, size_t size);
+void cio_gp_dma_destroy(struct gen_pool *gp_dma, struct device *dma_dev);
+struct gen_pool *cio_gp_dma_create(struct device *dma_dev, int nr_pages);
+
/* Function from drivers/s390/cio/chsc.c */
int c...
2023 Feb 21
2
[PATCH vhost 07/10] virtio_ring: add api virtio_dma_map() for advance dma
...; Added virtio_dma_map() to map DMA addresses for virtual memory in
> > > advance. The purpose is to keep memory mapped across multiple add/get
> > > buf operations.
> >
> > I wonder if instead of exporting helpers like this, it might be simple
> > to just export dma_dev then the upper layer can use DMA API at will?
>
>
> The reason for not doing this, Virtio is not just using DMA_DEV to mapp, but
> also check whether DMA is used.
We should let the DMA API decide by exporting a correct dma_dev. E.g
when ACCESS_PLATFORM is not negotiated, advertising a...
2023 Feb 21
2
[PATCH vhost 07/10] virtio_ring: add api virtio_dma_map() for advance dma
...; Added virtio_dma_map() to map DMA addresses for virtual memory in
> > > advance. The purpose is to keep memory mapped across multiple add/get
> > > buf operations.
> >
> > I wonder if instead of exporting helpers like this, it might be simple
> > to just export dma_dev then the upper layer can use DMA API at will?
>
>
> The reason for not doing this, Virtio is not just using DMA_DEV to mapp, but
> also check whether DMA is used.
We should let the DMA API decide by exporting a correct dma_dev. E.g
when ACCESS_PLATFORM is not negotiated, advertising a...
2023 Feb 16
0
[PATCH v2] vhost/vdpa: Add MSI translation tables to iommu for software-managed MSI
...->iova + msg->size - 1))
> return -EEXIST;
> @@ -1103,6 +1110,45 @@ static ssize_t vhost_vdpa_chr_write_iter(struct kiocb *iocb,
> return vhost_chr_write_iter(dev, from);
> }
>
> +static int vhost_vdpa_resv_iommu_region(struct iommu_domain *domain, struct device *dma_dev,
> + struct vhost_iotlb *resv_iotlb)
> +{
> + struct list_head dev_resv_regions;
> + phys_addr_t resv_msi_base = 0;
> + struct iommu_resv_region *region;
> + int ret = 0;
> + bool with_sw_msi = false;
> + bool with_hw_msi = false;
> +
> + INIT_LIST_HEAD(&dev_resv_r...
2020 Aug 05
2
[PATCH v2 19/24] vdpa: make sure set_features in invoked for legacy
...t;dev, "vdpa%u", vdev->index);
> if (err)
> diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h
> index 239db794357c..29b8296f1414 100644
> --- a/include/linux/vdpa.h
> +++ b/include/linux/vdpa.h
> @@ -33,12 +33,14 @@ struct vdpa_notification_area {
> * @dma_dev: the actual device that is performing DMA
> * @config: the configuration ops for this device.
> * @index: device index
> + * @features_valid: were features initialized? for legacy guests
> */
> struct vdpa_device {
> struct device dev;
> struct device *dma_dev;...
2020 Aug 05
2
[PATCH v2 19/24] vdpa: make sure set_features in invoked for legacy
...t;dev, "vdpa%u", vdev->index);
> if (err)
> diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h
> index 239db794357c..29b8296f1414 100644
> --- a/include/linux/vdpa.h
> +++ b/include/linux/vdpa.h
> @@ -33,12 +33,14 @@ struct vdpa_notification_area {
> * @dma_dev: the actual device that is performing DMA
> * @config: the configuration ops for this device.
> * @index: device index
> + * @features_valid: were features initialized? for legacy guests
> */
> struct vdpa_device {
> struct device dev;
> struct device *dma_dev;...
2023 Mar 02
1
[PATCH vhost 07/10] virtio_ring: add api virtio_dma_map() for advance dma
...virtual memory in
> > > > > advance. The purpose is to keep memory mapped across multiple add/get
> > > > > buf operations.
> > > >
> > > > I wonder if instead of exporting helpers like this, it might be simple
> > > > to just export dma_dev then the upper layer can use DMA API at will?
> > >
> > >
> > > The reason for not doing this, Virtio is not just using DMA_DEV to mapp, but
> > > also check whether DMA is used.
> >
> > We should let the DMA API decide by exporting a correct dma_dev....
2020 Feb 10
0
[PATCH V2 3/5] vDPA: introduce vDPA bus
...dpa_dev_probe,
+ .remove = vdpa_dev_remove,
+};
+
+/**
+ * vdpa_init_device - initilaize a vDPA device
+ * This allows driver to some prepartion between after device is
+ * initialized but before vdpa_register_device()
+ * @vdev: the vdpa device to be initialized
+ * @parent: the paretn device
+ * @dma_dev: the actual device that is performing DMA
+ * @config: the bus operations support by this device
+ *
+ * Returns an error when parent/config/dma_dev is not set or fail to get
+ * ida.
+ */
+int vdpa_init_device(struct vdpa_device *vdev, struct device *parent,
+ struct device *dma_dev,
+...
2023 Mar 02
1
[PATCH vhost 07/10] virtio_ring: add api virtio_dma_map() for advance dma
...t; > > > > advance. The purpose is to keep memory mapped across multiple add/get
> > > > > > buf operations.
> > > > >
> > > > > I wonder if instead of exporting helpers like this, it might be simple
> > > > > to just export dma_dev then the upper layer can use DMA API at will?
> > > >
> > > >
> > > > The reason for not doing this, Virtio is not just using DMA_DEV to mapp, but
> > > > also check whether DMA is used.
> > >
> > > We should let the DMA API decide b...
2023 Mar 02
2
[PATCH vhost 07/10] virtio_ring: add api virtio_dma_map() for advance dma
...y mapped across multiple add/get
> > > > > > > > > buf operations.
> > > > > > > >
> > > > > > > > I wonder if instead of exporting helpers like this, it might be simple
> > > > > > > > to just export dma_dev then the upper layer can use DMA API at will?
> > > > > > >
> > > > > > >
> > > > > > > The reason for not doing this, Virtio is not just using DMA_DEV to mapp, but
> > > > > > > also check whether DMA is used.
>...
2020 Feb 20
0
[PATCH V3 3/5] vDPA: introduce vDPA bus
...v = dev_to_vdpa(d);
+
+ ida_simple_remove(&vdpa_index_ida, vdev->index);
+ kfree(vdev);
+}
+
+/**
+ * vdpa_alloc_device - allocate and initilaize a vDPA device
+ * This allows driver to some prepartion after device is
+ * initialized but before registered.
+ * @parent: the parent device
+ * @dma_dev: the actual device that is performing DMA
+ * @config: the bus operations that is supported by this device
+ *
+ * Returns an error when parent/config/dma_dev is not set or fail to get
+ * ida.
+ */
+struct vdpa_device *vdpa_alloc_device(struct device *parent,
+ struct device *dma_dev,
+...
2023 Mar 02
1
[PATCH vhost 07/10] virtio_ring: add api virtio_dma_map() for advance dma
...t; advance. The purpose is to keep memory mapped across multiple add/get
> > > > > > > buf operations.
> > > > > >
> > > > > > I wonder if instead of exporting helpers like this, it might be simple
> > > > > > to just export dma_dev then the upper layer can use DMA API at will?
> > > > >
> > > > >
> > > > > The reason for not doing this, Virtio is not just using DMA_DEV to mapp, but
> > > > > also check whether DMA is used.
> > > >
> > > > We s...