public inbox for kernelnewbies@kernelnewbies.org
 help / color / mirror / Atom feed
From: "Valdis Klētnieks" <valdis.kletnieks@vt.edu>
To: "s.achterop@rug.nl" <s.achterop@rug.nl>
Cc: kernelnewbies@kernelnewbies.org
Subject: Re: Trouble with allocating memory on platform driver
Date: Fri, 17 Apr 2020 15:30:42 -0400	[thread overview]
Message-ID: <147577.1587151842@turing-police> (raw)
In-Reply-To: <f322b7ae-93c2-1dc0-21a7-b26402d5aaad@rug.nl>


[-- Attachment #1.1: Type: text/plain, Size: 714 bytes --]

On Fri, 17 Apr 2020 10:47:33 +0200, "s.achterop@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).


[-- Attachment #1.2: Type: application/pgp-signature, Size: 832 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

      reply	other threads:[~2020-04-17 19:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-04 15:21 Trouble with allocating memory on platform driver s.achterop
2020-04-15  9:29 ` s.achterop
2020-04-17  8:47   ` s.achterop
2020-04-17 19:30     ` Valdis Klētnieks [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=147577.1587151842@turing-police \
    --to=valdis.kletnieks@vt.edu \
    --cc=kernelnewbies@kernelnewbies.org \
    --cc=s.achterop@rug.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox