linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Gerhard Pircher" <gerhard_pircher@gmx.net>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev@ozlabs.org, debian-powerpc@lists.debian.org
Subject: Re: Not coherent cache DMA for G3/G4 CPUs: clarification needed
Date: Thu, 20 Apr 2006 23:33:50 +0200 (MEST)	[thread overview]
Message-ID: <20080.1145568830@www088.gmx.net> (raw)
In-Reply-To: 1145567025.17087.77.camel@localhost.localdomain

> --- Ursprüngliche Nachricht ---
> Von: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> An: Gerhard Pircher <gerhard_pircher@gmx.net>
> Kopie: linuxppc-dev@ozlabs.org, debian-powerpc@lists.debian.org
> Betreff: Re: Not coherent cache DMA for G3/G4 CPUs: clarification needed
> Datum: Fri, 21 Apr 2006 07:03:45 +1000
> 
> On Thu, 2006-04-20 at 20:57 +0200, Gerhard Pircher wrote:
> 
> > 1. The AmigaOne is similar to the PREP platform, i.e. DMA can only be
> > performed in the first 16MB for ISA devices (there's only a VIA
> > southbridge, no other SuperI/O IC with 32bit capable DMA controller).
> > I guess the first 16MB cannot be reserved for not coherent DMA
> > operation, because this memory area is occupied by kernel data? (not to
> > talk about the performance loss, if the kernel data area would be
> > excluded from the BAT mapping).
> 
> Yeah that would suck. Are you sure you need ISA DMA ? You can do pseudo
> DMA like pegasos for the floppy. Anything else should be able to do 32
> bits DMA unless you have a very broken chipset.

I hope not. But I think the AmigaOne floppy driver is copied from the i386
architecture and this one uses DMA IIRC. On the side: who uses floppy drives
these days?

> > 2. I'm not sure how to allocate memory for DMA operation. I think
> > alloc_pages() will not do the job for me, as the page tables for not
> > coherent DMA are reserved (SetPageReserved()) and removed from the
> > available lowmem.
> 
> alloc_pages() ? How so ? No, you want to allocate from your reserved
> pool, you'll have to implement your own allocator. Easiest is a running
> bitmap, look at ppc64 iommu code for an example.
Thanks! I was searching a while for an example, but couldn't found one. 

> >  Also memory fragmentation may be a problem, if a lot DMA operations
> > with different buffer sizes are performed. Therefore a system could
> > quickly run out of memory for not coherent DMA operation, right?
> > Is there a way to minimize fragmentation?
> 
> Best you can do is have separate pools for small and big allocations I
> suppose.
Okay. Or is there a general slab allocator implementation in the Linux
kernel?

> > 3. How are DMA buffers used outside the kernel? Do user programs get a
> > pointer to the DMA buffer (in theory) from the device driver or is the
> > data copied to another buffer allocated by an user program?
> 
> There are cases where some drivers try that but you should ignore it for
> the moment. Won't happen in most cases.
That's good to hear. Makes my life a little bit easier. ;-)
 
Thanks,

Gerhard

-- 
Analog-/ISDN-Nutzer sparen mit GMX SmartSurfer bis zu 70%!
Kostenlos downloaden: http://www.gmx.net/de/go/smartsurfer

  reply	other threads:[~2006-04-20 21:33 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-20 18:57 Not coherent cache DMA for G3/G4 CPUs: clarification needed Gerhard Pircher
2006-04-20 20:38 ` Eugene Surovegin
2006-04-20 20:56   ` Gerhard Pircher
2006-04-20 21:02     ` Eugene Surovegin
2006-04-20 21:10       ` Gerhard Pircher
2006-04-20 21:55         ` Eugene Surovegin
2006-04-20 22:08           ` Gerhard Pircher
2006-04-24 19:21             ` Mark A. Greer
2006-04-21  4:38           ` Benjamin Herrenschmidt
2006-04-21  8:03             ` Gerhard Pircher
2006-04-21 14:33             ` Brent Cook
2006-04-21 21:51               ` Benjamin Herrenschmidt
2006-04-27 21:31             ` Mark A. Greer
2006-04-27 21:53               ` Benjamin Herrenschmidt
2006-04-27 22:08                 ` Mark A. Greer
2006-04-29 17:57                 ` Gerhard Pircher
2006-04-20 21:06   ` Benjamin Herrenschmidt
2006-04-20 21:13     ` Eugene Surovegin
2006-04-20 21:19       ` Eugene Surovegin
2006-04-20 22:40         ` Benjamin Herrenschmidt
2006-04-20 22:39       ` Benjamin Herrenschmidt
2006-04-20 23:46         ` Gabriel Paubert
2006-04-21  0:09           ` Benjamin Herrenschmidt
2006-04-20 21:33     ` Eugene Surovegin
2006-04-20 22:41       ` Benjamin Herrenschmidt
2006-04-21  8:21         ` Gerhard Pircher
2006-04-20 21:03 ` Benjamin Herrenschmidt
2006-04-20 21:33   ` Gerhard Pircher [this message]
2006-04-20 22:07 ` Gabriel Paubert
2006-04-20 22:26   ` Gerhard Pircher

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=20080.1145568830@www088.gmx.net \
    --to=gerhard_pircher@gmx.net \
    --cc=benh@kernel.crashing.org \
    --cc=debian-powerpc@lists.debian.org \
    --cc=linuxppc-dev@ozlabs.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;
as well as URLs for NNTP newsgroup(s).