linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: Will Deacon <will.deacon@arm.com>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"arnd@arndb.de" <arnd@arndb.de>
Subject: Re: [PATCH v3 2/3] ARM: bios32: use pci_enable_resource to enable PCI resources
Date: Thu, 20 Feb 2014 17:36:19 -0700	[thread overview]
Message-ID: <20140221003619.GG19893@obsidianresearch.com> (raw)
In-Reply-To: <CAErSpo4KEGh7GAfEv-prj-UdJETCN9M5sEtdNF0NARa6-03HYA@mail.gmail.com>

On Thu, Feb 20, 2014 at 12:39:16PM -0700, Bjorn Helgaas wrote:
> > Damn, I just found a problem with this patch when PCI_PROBE_ONLY is set.
> >
> > The problem is that bios32.c won't create a resource hierarchy for the
> > firmware-initialised resources, so we have a bunch of orphaned resources
> > that we can't pass to pci_enable_resources (since it checks r->parent).
> >
> > This means that, unless firmware *enables* all of the resources, Linux won't
> > be able to enable them. I think this is stronger than simply not
> > re-assigning devices like the PCI_PROBE_ONLY flag intends.
> 
> By "firmware enabling resources," do you mean firmware assigning
> addresses in the BARs and turning on the PCI_COMMAND_MEMORY (or _IO)
> bits?
> 
> I'd like to make the generic code ignore BAR values if
> PCI_COMMAND_MEMORY (or _IO) is cleared.  When those bits are cleared,
> I don't think there's a good way to determine whether the address in a
> BAR is valid.

I think this is pretty smart, PROBE_ONLY really should mean
'everything is perfect, do not touch it' and if the device isn't
enabled, well.. It isn't enabled, the firmware should have done it.

Will, this if for kvmtool right? Keeping the patch as is and instead
changing kvmtool to enable the devices seems like a good option?

Alternatively, there are OF ways to communicate the BAR assignment
through the DT. I actually have no idea how this information is used
by the core code, but it might let you avoid the probe_only by
specifying the desired BAR value through the DT.

Regards,
Jason

  reply	other threads:[~2014-02-21  0:36 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-18 12:20 [PATCH v3 0/3] ARM: PCI: implement generic PCI host controller Will Deacon
2014-02-18 12:20 ` [PATCH v3 1/3] ARM: mach-virt: allow PCI support to be selected Will Deacon
2014-02-18 12:20 ` [PATCH v3 2/3] ARM: bios32: use pci_enable_resource to enable PCI resources Will Deacon
2014-02-18 15:41   ` Russell King - ARM Linux
2014-02-18 19:10     ` Will Deacon
2014-02-20 11:12     ` Will Deacon
2014-02-20 19:39       ` Bjorn Helgaas
2014-02-21  0:36         ` Jason Gunthorpe [this message]
2014-02-21 13:49           ` Will Deacon
2014-02-18 12:20 ` [PATCH v3 3/3] PCI: ARM: add support for generic PCI host controller Will Deacon
2014-02-18 13:46   ` Arnd Bergmann
2014-02-18 19:10     ` Will Deacon
2014-02-19 11:07       ` Will Deacon
2014-02-19 14:17         ` Arnd Bergmann
2014-02-19 15:25           ` Will Deacon
2014-02-18 18:21   ` Jason Gunthorpe
2014-02-18 18:44     ` Will Deacon
2014-02-18 18:47       ` Arnd Bergmann
2014-02-18 18:51         ` Will Deacon
2014-02-18 19:11           ` Arnd Bergmann
2014-02-18 19:16             ` Will Deacon
2014-02-18 18:59       ` Jason Gunthorpe
2014-02-18 19:09         ` Will Deacon
2014-02-18 19:32           ` Arnd Bergmann
2014-02-18 19:36             ` Will Deacon
2014-02-18 19:57               ` Will Deacon
2014-02-18 20:19                 ` Arnd Bergmann
2014-02-19 10:57                   ` Will Deacon
2014-02-18 20:15       ` Arnd Bergmann
2014-02-19 10:54         ` Will Deacon

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=20140221003619.GG19893@obsidianresearch.com \
    --to=jgunthorpe@obsidianresearch.com \
    --cc=arnd@arndb.de \
    --cc=bhelgaas@google.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=will.deacon@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).