@@ -405,7 +405,6 @@ struct dma_buf *dma_buf_export(const struct dma_buf_export_info *exp_info)
405405 || !exp_info -> ops -> map_dma_buf
406406 || !exp_info -> ops -> unmap_dma_buf
407407 || !exp_info -> ops -> release
408- || !exp_info -> ops -> map_atomic
409408 || !exp_info -> ops -> map
410409 || !exp_info -> ops -> mmap )) {
411410 return ERR_PTR (- EINVAL );
@@ -687,26 +686,14 @@ EXPORT_SYMBOL_GPL(dma_buf_unmap_attachment);
687686 * void \*dma_buf_kmap(struct dma_buf \*, unsigned long);
688687 * void dma_buf_kunmap(struct dma_buf \*, unsigned long, void \*);
689688 *
690- * There are also atomic variants of these interfaces. Like for kmap they
691- * facilitate non-blocking fast-paths. Neither the importer nor the exporter
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).
689+ * Implementing the functions is optional for exporters and for importers all
690+ * the restrictions of using kmap apply.
701691 *
702692 * dma_buf kmap calls outside of the range specified in begin_cpu_access are
703693 * undefined. If the range is not PAGE_SIZE aligned, kmap needs to succeed on
704694 * the partial chunks at the beginning and end but may return stale or bogus
705695 * data outside of the range (in these partial chunks).
706696 *
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- *
710697 * For some cases the overhead of kmap can be too high, a vmap interface
711698 * is introduced. This interface should be used very carefully, as vmalloc
712699 * space is a limited resources on many architectures.
@@ -859,43 +846,6 @@ int dma_buf_end_cpu_access(struct dma_buf *dmabuf,
859846}
860847EXPORT_SYMBOL_GPL (dma_buf_end_cpu_access );
861848
862- /**
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-
899849/**
900850 * dma_buf_kmap - Map a page of the buffer object into kernel address space. The
901851 * same restrictions as for kmap and friends apply.
0 commit comments