diff mbox series

firmware: arm_ffa: Set dma_mask for ffa devices

Message ID e3dd8042ac680bd74b6580c25df855d092079c18.1737107520.git.viresh.kumar@linaro.org (mailing list archive)
State New, archived
Headers show
Series firmware: arm_ffa: Set dma_mask for ffa devices | expand

Commit Message

Viresh Kumar Jan. 17, 2025, 10:05 a.m. UTC
Set dma_mask for FFA devices, otherwise DMA allocation using the device pointer
lead to following warning:

WARNING: CPU: 1 PID: 1 at kernel/dma/mapping.c:597 dma_alloc_attrs+0xe0/0x124

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/firmware/arm_ffa/bus.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Sudeep Holla Jan. 17, 2025, 10:09 a.m. UTC | #1
On Fri, Jan 17, 2025 at 03:35:52PM +0530, Viresh Kumar wrote:
> Set dma_mask for FFA devices, otherwise DMA allocation using the device pointer
> lead to following warning:
> 
> WARNING: CPU: 1 PID: 1 at kernel/dma/mapping.c:597 dma_alloc_attrs+0xe0/0x124
>

Looks good, will add to my queue after next -rc1.
Viresh Kumar Feb. 28, 2025, 8:27 a.m. UTC | #2
On 17-01-25, 10:09, Sudeep Holla wrote:
> On Fri, Jan 17, 2025 at 03:35:52PM +0530, Viresh Kumar wrote:
> > Set dma_mask for FFA devices, otherwise DMA allocation using the device pointer
> > lead to following warning:
> > 
> > WARNING: CPU: 1 PID: 1 at kernel/dma/mapping.c:597 dma_alloc_attrs+0xe0/0x124
> >
> 
> Looks good, will add to my queue after next -rc1.

Ping.
Sudeep Holla Feb. 28, 2025, 9:21 a.m. UTC | #3
On Fri, Feb 28, 2025 at 01:57:45PM +0530, Viresh Kumar wrote:
> On 17-01-25, 10:09, Sudeep Holla wrote:
> > On Fri, Jan 17, 2025 at 03:35:52PM +0530, Viresh Kumar wrote:
> > > Set dma_mask for FFA devices, otherwise DMA allocation using the device pointer
> > > lead to following warning:
> > > 
> > > WARNING: CPU: 1 PID: 1 at kernel/dma/mapping.c:597 dma_alloc_attrs+0xe0/0x124
> > >
> > 
> > Looks good, will add to my queue after next -rc1.
> 
> Ping.
> 

Sorry I forgot to respond. I kept this out for now as we need to resolve
the DT bindings.

If you think it can be used/needed irrespective of how we resolve that
issue ? If so, I can queue this.
Viresh Kumar Feb. 28, 2025, 11:07 a.m. UTC | #4
On Fri, 28 Feb 2025 at 14:51, Sudeep Holla <sudeep.holla@arm.com> wrote:
> Sorry I forgot to respond. I kept this out for now as we need to resolve
> the DT bindings.
>
> If you think it can be used/needed irrespective of how we resolve that
> issue ? If so, I can queue this.

Yes, this has nothing to do with the DT bindings and reserved-mem thing.

We can anyways map memory on need basis at runtime and this is required
for that to work. The reserved-mem thing only allows us to map everything in
advance.

--
Viresh
Sudeep Holla Feb. 28, 2025, 11:19 a.m. UTC | #5
On Fri, Feb 28, 2025 at 04:37:24PM +0530, Viresh Kumar wrote:
> On Fri, 28 Feb 2025 at 14:51, Sudeep Holla <sudeep.holla@arm.com> wrote:
> > Sorry I forgot to respond. I kept this out for now as we need to resolve
> > the DT bindings.
> >
> > If you think it can be used/needed irrespective of how we resolve that
> > issue ? If so, I can queue this.
> 
> Yes, this has nothing to do with the DT bindings and reserved-mem thing.
> 
> We can anyways map memory on need basis at runtime and this is required
> for that to work. The reserved-mem thing only allows us to map everything in
> advance.
> 

Understood, will apply this soon.
Sudeep Holla March 3, 2025, 11:48 a.m. UTC | #6
On Fri, 17 Jan 2025 15:35:52 +0530, Viresh Kumar wrote:
> Set dma_mask for FFA devices, otherwise DMA allocation using the device pointer
> lead to following warning:
>
> WARNING: CPU: 1 PID: 1 at kernel/dma/mapping.c:597 dma_alloc_attrs+0xe0/0x124
>
>
Applied to sudeep.holla/linux (for-next/ffa/updates), thanks!

[1/1] firmware: arm_ffa: Set dma_mask for ffa devices
      https://git.kernel.org/sudeep.holla/c/cc0aac7ca17e
--
Regards,
Sudeep
diff mbox series

Patch

diff --git a/drivers/firmware/arm_ffa/bus.c b/drivers/firmware/arm_ffa/bus.c
index 587118f5285b..9dd5f6f805aa 100644
--- a/drivers/firmware/arm_ffa/bus.c
+++ b/drivers/firmware/arm_ffa/bus.c
@@ -247,6 +247,7 @@  ffa_device_register(const struct ffa_partition_info *part_info,
 	dev = &ffa_dev->dev;
 	dev->bus = &ffa_bus_type;
 	dev->release = ffa_release_device;
+	dev->dma_mask = &dev->coherent_dma_mask;
 	dev_set_name(&ffa_dev->dev, "arm-ffa-%d", id);
 
 	ffa_dev->id = id;