* [PATCH] gpu: host1x: Set up device DMA parameters
@ 2024-09-16 13:33 Thierry Reding
2024-09-16 14:58 ` Christoph Hellwig
2024-09-25 19:27 ` Thierry Reding
0 siblings, 2 replies; 4+ messages in thread
From: Thierry Reding @ 2024-09-16 13:33 UTC (permalink / raw)
To: Thierry Reding; +Cc: Jon Hunter, Christoph Hellwig, dri-devel, linux-tegra
From: Thierry Reding <treding@nvidia.com>
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.
Reported-by: Jonathan Hunter <jonathanh@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
drivers/gpu/host1x/context.c | 1 +
include/linux/host1x.h | 1 +
2 files changed, 2 insertions(+)
diff --git a/drivers/gpu/host1x/context.c b/drivers/gpu/host1x/context.c
index 955c971c528d..a6f6779662a3 100644
--- a/drivers/gpu/host1x/context.c
+++ b/drivers/gpu/host1x/context.c
@@ -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);
diff --git a/include/linux/host1x.h b/include/linux/host1x.h
index 9c8119ed13a4..c4dde3aafcac 100644
--- a/include/linux/host1x.h
+++ b/include/linux/host1x.h
@@ -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;
--
2.45.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] gpu: host1x: Set up device DMA parameters
2024-09-16 13:33 [PATCH] gpu: host1x: Set up device DMA parameters Thierry Reding
@ 2024-09-16 14:58 ` Christoph Hellwig
2024-09-19 6:41 ` Jon Hunter
2024-09-25 19:27 ` Thierry Reding
1 sibling, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2024-09-16 14:58 UTC (permalink / raw)
To: Thierry Reding; +Cc: Jon Hunter, Christoph Hellwig, dri-devel, linux-tegra
On Mon, Sep 16, 2024 at 03:33:20PM +0200, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
>
> 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.
>
> Reported-by: Jonathan Hunter <jonathanh@nvidia.com>
> Signed-off-by: Thierry Reding <treding@nvidia.com>
Looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
I guess this another thing caught by the WARN_ON in the dma_set*
functions?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] gpu: host1x: Set up device DMA parameters
2024-09-16 14:58 ` Christoph Hellwig
@ 2024-09-19 6:41 ` Jon Hunter
0 siblings, 0 replies; 4+ messages in thread
From: Jon Hunter @ 2024-09-19 6:41 UTC (permalink / raw)
To: Christoph Hellwig, Thierry Reding; +Cc: dri-devel, linux-tegra
On 16/09/2024 15:58, Christoph Hellwig wrote:
> On Mon, Sep 16, 2024 at 03:33:20PM +0200, Thierry Reding wrote:
>> From: Thierry Reding <treding@nvidia.com>
>>
>> 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.
>>
>> Reported-by: Jonathan Hunter <jonathanh@nvidia.com>
>> Signed-off-by: Thierry Reding <treding@nvidia.com>
>
> Looks good:
>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
>
> I guess this another thing caught by the WARN_ON in the dma_set*
> functions?
Yes indeed! This works for me.
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Thanks
Jon
--
nvpublic
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] gpu: host1x: Set up device DMA parameters
2024-09-16 13:33 [PATCH] gpu: host1x: Set up device DMA parameters Thierry Reding
2024-09-16 14:58 ` Christoph Hellwig
@ 2024-09-25 19:27 ` Thierry Reding
1 sibling, 0 replies; 4+ messages in thread
From: Thierry Reding @ 2024-09-25 19:27 UTC (permalink / raw)
To: Jon Hunter, Christoph Hellwig, dri-devel, linux-tegra
[-- Attachment #1: Type: text/plain, Size: 596 bytes --]
On Mon, Sep 16, 2024 at 03:33:20PM GMT, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
>
> 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.
>
> Reported-by: Jonathan Hunter <jonathanh@nvidia.com>
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
> drivers/gpu/host1x/context.c | 1 +
> include/linux/host1x.h | 1 +
> 2 files changed, 2 insertions(+)
Applied.
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-09-25 19:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-16 13:33 [PATCH] gpu: host1x: Set up device DMA parameters Thierry Reding
2024-09-16 14:58 ` Christoph Hellwig
2024-09-19 6:41 ` Jon Hunter
2024-09-25 19:27 ` Thierry Reding
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox