linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	LAKML <linux-arm-kernel@lists.infradead.org>,
	Linux PCI <linux-pci@vger.kernel.org>
Subject: Re: [PATCH RFC 2/2] arm: kernel: fix pci_mmap_page_range() offset calculation
Date: Wed, 15 Oct 2014 23:29:32 +0100	[thread overview]
Message-ID: <20141015222932.GL27405@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1413374624-30066-2-git-send-email-lorenzo.pieralisi@arm.com>

On Wed, Oct 15, 2014 at 01:03:41PM +0100, Lorenzo Pieralisi wrote:
> ARM relies on the standard implementation of pci_resource_to_user()
> which actually is an identity map and exports to user space
> PCI memory resources as they are stored in PCI devices resources (ie BARs)
> which represent CPU physical addresses (fixed-up using BUS to CPU
> address conversions) not PCI bus addresses.

This paragraph seems wrong.

It first says that PCI memory resources contain the same values that the
PCI device has in its BAR.  It then goes on to say that they are CPU
physical addresses.  That is not true.

For example, DC21285 systems always have done this as: the PCI bars
contain the _bus_ addresses, which tend to be in the range 0 to
0x7fffffff.  These correspond with a CPU physical address of
0x80000000 to 0xffffffff.  The PCI bus resources for IOMEM resources
contains the CPU physical address of the mapping.

> On platforms where the mapping between CPU and BUS address is not a 1:1
> mapping this is erroneous, in that an additional shift is applied to
> an already fixed-up offset passed from userspace.

Yes, I think this is a correct patch inspite of the description. :)

-- 
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.

  reply	other threads:[~2014-10-15 22:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-15 12:03 [PATCH RFC 1/2] drivers: pci: fix pci_mmap_fits() implementation for procfs mmap Lorenzo Pieralisi
2014-10-15 12:03 ` [PATCH RFC 2/2] arm: kernel: fix pci_mmap_page_range() offset calculation Lorenzo Pieralisi
2014-10-15 22:29   ` Russell King - ARM Linux [this message]
2014-10-16 10:24     ` Lorenzo Pieralisi

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=20141015222932.GL27405@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.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;
as well as URLs for NNTP newsgroup(s).