All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Jes Sorensen <Jes.Sorensen@cern.ch>
Cc: "David S. Miller" <davem@redhat.com>,
	rmk@arm.linux.org.uk, linux-kernel@vger.rutgers.edu
Subject: Re: DMA changes in 2.3.41 - how the f* do I get this working on ARM?
Date: Mon, 31 Jan 2000 12:45:52 +0100	[thread overview]
Message-ID: <20000131124552.I948@mff.cuni.cz> (raw)
In-Reply-To: <d3oga2r22z.fsf@lxplus011.cern.ch>; from Jes Sorensen on Mon, Jan 31, 2000 at 11:02:28AM +0100

> David> For the actual transfers, you can do the dma_cache_*() calls in
> David> the pci_{un,}map_streaming() calls.
> 
> David> The only place you could possibly need it is for the IDE
> David> scatter list tables, and that would only be if you have _no_
> David> mechanism to disable the CPU cache in the MMU, which I severely
> David> doubt.
> 
> Hmmm ok I just noticed this and I haven't read that DMA mapping
> document yet. I'll have to look at it to see how it affects PCI
> devices that are 64 bit address capable.

The whole interface is currently for SAC. For using DAC, you need arch
details how to build the DAC address (e.g. on UltraSPARC you usually want
0xfffc in bits 63:50 to set DMA bypass) and it really depends if it is a
gain or lose (with SAC and dynamic mapping, you can manage to collapse a
bunch of sg chunks into one sg entry, while with DAC you cannot. Also,
with SAC on sparc64 PCI chips you can specify whether you want streaming
mode or not, while with bypass it is always consistent if I remember well -
the cacheability is determined from the physical address though). On the
other side with DAC you save filling up the IOPTEs and clearing them after.

> 
> The one thing for the m68k is that we have very few machines with
> PCI, though we still suffer a lot from the DMA coherency problem on
> the busses we do have.

The API is pci_* because it takes a struct pci_dev *. SBUS has identical API
with sbus_* which takes struct sbus_dev *.
The goal is to merge all bus device structures into struct pci_dev (but
keeping as much as possible bus specific things in sysdata) and call it a
generic hardware device structure. Then all those interfaces can be merged,
its just the changes need to be incremental (Linus did not like introducing
device_t type and casting struct pci_dev etc. structures to it and back so
it got removed from the patch). But if you don't need any specific device or
bus data in the pci_alloc_consistent, pci_map_single and the like, you can
use it for whatever bus you need. One just passes NULL as the device pointer
to it (this is needed so that drivers handling e.g. ISA (which has no struct
isa_dev nor uses pci_dev) and PCI at the same time can use the dynamic DMA
interface).

> 
> The place where this is a real problem is in drivers where data is
> shared between the adapter and the host CPU, for instance the 53c7xx
> driver. On the m68k we currently use a kernel_set_cachemode() function
> to change the caching of the page allocated for the shared structures,
> but thats a pretty non portable way of doing it. I would like to see
> something a get_free_cachecoherent_page() interface instead, what do
> you think of that?

Why cannot you do this in pci_alloc_consistent?

Cheers,
    Jakub
___________________________________________________________________
Jakub Jelinek | jakub@redhat.com | http://sunsite.mff.cuni.cz/~jj
Linux version 2.3.41 on a sparc64 machine (1343.49 BogoMips)
___________________________________________________________________

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

  parent reply	other threads:[~2000-01-31 10:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-01-30  0:06 DMA changes in 2.3.41 - how the f* do I get this working on ARM? Russell King
2000-01-30  5:52 ` Andre Hedrick
2000-01-30  6:01 ` Jakub Jelinek
2000-01-30  9:48   ` Russell King
2000-01-30 22:11 ` David S. Miller
2000-01-30 23:49   ` Russell King
2000-01-31  0:24     ` David S. Miller
2000-01-31  4:27   ` Andre Hedrick
2000-01-31  4:27     ` David S. Miller
2000-01-31 10:02   ` Jes Sorensen
2000-01-31 10:09     ` David S. Miller
2000-01-31 11:45     ` Jakub Jelinek [this message]
2000-01-31 12:48       ` Jes Sorensen
2000-01-31 18:00         ` Jeff Garzik

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=20000131124552.I948@mff.cuni.cz \
    --to=jakub@redhat.com \
    --cc=Jes.Sorensen@cern.ch \
    --cc=davem@redhat.com \
    --cc=linux-kernel@vger.rutgers.edu \
    --cc=rmk@arm.linux.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.