public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: khc@pm.waw.pl (Krzysztof Halasa)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] Fix IXP4xx coherent allocations
Date: Sun, 24 Mar 2013 22:15:36 +0100	[thread overview]
Message-ID: <m3r4j4sdmv.fsf@intrepid.localdomain> (raw)
In-Reply-To: <1364152267.3620.31.camel@deadeye.wl.decadent.org.uk> (Ben Hutchings's message of "Sun, 24 Mar 2013 19:11:07 +0000")

Ben Hutchings <bhutchings@solarflare.com> writes:

> I'm failing to see where it says the default can't be narrower than 32
> bits due to platform limits.  And how do you think DMA mapping is
> supposed to work for PCI devices on these platforms, anyway?

The problem on ARM (and probably on powerpc, and on something called
"metag" - grep -r 'coherent DMA mask is unset' arch) is that the default
coherent DMA mask is zero. IOW, coherent DMA allocations are, by
default, disabled. A driver has to dma_set_coherent_mask() or, as many
drivers do, set dev->coherent_dma_mask directly (IMHO
dev->coherent_dma_mask along with dev->dma_mask are private DMA API
stuff and e.g. device drivers have no interest there).

The zero default is IMHO, WRT the actual DMA API, an ARM bug (and
powerpc's etc). Nevertheless, the patch I posted does everything as
required by the API. Specifically, the IXP4xx arch part makes
IXP4xx's dma_set_coherent_mask() compliant with DMA API, and the actual
dma_set_coherent_mask() calls in drivers are both valid and I guess
recommended by the API.

The patch doesn't touch the core ARM issue, that's right.
-- 
Krzysztof Halasa

  reply	other threads:[~2013-03-24 21:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-23 19:35 [PATCH] Fix IXP4xx coherent allocations Krzysztof Halasa
2013-03-23 23:57 ` David Miller
2013-03-24 19:11   ` Ben Hutchings
2013-03-24 21:15     ` Krzysztof Halasa [this message]
2013-03-30 13:29       ` Russell King - ARM Linux
2013-03-30 14:22         ` Krzysztof Halasa
2013-03-30 15:31           ` Russell King - ARM Linux
2013-04-01 20:17             ` Krzysztof Halasa
2013-04-02  0:40               ` Ben Hutchings
2013-03-30 13:18   ` Krzysztof Halasa

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=m3r4j4sdmv.fsf@intrepid.localdomain \
    --to=khc@pm.waw.pl \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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