linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: Sinan Kaya <okaya@codeaurora.org>,
	linux-pci@vger.kernel.org, Zhou Wang <wangzhou1@hisilicon.com>,
	Phil Edworthy <phil.edworthy@renesas.com>,
	Bjorn Helgaas <bhelgaas@google.com>
Subject: Re: [RFC] ARM/ARM64 PCI_PROBE_ONLY platforms
Date: Mon, 1 Feb 2016 16:28:38 +0000	[thread overview]
Message-ID: <20160201162838.GB30869@red-moon> (raw)
In-Reply-To: <20160129232538.GH12965@localhost>

On Fri, Jan 29, 2016 at 05:25:38PM -0600, Bjorn Helgaas wrote:
> On Wed, Jan 20, 2016 at 06:10:03PM +0000, Lorenzo Pieralisi wrote:
> 
> > To do that, we must claim resources on PCI_PROBE_ONLY systems, but
> > I know for certain Bjorn does not like the idea (I let you trawl
> > the archives - at least he does not accept the idea of claiming
> > resources ONLY on PCI_PROBE_ONLY systems, he thinks we should
> > always claim resources regardless of that flag and fall-back to
> > reassigning them in case claiming fails. That's perfectly reasonable,
> > at least on systems with FW initializing PCI). The problem is dealing
> > with legacy, so switching to resources claiming by default is a tad
> > complicated, at least for testing (code is easy to implement).
> 
> I'd like to think of PCI_PROBE_ONLY basically as "setting
> IORESOURCE_PCI_FIXED for every BAR", i.e., we can do everything we
> normally do *except* write to the BAR (of course we have to write to
> it to size the BAR during enumeration, but we have to restore the
> original value).

I am honestly a bit confused about the distinction between
PCI_PROBE_ONLY and "IORESOURCE_PCI_FIXED for every BAR", the more
so if I read the resources assignment code, in particular:

pci_assign_resource()

in drivers/pci/setup-res.c

That function assigns the resource but does not update the BAR
if IORESOURCE_PCI_FIXED is set. I wonder why the resource is
assigned at all if IORESOURCE_PCI_FIXED is set, probably to
initialize its parent pointer and set it, still, the value in
the struct resource may differ from what's in the BAR, I am not sure
I understand why we are happy with that or I am reading code the
wrong way (does not this give a view of resource tree disconnected
from how HW is actually programmed ?)

> I don't think PCI_PROBE_ONLY should have anything to do with the
> iomem_resource and ioport_resource trees.  /proc/iomem and
> /proc/ioports should still contain every resource we know about,
> regardless of whether PCI_PROBE_ONLY is set or not.

I do not think PCI_PROBE_ONLY should have anything to do with the
resource tree either, still, if resources are not assigned, they must be
inserted in the resource tree anyway so that we are capable of enabling
the PCI devices (ie pci_enable_resources()).

Thanks,
Lorenzo

  reply	other threads:[~2016-02-01 16:26 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-20 16:04 [RFC] ARM/ARM64 PCI_PROBE_ONLY platforms Lorenzo Pieralisi
2016-01-20 16:13 ` Sinan Kaya
2016-01-20 18:10   ` Lorenzo Pieralisi
2016-01-20 18:15     ` Sinan Kaya
2016-01-29 23:26       ` Bjorn Helgaas
2016-01-22 16:28     ` Phil Edworthy
2016-01-25 17:51       ` Lorenzo Pieralisi
2016-01-28 17:27       ` Lorenzo Pieralisi
2016-01-29 12:02         ` Gabriele Paoloni
2016-01-29  6:32       ` Pratyush Anand
2016-01-29 23:25     ` Bjorn Helgaas
2016-02-01 16:28       ` Lorenzo Pieralisi [this message]
2016-02-01 21:19         ` Bjorn Helgaas
2016-01-29 23:06   ` Bjorn Helgaas
2016-01-30  0:14     ` Sinan Kaya
2016-01-30 13:30       ` Bjorn Helgaas
2016-01-30 17:51         ` Okaya
2016-02-01 15:25         ` Lorenzo Pieralisi
2016-02-01 21:12           ` Bjorn Helgaas

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=20160201162838.GB30869@red-moon \
    --to=lorenzo.pieralisi@arm.com \
    --cc=bhelgaas@google.com \
    --cc=helgaas@kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=okaya@codeaurora.org \
    --cc=phil.edworthy@renesas.com \
    --cc=wangzhou1@hisilicon.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).