public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
From: Russell King <rmk@arm.linux.org.uk>
To: James Bottomley <James.Bottomley@steeleye.com>
Cc: William Lee Irwin III <wli@holomorphy.com>,
	linux-arch@vger.kernel.org, Jeff Garzik <jgarzik@pobox.com>,
	Linus Torvalds <torvalds@osdl.org>,
	David Woodhouse <dwmw2@infradead.org>,
	Christoph Hellwig <hch@infradead.org>,
	Andrew Morton <akpm@osdl.org>, Andrea Arcangeli <andrea@suse.de>
Subject: Re: can device drivers return non-ram via vm_ops->nopage?
Date: Mon, 22 Mar 2004 09:30:29 +0000	[thread overview]
Message-ID: <20040322093029.A460@flint.arm.linux.org.uk> (raw)
In-Reply-To: <1079930497.2045.69.camel@mulgrave>; from James.Bottomley@steeleye.com on Sun, Mar 21, 2004 at 11:41:35PM -0500

On Sun, Mar 21, 2004 at 11:41:35PM -0500, James Bottomley wrote:
> Let me illustrate what would go wrong on parisc:  we have a VIPT cache
> and the concept of an address space.

Is it not the case that VIPT caches are coloured, and mapping a page
into the appropriate place results in the same virtual index for both?

If this isn't true, this means that SHM is also broken on PARISC since
there is no value of SHMLBA which makes SHM mappings coherent with
each other.

> Therefore, a user trying to make use of a coherent area mmap would have
> to flush/invalidate everything all the time just to try to make sure
> they weren't missing device updates (because we have no mechanism for
> the kernel to know the data has changed and call flush_dcache_page).

Unfortunately, there is a class of drivers where mmaping a large DMA
buffer into user space makes sense.  These are video capture and
sound drivers.

By saying that "we can't support DMA coherent mmap" you're forcing
driver writers to write their own DMA coherent mmap implementations,
which they _have_ done already, and they've screwed up the interfaces
such that it only works on x86 today.

What I want is an interface which allows most of the architectures
which are capable of doing this to indeed do this.  Those which can't
should fail the mmap attempt.  It has to be said that by doing this
we're actually better off - more drivers work across more platforms
and we have a well defined failure mode for platforms where it doesn't
work.

If those platforms want to use those drivers, they aren't actually in
a worse situation - they had to find some way to work around this
before now, and they still have to find some way to work around this
afterwards, or maybe decide that the subset of drivers which need
this are incompatible with the architecture.

However, please don't prevent all architectures from being able to
use these drivers just because a small number can't.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
                 2.6 Serial core

  parent reply	other threads:[~2004-03-22  9:30 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20040321204931.A11519@infradead.org>
     [not found] ` <1079902670.17681.324.camel@imladris.demon.co.uk>
     [not found]   ` <Pine.LNX.4.58.0403211349340.1106@ppc970.osdl.org>
     [not found]     ` <20040321222327.D26708@flint.arm.linux.org.uk>
     [not found]       ` <405E1859.5030906@pobox.com>
     [not found]         ` <20040321225117.F26708@flint.arm.linux.org.uk>
     [not found]           ` <Pine.LNX.4.58.0403211504550.1106@ppc970.osdl.org>
     [not found]             ` <20040321234515.G26708@flint.arm.linux.org.uk>
     [not found]               ` <20040322002349.GZ2045@holomorphy.com>
     [not found]                 ` <405E3387.1050505@pobox.com>
2004-03-22  3:45                   ` can device drivers return non-ram via vm_ops->nopage? William Lee Irwin III
2004-03-22  4:41                     ` James Bottomley
2004-03-22  4:46                       ` William Lee Irwin III
2004-03-22  4:56                         ` James Bottomley
2004-03-22  5:26                           ` Benjamin Herrenschmidt
2004-03-22 11:58                             ` Andrea Arcangeli
2004-03-22 12:05                               ` Russell King
2004-03-22 12:34                                 ` Andrea Arcangeli
2004-03-22  9:30                       ` Russell King [this message]
2004-03-22 15:04                         ` James Bottomley
2004-03-22 15:15                           ` Russell King
2004-03-22 15:27                             ` James Bottomley
2004-03-22 21:50                               ` Benjamin Herrenschmidt
2004-03-22 22:18                                 ` Jeff Garzik
2004-03-22 22:35                                   ` William Lee Irwin III
2004-03-22 23:57                                     ` Benjamin Herrenschmidt
2004-03-23  0:22                                       ` David Woodhouse
2004-03-23  2:07                                       ` William Lee Irwin III
2004-03-23  9:28                                         ` Russell King
2004-03-23  9:34                                           ` David Woodhouse
2004-03-23 10:04                                             ` Russell King
2004-03-23 10:05                                               ` William Lee Irwin III
2004-03-23 11:29                                               ` Benjamin Herrenschmidt
2004-03-23 11:35                                         ` Andrea Arcangeli
2004-03-23 11:44                                           ` William Lee Irwin III
2004-03-23 12:34                                             ` Andrea Arcangeli
2004-03-23 12:40                                               ` Russell King
2004-03-23 15:25                                                 ` Linus Torvalds
2004-03-23 15:36                                                   ` Andrea Arcangeli
2004-03-23 15:46                                                     ` Linus Torvalds
2004-03-23 15:50                                                     ` Russell King
2004-03-23 22:10                                                     ` Benjamin Herrenschmidt
2004-03-25 20:25                                                 ` Russell King
2004-03-28 10:17                                                   ` Russell King
2004-03-23 12:49                                               ` William Lee Irwin III
2004-03-22 23:19                                   ` Russell King
2004-03-22 23:35                                     ` Jeff Garzik
2004-03-23  2:26                                       ` James Bottomley

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=20040322093029.A460@flint.arm.linux.org.uk \
    --to=rmk@arm.linux.org.uk \
    --cc=James.Bottomley@steeleye.com \
    --cc=akpm@osdl.org \
    --cc=andrea@suse.de \
    --cc=dwmw2@infradead.org \
    --cc=hch@infradead.org \
    --cc=jgarzik@pobox.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=torvalds@osdl.org \
    --cc=wli@holomorphy.com \
    /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