diff options
author | Christian König <christian.koenig@amd.com> | 2018-05-28 07:34:01 -0400 |
---|---|---|
committer | Christian König <easy2remember.chk@googlemail.com> | 2018-06-20 09:59:34 -0400 |
commit | f664a52695429b68afb4e130a0f69cd5fd1fec86 (patch) | |
tree | 3d16603cc6349636f191c027a517a7539adc8545 /drivers/dma-buf/dma-buf.c | |
parent | a19741e5e5a9f1f02f8e3c037bde7d73d4bfae9c (diff) |
dma-buf: remove kmap_atomic interface
Neither used nor correctly implemented anywhere. Just completely remove
the interface.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: https://patchwork.freedesktop.org/patch/226645/
Diffstat (limited to 'drivers/dma-buf/dma-buf.c')
-rw-r--r-- | drivers/dma-buf/dma-buf.c | 54 |
1 files changed, 2 insertions, 52 deletions
diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c index 50771063c617..13884474d158 100644 --- a/drivers/dma-buf/dma-buf.c +++ b/drivers/dma-buf/dma-buf.c | |||
@@ -405,7 +405,6 @@ struct dma_buf *dma_buf_export(const struct dma_buf_export_info *exp_info) | |||
405 | || !exp_info->ops->map_dma_buf | 405 | || !exp_info->ops->map_dma_buf |
406 | || !exp_info->ops->unmap_dma_buf | 406 | || !exp_info->ops->unmap_dma_buf |
407 | || !exp_info->ops->release | 407 | || !exp_info->ops->release |
408 | || !exp_info->ops->map_atomic | ||
409 | || !exp_info->ops->map | 408 | || !exp_info->ops->map |
410 | || !exp_info->ops->mmap)) { | 409 | || !exp_info->ops->mmap)) { |
411 | return ERR_PTR(-EINVAL); | 410 | return ERR_PTR(-EINVAL); |
@@ -687,26 +686,14 @@ EXPORT_SYMBOL_GPL(dma_buf_unmap_attachment); | |||
687 | * void \*dma_buf_kmap(struct dma_buf \*, unsigned long); | 686 | * void \*dma_buf_kmap(struct dma_buf \*, unsigned long); |
688 | * void dma_buf_kunmap(struct dma_buf \*, unsigned long, void \*); | 687 | * void dma_buf_kunmap(struct dma_buf \*, unsigned long, void \*); |
689 | * | 688 | * |
690 | * There are also atomic variants of these interfaces. Like for kmap they | 689 | * Implementing the functions is optional for exporters and for importers all |
691 | * facilitate non-blocking fast-paths. Neither the importer nor the exporter | 690 | * the restrictions of using kmap apply. |
692 | * (in the callback) is allowed to block when using these. | ||
693 | * | ||
694 | * Interfaces:: | ||
695 | * void \*dma_buf_kmap_atomic(struct dma_buf \*, unsigned long); | ||
696 | * void dma_buf_kunmap_atomic(struct dma_buf \*, unsigned long, void \*); | ||
697 | * | ||
698 | * For importers all the restrictions of using kmap apply, like the limited | ||
699 | * supply of kmap_atomic slots. Hence an importer shall only hold onto at | ||
700 | * max 2 atomic dma_buf kmaps at the same time (in any given process context). | ||
701 | * | 691 | * |
702 | * dma_buf kmap calls outside of the range specified in begin_cpu_access are | 692 | * dma_buf kmap calls outside of the range specified in begin_cpu_access are |
703 | * undefined. If the range is not PAGE_SIZE aligned, kmap needs to succeed on | 693 | * undefined. If the range is not PAGE_SIZE aligned, kmap needs to succeed on |
704 | * the partial chunks at the beginning and end but may return stale or bogus | 694 | * the partial chunks at the beginning and end but may return stale or bogus |
705 | * data outside of the range (in these partial chunks). | 695 | * data outside of the range (in these partial chunks). |
706 | * | 696 | * |
707 | * Note that these calls need to always succeed. The exporter needs to | ||
708 | * complete any preparations that might fail in begin_cpu_access. | ||
709 | * | ||
710 | * For some cases the overhead of kmap can be too high, a vmap interface | 697 | * For some cases the overhead of kmap can be too high, a vmap interface |
711 | * is introduced. This interface should be used very carefully, as vmalloc | 698 | * is introduced. This interface should be used very carefully, as vmalloc |
712 | * space is a limited resources on many architectures. | 699 | * space is a limited resources on many architectures. |
@@ -860,43 +847,6 @@ int dma_buf_end_cpu_access(struct dma_buf *dmabuf, | |||
860 | EXPORT_SYMBOL_GPL(dma_buf_end_cpu_access); | 847 | EXPORT_SYMBOL_GPL(dma_buf_end_cpu_access); |
861 | 848 | ||
862 | /** | 849 | /** |
863 | * dma_buf_kmap_atomic - Map a page of the buffer object into kernel address | ||
864 | * space. The same restrictions as for kmap_atomic and friends apply. | ||
865 | * @dmabuf: [in] buffer to map page from. | ||
866 | * @page_num: [in] page in PAGE_SIZE units to map. | ||
867 | * | ||
868 | * This call must always succeed, any necessary preparations that might fail | ||
869 | * need to be done in begin_cpu_access. | ||
870 | */ | ||
871 | void *dma_buf_kmap_atomic(struct dma_buf *dmabuf, unsigned long page_num) | ||
872 | { | ||
873 | WARN_ON(!dmabuf); | ||
874 | |||
875 | if (!dmabuf->ops->map_atomic) | ||
876 | return NULL; | ||
877 | return dmabuf->ops->map_atomic(dmabuf, page_num); | ||
878 | } | ||
879 | EXPORT_SYMBOL_GPL(dma_buf_kmap_atomic); | ||
880 | |||
881 | /** | ||
882 | * dma_buf_kunmap_atomic - Unmap a page obtained by dma_buf_kmap_atomic. | ||
883 | * @dmabuf: [in] buffer to unmap page from. | ||
884 | * @page_num: [in] page in PAGE_SIZE units to unmap. | ||
885 | * @vaddr: [in] kernel space pointer obtained from dma_buf_kmap_atomic. | ||
886 | * | ||
887 | * This call must always succeed. | ||
888 | */ | ||
889 | void dma_buf_kunmap_atomic(struct dma_buf *dmabuf, unsigned long page_num, | ||
890 | void *vaddr) | ||
891 | { | ||
892 | WARN_ON(!dmabuf); | ||
893 | |||
894 | if (dmabuf->ops->unmap_atomic) | ||
895 | dmabuf->ops->unmap_atomic(dmabuf, page_num, vaddr); | ||
896 | } | ||
897 | EXPORT_SYMBOL_GPL(dma_buf_kunmap_atomic); | ||
898 | |||
899 | /** | ||
900 | * dma_buf_kmap - Map a page of the buffer object into kernel address space. The | 850 | * dma_buf_kmap - Map a page of the buffer object into kernel address space. The |
901 | * same restrictions as for kmap and friends apply. | 851 | * same restrictions as for kmap and friends apply. |
902 | * @dmabuf: [in] buffer to map page from. | 852 | * @dmabuf: [in] buffer to map page from. |