Skip to contentSkip to conversation

gpu: host1x: Set up device DMA parameters

PATCH Applied Thierry Reding 3 participants 4 messages Sep 16, 2024 – Sep 25, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpu: host1x: Set up device DMA parameters

From: Thierry Reding <[email protected]>

In order to store device DMA parameters, the DMA framework depends on the device's dma_parms field to point at a valid memory location. Add backing storage for this in struct host1x_memory_context and point to it.

---
 drivers/gpu/host1x/context.c | 1 +
 include/linux/host1x.h       | 1 +
 2 files changed, 2 insertions(+)
drivers/gpu/host1x/context.c +1 -0
index 955c971c528d..a6f6779662a3 100644
@@ -58,6 +58,7 @@ int host1x_memory_context_list_init(struct host1x *host1x)
 		ctx->dev.parent = host1x->dev;
 		ctx->dev.release = host1x_memory_context_release;
 
+		ctx->dev.dma_parms = &ctx->dma_parms;
 		dma_set_max_seg_size(&ctx->dev, UINT_MAX);
 
 		err = device_add(&ctx->dev);
include/linux/host1x.h +1 -0
index 9c8119ed13a4..c4dde3aafcac 100644
@@ -466,6 +466,7 @@ struct host1x_memory_context {
 	refcount_t ref;
 	struct pid *owner;
 
+	struct device_dma_parameters dma_parms;
 	struct device dev;
 	u64 dma_mask;
 	u32 stream_id;
Signature · 1 line
2.45.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Thierry Reding

From: Thierry Reding <[email protected]>

In order to store device DMA parameters, the DMA framework depends on the device's dma_parms field to point at a valid memory location. Add backing storage for this in struct host1x_memory_context and point to it.

Looks good:

I guess this another thing caught by the WARN_ON in the dma_set* functions?

maintainer Tested-by
#2 lore raw
Quoted 11 lines · Christoph Hellwig
Quoted 9 lines · Thierry Reding

From: Thierry Reding <[email protected]>

In order to store device DMA parameters, the DMA framework depends on the device's dma_parms field to point at a valid memory location. Add backing storage for this in struct host1x_memory_context and point to it.

Quoted 6 lines

Looks good:

I guess this another thing caught by the WARN_ON in the dma_set* functions?

Yes indeed! This works for me.

Thanks
Jon

Signature · 1 line
nvpublic
author Applied
#3 lore raw
In reply to Thierry Reding
Quoted 7 lines · Thierry Reding

From: Thierry Reding <[email protected]>

In order to store device DMA parameters, the DMA framework depends on the device's dma_parms field to point at a valid memory location. Add backing storage for this in struct host1x_memory_context and point to it.

Quoted 6 lines
---
 drivers/gpu/host1x/context.c | 1 +
 include/linux/host1x.h       | 1 +
 2 files changed, 2 insertions(+)

Applied.

Thierry