All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bhelgaas@google.com>
To: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: "linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	Will Deacon <Will.Deacon@arm.com>,
	Catalin Marinas <Catalin.Marinas@arm.com>,
	Jingoo Han <jg1.han@samsung.com>,
	Jayachandran C <jchandra@broadcom.com>,
	"suravee.suthikulpanit@amd.com" <suravee.suthikulpanit@amd.com>,
	Tanmay Inamdar <tinamdar@apm.com>
Subject: Re: [PATCH] ARM64: PCI: do not enable resources on PROBE_ONLY systems
Date: Thu, 3 Sep 2015 11:35:04 -0500	[thread overview]
Message-ID: <20150903163504.GH829@google.com> (raw)
In-Reply-To: <CAErSpo5188hGiySG+JweWOvfj6aZtAfVta4=0wwwRmMTp+9tFg@mail.gmail.com>

On Mon, Aug 31, 2015 at 11:49:20AM -0500, Bjorn Helgaas wrote:
> On Mon, Aug 31, 2015 at 11:33 AM, Lorenzo Pieralisi
> <lorenzo.pieralisi@arm.com> wrote:
> > On Mon, Aug 31, 2015 at 02:28:03PM +0100, Bjorn Helgaas wrote:
> >> On Sat, Aug 29, 2015 at 01:44:57PM +0100, Lorenzo Pieralisi wrote:
> >> > On Fri, Aug 28, 2015 at 10:14:44PM +0100, Bjorn Helgaas wrote:
> >> > > On Thu, Jul 30, 2015 at 02:13:59PM +0100, Lorenzo Pieralisi wrote:
> >> > > > On ARM64 PROBE_ONLY PCI systems resources are not currently claimed,
> >> > > > therefore they can't be enabled since they do not have a valid
> >> > > > parent pointer; this in turn prevents enabling PCI devices on
> >> > > > ARM64 PROBE_ONLY systems, causing PCI devices initialization to
> >> > > > fail.
> >> > >
> >> > > Where does arm64 claim PCI BAR resources for the non-PROBE_ONLY case?
> >> >
> >> > arm64 (and arm) does not claim resources in arch code, they are always
> >> > assigned in the respective host controllers (or the pcibios on arm),
> >> > except for the PCI generic host when in PROBE_ONLY mode, where resources
> >> > are neither claimed nor assigned (the reason for this patch to exist).
> >> > ...
> >> >
> >> > > I know it must be there somewhere, but I don't see it.
> >> >
> >> > It is not there, it is done in the host controllers by assigning the
> >> > resources (which also "claim" them by assigning the parent pointer).
> >>
> >> The host controller drivers should claim the apertures forwarded to
> >> the PCI bus.  For pci-host-generic, this happens when
> >> gen_pci_parse_request_of_pci_ranges() calls devm_request_resource().
> >
> > Yes, the generic host claims the apertures at DT probing time.
> >
> >> But that doesn't do anything for the BARs of the PCI devices
> >> themselves, of course.
> >>
> >> If this patch fixes a problem that will occur in the future, when we
> >> add arm/arm64 code to claim BARs, let's make this patch part of that
> >> series.  If it fixes a problem in the current tree, I'll merge it now,
> >> but so far I haven't been able to make the connection between this
> >> patch and a problem in the current code.
> >
> > It fixes a problem in the current tree (I mean when the PCI pull is
> > merged - it contains code that enables PCI host generic on arm64),
> > since without it PROBE_ONLY systems (ie PCI host generic on kvmtool) would
> > try to enable resources and fail, since the resources were not claimed.
> >
> > It works the same way as arm, I will rework both arches when I am done
> > refactoring the resource claiming implementation.
> >
> > Will picked it up already I do not know what's the best way to
> > merge it I guess it can go via the arm64 tree if you do not have any
> > objections.
> 
> OK, if it fixes a problem in my v4.3 pull request, we need to merge
> it.  I missed the connection, probably because I was browsing the
> v4.2-rc1 tree, which wouldn't have those changes.
> 
> It's OK with me to merge it via the arm64 tree.

Do you need me to do anything with this?  It'd be nice to get it in
before -rc1.  The PCI changes have already been merged, and it'd be
nice to mention the commit that this fixes.

Bjorn

WARNING: multiple messages have this Message-ID (diff)
From: bhelgaas@google.com (Bjorn Helgaas)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM64: PCI: do not enable resources on PROBE_ONLY systems
Date: Thu, 3 Sep 2015 11:35:04 -0500	[thread overview]
Message-ID: <20150903163504.GH829@google.com> (raw)
In-Reply-To: <CAErSpo5188hGiySG+JweWOvfj6aZtAfVta4=0wwwRmMTp+9tFg@mail.gmail.com>

On Mon, Aug 31, 2015 at 11:49:20AM -0500, Bjorn Helgaas wrote:
> On Mon, Aug 31, 2015 at 11:33 AM, Lorenzo Pieralisi
> <lorenzo.pieralisi@arm.com> wrote:
> > On Mon, Aug 31, 2015 at 02:28:03PM +0100, Bjorn Helgaas wrote:
> >> On Sat, Aug 29, 2015 at 01:44:57PM +0100, Lorenzo Pieralisi wrote:
> >> > On Fri, Aug 28, 2015 at 10:14:44PM +0100, Bjorn Helgaas wrote:
> >> > > On Thu, Jul 30, 2015 at 02:13:59PM +0100, Lorenzo Pieralisi wrote:
> >> > > > On ARM64 PROBE_ONLY PCI systems resources are not currently claimed,
> >> > > > therefore they can't be enabled since they do not have a valid
> >> > > > parent pointer; this in turn prevents enabling PCI devices on
> >> > > > ARM64 PROBE_ONLY systems, causing PCI devices initialization to
> >> > > > fail.
> >> > >
> >> > > Where does arm64 claim PCI BAR resources for the non-PROBE_ONLY case?
> >> >
> >> > arm64 (and arm) does not claim resources in arch code, they are always
> >> > assigned in the respective host controllers (or the pcibios on arm),
> >> > except for the PCI generic host when in PROBE_ONLY mode, where resources
> >> > are neither claimed nor assigned (the reason for this patch to exist).
> >> > ...
> >> >
> >> > > I know it must be there somewhere, but I don't see it.
> >> >
> >> > It is not there, it is done in the host controllers by assigning the
> >> > resources (which also "claim" them by assigning the parent pointer).
> >>
> >> The host controller drivers should claim the apertures forwarded to
> >> the PCI bus.  For pci-host-generic, this happens when
> >> gen_pci_parse_request_of_pci_ranges() calls devm_request_resource().
> >
> > Yes, the generic host claims the apertures at DT probing time.
> >
> >> But that doesn't do anything for the BARs of the PCI devices
> >> themselves, of course.
> >>
> >> If this patch fixes a problem that will occur in the future, when we
> >> add arm/arm64 code to claim BARs, let's make this patch part of that
> >> series.  If it fixes a problem in the current tree, I'll merge it now,
> >> but so far I haven't been able to make the connection between this
> >> patch and a problem in the current code.
> >
> > It fixes a problem in the current tree (I mean when the PCI pull is
> > merged - it contains code that enables PCI host generic on arm64),
> > since without it PROBE_ONLY systems (ie PCI host generic on kvmtool) would
> > try to enable resources and fail, since the resources were not claimed.
> >
> > It works the same way as arm, I will rework both arches when I am done
> > refactoring the resource claiming implementation.
> >
> > Will picked it up already I do not know what's the best way to
> > merge it I guess it can go via the arm64 tree if you do not have any
> > objections.
> 
> OK, if it fixes a problem in my v4.3 pull request, we need to merge
> it.  I missed the connection, probably because I was browsing the
> v4.2-rc1 tree, which wouldn't have those changes.
> 
> It's OK with me to merge it via the arm64 tree.

Do you need me to do anything with this?  It'd be nice to get it in
before -rc1.  The PCI changes have already been merged, and it'd be
nice to mention the commit that this fixes.

Bjorn

  reply	other threads:[~2015-09-03 16:35 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-30 13:13 [PATCH] ARM64: PCI: do not enable resources on PROBE_ONLY systems Lorenzo Pieralisi
2015-07-30 13:13 ` Lorenzo Pieralisi
2015-08-28 21:14 ` Bjorn Helgaas
2015-08-28 21:14   ` Bjorn Helgaas
2015-08-29 12:44   ` Lorenzo Pieralisi
2015-08-29 12:44     ` Lorenzo Pieralisi
2015-08-31 13:28     ` Bjorn Helgaas
2015-08-31 13:28       ` Bjorn Helgaas
2015-08-31 16:33       ` Lorenzo Pieralisi
2015-08-31 16:33         ` Lorenzo Pieralisi
2015-08-31 16:49         ` Bjorn Helgaas
2015-08-31 16:49           ` Bjorn Helgaas
2015-09-03 16:35           ` Bjorn Helgaas [this message]
2015-09-03 16:35             ` Bjorn Helgaas
2015-09-03 16:42             ` Will Deacon
2015-09-03 16:42               ` 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=20150903163504.GH829@google.com \
    --to=bhelgaas@google.com \
    --cc=Catalin.Marinas@arm.com \
    --cc=Will.Deacon@arm.com \
    --cc=jchandra@broadcom.com \
    --cc=jg1.han@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=tinamdar@apm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.