search for: set_dma_ops

Displaying 20 results from an estimated 94 matches for "set_dma_ops".

Did you mean: get_dma_ops
2020 Apr 05
4
[PATCH] vdpa-sim: depend on HAS_DMA
set_dma_ops isn't available on all architectures: make ARCH=um ... drivers/vdpa/vdpa_sim/vdpa_sim.c: In function 'vdpasim_create': >> drivers/vdpa/vdpa_sim/vdpa_sim.c:324:2: error: implicit declaration of function 'set_dma_ops'; did you mean 'set_groups'? +[-Werro...
2020 Apr 05
4
[PATCH] vdpa-sim: depend on HAS_DMA
set_dma_ops isn't available on all architectures: make ARCH=um ... drivers/vdpa/vdpa_sim/vdpa_sim.c: In function 'vdpasim_create': >> drivers/vdpa/vdpa_sim/vdpa_sim.c:324:2: error: implicit declaration of function 'set_dma_ops'; did you mean 'set_groups'? +[-Werro...
2018 Jul 20
3
[RFC 4/4] virtio: Add platform specific DMA API translation for virito devices
...dev) > +{ > +} > +#endif > + > int virtio_finalize_features(struct virtio_device *dev) > { > int ret = dev->config->finalize_features(dev); > @@ -179,6 +185,7 @@ int virtio_finalize_features(struct virtio_device *dev) > if (virtio_has_iommu_quirk(dev)) > set_dma_ops(dev->dev.parent, &virtio_direct_dma_ops); > > + platform_override_dma_ops(dev); Is there a single place where virtio_has_iommu_quirk is called now? If so, we could put this into virtio_has_iommu_quirk then. > if (!virtio_has_feature(dev, VIRTIO_F_VERSION_1)) > return 0;...
2018 Jul 20
3
[RFC 4/4] virtio: Add platform specific DMA API translation for virito devices
...dev) > +{ > +} > +#endif > + > int virtio_finalize_features(struct virtio_device *dev) > { > int ret = dev->config->finalize_features(dev); > @@ -179,6 +185,7 @@ int virtio_finalize_features(struct virtio_device *dev) > if (virtio_has_iommu_quirk(dev)) > set_dma_ops(dev->dev.parent, &virtio_direct_dma_ops); > > + platform_override_dma_ops(dev); Is there a single place where virtio_has_iommu_quirk is called now? If so, we could put this into virtio_has_iommu_quirk then. > if (!virtio_has_feature(dev, VIRTIO_F_VERSION_1)) > return 0;...
2018 Jul 23
0
[RFC 4/4] virtio: Add platform specific DMA API translation for virito devices
...endif >> + >> int virtio_finalize_features(struct virtio_device *dev) >> { >> int ret = dev->config->finalize_features(dev); >> @@ -179,6 +185,7 @@ int virtio_finalize_features(struct virtio_device *dev) >> if (virtio_has_iommu_quirk(dev)) >> set_dma_ops(dev->dev.parent, &virtio_direct_dma_ops); >> >> + platform_override_dma_ops(dev); > > Is there a single place where virtio_has_iommu_quirk is called now? Not other than this one. But in the proposed implementation of platform_override_dma_ops on powerpc, we will again c...
2018 Apr 25
1
[PATCH v2 3/5] ARM: dma-mapping: Implement arch_iommu_detach_device()
...pping *mapping = to_dma_iommu_mapping(dev); > + const struct dma_map_ops *dma_ops; > + > + if (!mapping) > + return; > + > + arm_iommu_release_mapping(mapping); > + arm_iommu_detach_device(dev); > + > + dma_ops = arm_get_dma_map_ops(dev->archdata.dma_coherent); > + set_dma_ops(dev, dma_ops); Why not simply: set_dma_ops(dev, arm_get_dma_map_ops(dev->archdata.dma_coherent));
2019 Sep 17
1
[RFC PATCH 2/4] mdev: introduce helper to set per device dma ops
On Tue, 10 Sep 2019 16:19:33 +0800 Jason Wang <jasowang at redhat.com> wrote: > This patch introduces mdev_set_dma_ops() which allows parent to set > per device DMA ops. This help for the kernel driver to setup a correct > DMA mappings. > > Signed-off-by: Jason Wang <jasowang at redhat.com> > --- > drivers/vfio/mdev/mdev_core.c | 7 +++++++ > include/linux/mdev.h | 2 ++ > 2...
2018 Jul 30
1
[RFC 2/4] virtio: Override device's DMA OPS with virtio_direct_dma_ops selectively
> > + > > + if (xen_domain()) > > + goto skip_override; > > + > > + if (virtio_has_iommu_quirk(dev)) > > + set_dma_ops(dev->dev.parent, &virtio_direct_dma_ops); > > + > > + skip_override: > > + > > I prefer normal if scoping as opposed to goto spaghetti pls. > Better yet move vring_use_dma_api here and use it. > Less of a chance something will break. I agree about avoid pointl...
2018 Apr 25
5
[PATCH 1/4] drm/nouveau: tegra: Detach from ARM DMA/IOMMU mapping
...signed long pgsize_bitmap; int ret; +#if IS_ENABLED(CONFIG_ARM_DMA_USE_IOMMU) + if (dev->archdata.mapping) { + struct dma_iommu_mapping *mapping = to_dma_iommu_mapping(dev); + + arm_iommu_release_mapping(mapping); + arm_iommu_detach_device(dev); + + if (dev->archdata.dma_coherent) + set_dma_ops(dev, &arm_coherent_dma_ops); + else + set_dma_ops(dev, &arm_dma_ops); + } +#endif + if (!tdev->func->iommu_bit) return; -- 2.17.0
2018 Jul 02
1
[PATCH v4 1/2] ARM: dma-mapping: Set proper DMA ops in arm_iommu_detach_device()
...o_to_prot(enum dma_data_direction dir, unsigned long attrs) > @@ -2296,7 +2301,7 @@ void arm_iommu_detach_device(struct device *dev) > iommu_detach_device(mapping->domain, dev); > kref_put(&mapping->kref, release_iommu_mapping); > to_dma_iommu_mapping(dev) = NULL; > - set_dma_ops(dev, NULL); > + set_dma_ops(dev, arm_get_dma_map_ops(dev->archdata.dma_coherent)); > > pr_debug("Detached IOMMU controller from %s device.\n", dev_name(dev)); > } > @@ -2357,11 +2362,6 @@ static void arm_teardown_iommu_dma_ops(struct device *dev) { } > > #e...
2018 Apr 23
1
[PATCH] drm/nouveau: tegra: Detach from ARM DMA/IOMMU mapping
...signed long pgsize_bitmap; int ret; +#if IS_ENABLED(CONFIG_ARM_DMA_USE_IOMMU) + if (dev->archdata.mapping) { + struct dma_iommu_mapping *mapping = to_dma_iommu_mapping(dev); + + arm_iommu_release_mapping(mapping); + arm_iommu_detach_device(dev); + + if (dev->archdata.dma_coherent) + set_dma_ops(dev, &arm_coherent_dma_ops); + else + set_dma_ops(dev, &arm_dma_ops); + } +#endif + if (!tdev->func->iommu_bit) return; -- 2.17.0
2018 May 30
2
[PATCH v3 1/2] ARM: dma-mapping: Implement arm_dma_iommu_detach_device()
...t; + > + arm_iommu_release_mapping(mapping); Potentially freeing the mapping before you try to operate on it is never the best idea. Plus arm_iommu_detach_device() already releases a reference appropriately anyway, so it's a double-free. > + arm_iommu_detach_device(dev); > + > + set_dma_ops(dev, arm_get_dma_map_ops(dev->archdata.dma_coherent)); > +#endif > +} > +EXPORT_SYMBOL(arm_dma_iommu_detach_device); I really don't see why we need an extra function that essentially just duplicates arm_iommu_detach_device(). The only real difference here is that here you reset t...
2020 Apr 06
0
[PATCH v2 1/2] vdpa-sim: depend on HAS_DMA
set_dma_ops isn't available on all architectures: make ARCH=um ... drivers/vdpa/vdpa_sim/vdpa_sim.c: In function 'vdpasim_create': >> drivers/vdpa/vdpa_sim/vdpa_sim.c:324:2: error: implicit declaration of function 'set_dma_ops'; did you mean 'set_groups'? +[-Werro...
2016 Dec 09
2
[PATCH 3/5] Move dma_ops from archdata into struct device
We'll need a bit of a wieder audience for this I think.. On Wed, Dec 07, 2016 at 05:11:28PM -0800, Bart Van Assche wrote: > Additionally, introduce set_dma_ops(). A later patch will introduce a > call to that function in the RDMA drivers that will be modified to use > dma_noop_ops. This looks good to me, and we had a lot of talk about this for other purposes for a while.
2016 Dec 09
2
[PATCH 3/5] Move dma_ops from archdata into struct device
We'll need a bit of a wieder audience for this I think.. On Wed, Dec 07, 2016 at 05:11:28PM -0800, Bart Van Assche wrote: > Additionally, introduce set_dma_ops(). A later patch will introduce a > call to that function in the RDMA drivers that will be modified to use > dma_noop_ops. This looks good to me, and we had a lot of talk about this for other purposes for a while.
2018 May 30
0
[PATCH v3 1/2] ARM: dma-mapping: Implement arm_dma_iommu_detach_device()
...t it? In the above, the arm_iommu_release_mapping() is supposed to drop the final reference which was obtained by arm_iommu_create_mapping(). The mapping shouldn't go away irrespective of the order in which these will be called. > > + arm_iommu_detach_device(dev); > > + > > + set_dma_ops(dev, arm_get_dma_map_ops(dev->archdata.dma_coherent)); > > +#endif > > +} > > +EXPORT_SYMBOL(arm_dma_iommu_detach_device); > > I really don't see why we need an extra function that essentially just > duplicates arm_iommu_detach_device(). The only real difference h...
2018 Jul 28
3
[RFC 2/4] virtio: Override device's DMA OPS with virtio_direct_dma_ops selectively
...nt virtio_finalize_features(struct virtio_device *dev) { int ret = dev->config->finalize_features(dev); @@ -174,6 +176,9 @@ int virtio_finalize_features(struct virtio_device *dev) if (ret) return ret; + + if (xen_domain()) + goto skip_override; + + if (virtio_has_iommu_quirk(dev)) + set_dma_ops(dev->dev.parent, &virtio_direct_dma_ops); + + skip_override: + if (!virtio_has_feature(dev, VIRTIO_F_VERSION_1)) return 0 Will incorporate these changes in the next version.
2018 Jul 28
3
[RFC 2/4] virtio: Override device's DMA OPS with virtio_direct_dma_ops selectively
...nt virtio_finalize_features(struct virtio_device *dev) { int ret = dev->config->finalize_features(dev); @@ -174,6 +176,9 @@ int virtio_finalize_features(struct virtio_device *dev) if (ret) return ret; + + if (xen_domain()) + goto skip_override; + + if (virtio_has_iommu_quirk(dev)) + set_dma_ops(dev->dev.parent, &virtio_direct_dma_ops); + + skip_override: + if (!virtio_has_feature(dev, VIRTIO_F_VERSION_1)) return 0 Will incorporate these changes in the next version.
2018 May 30
8
[PATCH v4 0/2] drm/nouveau: tegra: Detach from ARM DMA/IOMMU mapping
From: Thierry Reding <treding at nvidia.com> An unfortunate interaction between the 32-bit ARM DMA/IOMMU mapping code and Tegra SMMU driver changes to support IOMMU groups introduced a boot- time regression on Tegra124. This was caught very late because none of the standard configurations that are tested on Tegra enable the ARM DMA/ IOMMU mapping code since it is not needed. The reason for
2018 Apr 25
11
[PATCH v2 1/5] drm/nouveau: tegra: Detach from ARM DMA/IOMMU mapping
...signed long pgsize_bitmap; int ret; +#if IS_ENABLED(CONFIG_ARM_DMA_USE_IOMMU) + if (dev->archdata.mapping) { + struct dma_iommu_mapping *mapping = to_dma_iommu_mapping(dev); + + arm_iommu_release_mapping(mapping); + arm_iommu_detach_device(dev); + + if (dev->archdata.dma_coherent) + set_dma_ops(dev, &arm_coherent_dma_ops); + else + set_dma_ops(dev, &arm_dma_ops); + } +#endif + if (!tdev->func->iommu_bit) return; -- 2.17.0