public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Grant Grundler <grundler@parisc-linux.org>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linux-pci@atrey.karlin.mff.cuni.cz,
	Linux Kernel list <linux-kernel@vger.kernel.org>,
	Greg KH <greg@kroah.com>,
	bjorn.helgaas@hp.com
Subject: Re: pci-sysfs resource mmap broken
Date: Tue, 26 Apr 2005 10:30:42 -0600	[thread overview]
Message-ID: <20050426163042.GE2612@colo.lackof.org> (raw)
In-Reply-To: <1114493609.7183.55.camel@gaston>

On Tue, Apr 26, 2005 at 03:33:29PM +1000, Benjamin Herrenschmidt wrote:
...
> The problem is that can only work ... on architectures where the
> resources contain the same thing as the BAR values. On ppc, where this
> is not the case, it will not work. On ppc, resources are "fixed up" in
> various ways (for example, PReP adds a fixed offset to all memory
> resources to match the HW translation since PCI isn't 1:1 on those, and
> all PPCs with more than one domain play tricks with IO resources).

IIRC, alpha, sparc, and parisc also are broken then.

> In a similar vein, the "resource" is exposing directly to userland the
> content of "struct resource". This doesn't mean anything. The kernel is
> internally playing all sort of offset tricks on these values, so they
> can't be used for anything useful, either via /dev/mem, or for io port
> accesses, or whatever.

There are two "views" of a PCI resource and the names I've used in
the past are "IO View" and "CPU View". The raw BAR value is the "IO View"
since that's what that devices on that PCI bus need to use for Peer-to-Peer
reads/writes. IIRC, sym2 driver directly reads the BAR for telling the scripts
engine where onboard RAM lives. The "CPU View" is what drivers/user space
needs to use when accessing the device. This is what we should be
exporting to user space and I'm pretty sure that's what X.org/XF86
should be using too. Bjorn, have I got that right?

> Shouldn't we expose the BAR values & size rather here ? That is,
> reconsitutes non-offset'd resources, possibly with arch help, or just
> reading BAR to get base, and apply resource size & flags ?
> 
> Unless you are on x86 of course ...
> 
> There is some serious brokenness in there, it needs to be fixed if we
> want things like X.org to be ever properly adapted (and we'll have to
> deal with existing broken kernels, gack).

ISTR Bjorn was looking at this and the VGA routing issues.

thanks,
grant

  parent reply	other threads:[~2005-04-26 16:31 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-26  5:33 pci-sysfs resource mmap broken Benjamin Herrenschmidt
2005-04-26  6:09 ` Benjamin Herrenschmidt
2005-04-26  6:36   ` Greg KH
2005-04-26  9:24   ` Russell King
2005-04-26 16:30 ` Grant Grundler [this message]
2005-04-26 22:47   ` Benjamin Herrenschmidt
2005-04-27  3:55     ` Grant Grundler
2005-04-27  4:30       ` Benjamin Herrenschmidt
2005-04-27  4:28         ` David S. Miller
2005-04-27  4:39           ` Benjamin Herrenschmidt
2005-04-27  4:46     ` pci-sysfs resource mmap broken (and PATCH) Benjamin Herrenschmidt
2005-04-27 23:13     ` Benjamin Herrenschmidt
2005-04-28  5:33       ` Grant Grundler
2005-04-28  5:37         ` David S. Miller
2005-04-28  6:39           ` Benjamin Herrenschmidt
2005-04-28  6:50             ` David S. Miller
2005-04-28  7:21               ` Benjamin Herrenschmidt
2005-04-28  7:22                 ` David S. Miller
2005-04-28  7:46                   ` Benjamin Herrenschmidt
2005-04-28 15:11               ` Grant Grundler
2005-04-28 22:47                 ` Benjamin Herrenschmidt
2005-04-28 23:38                   ` Grant Grundler
2005-04-29 15:42                     ` David S. Miller
2005-04-29 22:16                       ` Jesse Barnes
2005-04-28  6:35         ` Benjamin Herrenschmidt
2005-05-03  5:37           ` pci-sysfs resource mmap broken PATCH#2 Benjamin Herrenschmidt

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=20050426163042.GE2612@colo.lackof.org \
    --to=grundler@parisc-linux.org \
    --cc=benh@kernel.crashing.org \
    --cc=bjorn.helgaas@hp.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@atrey.karlin.mff.cuni.cz \
    /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