linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	Russell King <linux@arm.linux.org.uk>,
	"David S. Miller" <davem@davemloft.net>,
	Michal Simek <monstr@monstr.eu>,
	Martin Wilck <martin.wilck@ts.fujitsu.com>,
	Linux PCI <linux-pci@vger.kernel.org>,
	Michael Ellerman <mpe@ellerman.id.au>
Subject: Re: [PATCH RFC v2 1/2] drivers: pci: fix pci_mmap_fits() implementation for procfs mmap
Date: Wed, 12 Nov 2014 18:23:49 +1100	[thread overview]
Message-ID: <1415777029.5124.42.camel@kernel.crashing.org> (raw)
In-Reply-To: <20141110230454.GA21470@google.com>

On Mon, 2014-11-10 at 16:04 -0700, Bjorn Helgaas wrote:
> But I'm not sure I have this right.  If the procfs offset is either
> the
> CPU physical address or the BAR value, then pci_resource_to_user()
> should be (depending on the arch) either a no-op or use
> pci_resource_to_bus().
> 
> But that's not how it's implemented.  Maybe it *could* be?  If
> pci_resource_to_user() gives you something that's not a CPU physical
> address and not a bus address, what *does* it give you, and why would
> we
> need this third kind of thing?
> 
> FWIW, I think the discussion leading up to pci_resource_to_user() is
> here:
> http://lkml.iu.edu/hypermail/linux/kernel/0504.3/0467.html

Oh, man... I remember that was all a giant trainwreck and some stuff
just couldn't be made completely right due to broken assumptions by
the proc code and users of it... but I don't remember all the details.

I think /proc users don't necessarily pass a BAR value but something
they try to somewhat translates themselves via the "resources" file,
which ends up working ... or not, depending on various factors such
as 32 vs 64 bit etc...

I wonder who still uses this interface....

Cheers,
Ben.



  parent reply	other threads:[~2014-11-12  7:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-24 16:28 [PATCH RFC v2 0/2] Fix procfs PCI resources mmap Lorenzo Pieralisi
2014-10-24 16:28 ` [PATCH RFC v2 1/2] drivers: pci: fix pci_mmap_fits() implementation for procfs mmap Lorenzo Pieralisi
2014-11-10 23:04   ` Bjorn Helgaas
2014-11-11 11:48     ` Lorenzo Pieralisi
2014-11-11 14:20       ` Bjorn Helgaas
2014-11-11 15:57         ` Lorenzo Pieralisi
2014-11-11 17:19           ` Bjorn Helgaas
2014-11-13 11:32             ` Lorenzo Pieralisi
2014-11-12  7:23     ` Benjamin Herrenschmidt [this message]
2014-11-12 10:27       ` Lorenzo Pieralisi
2014-10-24 16:28 ` [PATCH RFC v2 2/2] arm: kernel: fix pci_mmap_page_range() offset calculation Lorenzo Pieralisi
2014-11-04 14:15 ` [PATCH RFC v2 0/2] Fix procfs PCI resources mmap 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=1415777029.5124.42.camel@kernel.crashing.org \
    --to=benh@kernel.crashing.org \
    --cc=arnd@arndb.de \
    --cc=bhelgaas@google.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=martin.wilck@ts.fujitsu.com \
    --cc=monstr@monstr.eu \
    --cc=mpe@ellerman.id.au \
    /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).