* [PATCH 0/2] clean up dma-buf-io kerneldocs
@ 2026-10-16 9:34 Pavel Begunkov
2026-10-16 9:34 ` [PATCH 1/2] dma-buf-io: fix typos in kernel docs Pavel Begunkov
2026-10-16 9:34 ` [PATCH 2/2] dma-buf-io: document dma_buf_io_init_map Pavel Begunkov
0 siblings, 2 replies; 3+ messages in thread
From: Pavel Begunkov @ 2026-10-16 9:34 UTC (permalink / raw)
To: io-uring
Cc: asml.silence, Jens Axboe, Sumit Semwal, Christian König,
linux-media, dri-devel, linaro-mm-sig
Add a kerneldoc for dma_buf_io_init_map() and clean up it overall.
Targeting the Jens' branch where dma-buf-io sits. If preferred, it
can all be squashed into
0d3120db2cbe0a ("dma-buf: introduce initial file I/O infrastructure")
Pavel Begunkov (2):
dma-buf-io: fix typos in kernel docs
dma-buf-io: document dma_buf_io_init_map
drivers/dma-buf/dma-buf-io.c | 32 ++++++++++++++++++++++----------
include/linux/dma-buf-io.h | 7 ++++---
2 files changed, 26 insertions(+), 13 deletions(-)
--
2.54.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] dma-buf-io: fix typos in kernel docs
2026-10-16 9:34 [PATCH 0/2] clean up dma-buf-io kerneldocs Pavel Begunkov
@ 2026-10-16 9:34 ` Pavel Begunkov
2026-10-16 9:34 ` [PATCH 2/2] dma-buf-io: document dma_buf_io_init_map Pavel Begunkov
1 sibling, 0 replies; 3+ messages in thread
From: Pavel Begunkov @ 2026-10-16 9:34 UTC (permalink / raw)
To: io-uring
Cc: asml.silence, Jens Axboe, Sumit Semwal, Christian König,
linux-media, dri-devel, linaro-mm-sig
Fix some typos and inconsistencies in dma-buf-io kernel docs.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
drivers/dma-buf/dma-buf-io.c | 20 ++++++++++----------
include/linux/dma-buf-io.h | 7 ++++---
2 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/drivers/dma-buf/dma-buf-io.c b/drivers/dma-buf/dma-buf-io.c
index 21296bd3dde1..e432194a5dfc 100644
--- a/drivers/dma-buf/dma-buf-io.c
+++ b/drivers/dma-buf/dma-buf-io.c
@@ -106,7 +106,7 @@ static struct dma_buf_io_map *__dma_buf_io_create_map(struct dma_buf_io_ctx *ctx
* @ctx: [in] dma-buf I/O context
*
* A slow path part of dma_buf_io_get_map() and shouldn't be used directly.
- * Behaves in the same way but allowed to block.
+ * Behaves in the same way but is allowed to block.
*
* Returns a map on success, or ERR_PTR encoded errno otherwise.
*/
@@ -133,16 +133,16 @@ static void dma_buf_io_ctx_shutdown(struct dma_buf_io_ctx *ctx)
}
/*
- * dma_buf_io_ctx_create - create a new dma-buf I/O context for the given file.
+ * dma_buf_io_ctx_create - Create a new dma-buf I/O context for the given file.
* @file: [in] file for which the context is created
* @dmabuf: [in] buffer to create a context from
* @dir: [in] direction of DMA transfers
- * @out_ctx [out] resulting ctx
+ * @out_ctx: [out] resulting ctx
*
* Create a new I/O context from the given DMA buffer for the given file.
* It only works with files implementing ->init_dma_buf_io_ctx and fails
* with -EOPNOTSUPP otherwise. Once created, the user can create a map
- * and use it to issue I/O like read / write requests to @file.
+ * and use it to issue I/O, such as read/write requests, to @file.
*/
int dma_buf_io_ctx_create(struct file *file,
struct dma_buf *dmabuf,
@@ -180,7 +180,7 @@ int dma_buf_io_ctx_create(struct file *file,
}
/**
- * dma_buf_io_ctx_release - destroy the I/O context
+ * dma_buf_io_ctx_release - Destroy the I/O context
* @ctx: [in] dma-buf I/O context
*
* Destroy the context. It makes sure all maps are waited on and destroyed,
@@ -201,11 +201,11 @@ void dma_buf_io_ctx_release(struct dma_buf_io_ctx *ctx)
}
/**
- * dma_buf_io_invalidate_mappings - invalidate the current map
+ * dma_buf_io_invalidate_mappings - Invalidate the current map
* @ctx: [in] dma-buf I/O context
*
* Importer's helper for invalidating the current map. Waits for all I/O
- * using the map to complete and destroyes the map. Called with the
+ * using the map to complete and destroys the map. Called with the
* dma-buf reservation lock held.
*/
void dma_buf_io_invalidate_mappings(struct dma_buf_io_ctx *ctx)
@@ -215,11 +215,11 @@ void dma_buf_io_invalidate_mappings(struct dma_buf_io_ctx *ctx)
EXPORT_SYMBOL_NS_GPL(dma_buf_io_invalidate_mappings, "DMA_BUF");
/**
- * dma_buf_io_detach - detach the @ctx from the importer.
+ * dma_buf_io_detach - Detach the @ctx from the importer.
* @ctx: [in] dma-buf I/O context
*
- * Importer's helper for removing the I/O ctx. It kills all maps and
- * prevents creation of new ones. Upon return it's safe for the importer
+ * Importer's helper for removing the I/O context. It kills all maps and
+ * prevents creation of new ones. Upon return, it's safe for the importer
* to release all its resources such as dma-buf attachments.
*/
void dma_buf_io_detach(struct dma_buf_io_ctx *ctx)
diff --git a/include/linux/dma-buf-io.h b/include/linux/dma-buf-io.h
index b9bbeca1744f..d9f27650a851 100644
--- a/include/linux/dma-buf-io.h
+++ b/include/linux/dma-buf-io.h
@@ -60,6 +60,7 @@ void dma_buf_io_ctx_release(struct dma_buf_io_ctx *ctx);
struct dma_buf_io_map *dma_buf_io_create_map(struct dma_buf_io_ctx *ctx);
+/* Internal helper, see dma_buf_io_get_map() */
static inline struct dma_buf_io_map *
__dma_buf_io_get_map(struct dma_buf_io_ctx *ctx)
{
@@ -79,10 +80,10 @@ __dma_buf_io_get_map(struct dma_buf_io_ctx *ctx)
* @ctx: [in] dma-buf I/O context
* @nowait: [in] specifies whether it's allowed to block
*
- * Create a new or acquire an existing map. When succeeds, it returns
+ * Create a new or acquire an existing map. On success, it returns
* a referenced map, which should eventually be put down with
* dma_buf_io_map_drop(). If @nowait is set and the function would block,
- * it return -EAGAIN, and the caller is expected to retry from a context
+ * it returns -EAGAIN, and the caller is expected to retry from a context
* where blocking is allowed.
*
* Returns a map on success, or ERR_PTR encoded errno otherwise.
@@ -105,7 +106,7 @@ dma_buf_io_get_map(struct dma_buf_io_ctx *ctx, bool nowait)
* dma_buf_io_map_drop - Drop the map.
* @map: [in] dma-buf I/O map
*
- * Put down a reference for the @map acquired via dma_buf_io_get_map().
+ * Put down a reference to the @map acquired via dma_buf_io_get_map().
* Should be called as soon as I/O is completed.
*/
static inline void dma_buf_io_map_drop(struct dma_buf_io_map *map)
--
2.54.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] dma-buf-io: document dma_buf_io_init_map
2026-10-16 9:34 [PATCH 0/2] clean up dma-buf-io kerneldocs Pavel Begunkov
2026-10-16 9:34 ` [PATCH 1/2] dma-buf-io: fix typos in kernel docs Pavel Begunkov
@ 2026-10-16 9:34 ` Pavel Begunkov
1 sibling, 0 replies; 3+ messages in thread
From: Pavel Begunkov @ 2026-10-16 9:34 UTC (permalink / raw)
To: io-uring
Cc: asml.silence, Jens Axboe, Sumit Semwal, Christian König,
linux-media, dri-devel, linaro-mm-sig
Add a kerneldoc for dma_buf_io_init_map().
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
drivers/dma-buf/dma-buf-io.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/dma-buf/dma-buf-io.c b/drivers/dma-buf/dma-buf-io.c
index e432194a5dfc..f724936e223b 100644
--- a/drivers/dma-buf/dma-buf-io.c
+++ b/drivers/dma-buf/dma-buf-io.c
@@ -43,6 +43,18 @@ static void dma_buf_io_kill_map(struct dma_buf_io_ctx *ctx)
dma_buf_io_map_release(map);
}
+/**
+ * dma_buf_io_init_map - Initialise the map.
+ * @ctx: [in] dma-buf I/O context the map is created for
+ * @map: [in] dma-buf I/O map
+ * @sgt: [in] the backing scatter-gather table
+ *
+ * Importer's helper that initialises @map for the provided I/O context
+ * and scatter-gather table. The importer should call it once for each map
+ * on creation.
+ *
+ * Returns a map on success, or a negative errno code otherwise.
+ */
int dma_buf_io_init_map(struct dma_buf_io_ctx *ctx, struct dma_buf_io_map *map,
struct sg_table *sgt)
{
--
2.54.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-10-16 9:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-16 9:34 [PATCH 0/2] clean up dma-buf-io kerneldocs Pavel Begunkov
2026-10-16 9:34 ` [PATCH 1/2] dma-buf-io: fix typos in kernel docs Pavel Begunkov
2026-10-16 9:34 ` [PATCH 2/2] dma-buf-io: document dma_buf_io_init_map Pavel Begunkov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox