linux-pci.vger.kernel.org archive mirror
 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-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 <Suravee.Suthikulpanit@amd.com>,
	Tanmay Inamdar <tinamdar@apm.com>
Subject: Re: [PATCH] ARM64: PCI: do not enable resources on PROBE_ONLY systems
Date: Fri, 28 Aug 2015 16:14:44 -0500	[thread overview]
Message-ID: <20150828211444.GA27890@google.com> (raw)
In-Reply-To: <1438262039-32085-1-git-send-email-lorenzo.pieralisi@arm.com>

Hi Lorenzo,

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?
I know it must be there somewhere, but I don't see it.

> To solve this issue, resources must be claimed when devices are
> added on PROBE_ONLY systems, which ensures that the resource hierarchy
> is validated and the resource tree is sane, but this requires changes
> in the ARM64 resource management that can affect adversely existing
> PCI set-ups (claiming resources on !PROBE_ONLY systems might break
> existing ARM64 PCI platform implementations).
> 
> As a temporary solution in preparation for a proper resources claiming
> implementation in ARM64 core, to enable PCI PROBE_ONLY systems on ARM64,
> this patch adds a pcibios_enable_device() arch implementation that
> simply prevents enabling resources on PROBE_ONLY systems (mirroring ARM
> behaviour).
> 
> This is always a safe thing to do because on PROBE_ONLY systems the
> configuration space set-up can be considered immutable, and it is in
> preparation of proper resource claiming that would finally validate
> the PCI resources tree in the ARM64 arch implementation on PROBE_ONLY
> systems.
> 
> For !PROBE_ONLY systems resources enablement in pcibios_enable_device()
> on ARM64 is implemented as in current PCI core, leaving the behaviour
> unchanged.
> 
> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> ---
> Bjorn, all,
> 
> as I mention in the commit log, this patch is a temporary solution
> in preparation for proper resources claiming in ARM64, so that
> we can safely enable the PCI generic host controller on ARM64 systems.
> 
> It mirrors ARM implementation and I will work on changing both
> ARM and ARM64 to convert them to proper resources claiming in
> the respective implementations.
> 
> Lorenzo
> 
>  arch/arm64/kernel/pci.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c
> index 4095379..b3d098b 100644
> --- a/arch/arm64/kernel/pci.c
> +++ b/arch/arm64/kernel/pci.c
> @@ -38,6 +38,19 @@ resource_size_t pcibios_align_resource(void *data, const struct resource *res,
>  	return res->start;
>  }
>  
> +/**
> + * pcibios_enable_device - Enable I/O and memory.
> + * @dev: PCI device to be enabled
> + * @mask: bitmask of BARs to enable
> + */
> +int pcibios_enable_device(struct pci_dev *dev, int mask)
> +{
> +	if (pci_has_flag(PCI_PROBE_ONLY))
> +		return 0;
> +
> +	return pci_enable_resources(dev, mask);
> +}
> +
>  /*
>   * Try to assign the IRQ number from DT when adding a new device
>   */
> -- 
> 2.2.1
> 

  reply	other threads:[~2015-08-28 21:14 UTC|newest]

Thread overview: 8+ 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-08-28 21:14 ` Bjorn Helgaas [this message]
2015-08-29 12:44   ` Lorenzo Pieralisi
2015-08-31 13:28     ` Bjorn Helgaas
2015-08-31 16:33       ` Lorenzo Pieralisi
2015-08-31 16:49         ` Bjorn Helgaas
2015-09-03 16:35           ` Bjorn Helgaas
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=20150828211444.GA27890@google.com \
    --to=bhelgaas@google.com \
    --cc=Suravee.Suthikulpanit@amd.com \
    --cc=catalin.marinas@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=tinamdar@apm.com \
    --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).