[PATCH v2 2/3] mtd: rawnand: cadence: use dma_map_resource for sdma address
Miquel Raynal
miquel.raynal at bootlin.com
Wed Jan 29 01:50:50 PST 2025
Hello,
>> > Map the slave DMA I/O address using dma_map_resource.
>> > When ARM SMMU is enabled, using a direct physical address of SDMA
>> > results in DMA transaction failure.
>>
>> It is in general a better practice anyway. Drivers should be portable and
>> always remap resources.
I actually had a look at the kernel sources again regarding the use of
the map_resource() helper, and it is very strangely used. Sometimes the
DMA controller does the remapping, sometimes it is the slave device. The
core and headers are totally unclear about who should take the action.
Anyway, your diff is fine I believe.
> Do you think the commit message below would be better, or
> stick with the existing one?
>
> Remap the slave DMA I/O resources to enhance driver portability.
> Using a physical address causes DMA translation failure when the
> ARM SMMU is enabled.
Fine by me!
Thanks,
Miquèl
More information about the linux-mtd
mailing list