Trouble with allocating memory on platform driver

Valdis Kl=?utf-8?Q?=c4=93?=tnieks valdis.kletnieks at vt.edu
Fri Apr 17 15:30:42 EDT 2020


On Fri, 17 Apr 2020 10:47:33 +0200, "s.achterop at rug.nl" said:

>      I found a working solution. I actually don't know what I am doing but it works.
> Before the call to dma_zalloc_coherent I added:
>
>    pdev->dev.coherent_dma_mask = 0xffffffff;
DMA_BIT_MASK(32) rather than a hex constant would be a better choice.

>
> Now it works.

Note that "works" and "is correct" are two different things.  That should be
a mask that tells how many bits of the value are actually used by the hardware.
On most 32-bit systems, 32 will be correct, but there's other values in use
(on S/390, it's either 31 or 64 bits, the PowerPC can have 44, and the old PNP
stuff on x86 weirds out at the 24-bit line).

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20200417/1a24efac/attachment.sig>


More information about the Kernelnewbies mailing list