public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: bhelgaas@google•com (Bjorn Helgaas)
To: linux-arm-kernel@lists•infradead.org
Subject: [RFC/RFT PATCH 2/2] ARM64: kernel: pci: implement PCI device resources claiming
Date: Tue, 19 May 2015 18:25:31 -0500	[thread overview]
Message-ID: <20150519232531.GZ31666@google.com> (raw)
In-Reply-To: <1431614537-16136-2-git-send-email-lorenzo.pieralisi@arm.com>

Hi Lorenzo,

On Thu, May 14, 2015 at 03:42:16PM +0100, Lorenzo Pieralisi wrote:
> When a device is scanned and added to the PCI bus, its resources
> should be claimed to validate the BARs configuration and to assign
> them a parent resource so that the resource hierarchy can be sanity
> checked.
> 
> This patch adds code that carries out PCI device resources claiming to
> the ARM64 pcibios_add_device implementation so that device resources
> are claimed by the core PCI layer upon PCI device initialization on
> ARM64 systems.
> 
> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm•com>
> Cc: Arnd Bergmann <arnd@arndb•de>
> Cc: Will Deacon <will.deacon@arm•com>
> Cc: Liviu Dudau <liviu.dudau@arm•com>
> Cc: Bjorn Helgaas <bhelgaas@google•com>

Seems like Suravee proposed a tweak?  Can you post a v2 with that
incorporated if necessary?

Bjorn

> ---
>  arch/arm64/kernel/pci.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c
> index 4095379..c0a88ca 100644
> --- a/arch/arm64/kernel/pci.c
> +++ b/arch/arm64/kernel/pci.c
> @@ -43,8 +43,18 @@ resource_size_t pcibios_align_resource(void *data, const struct resource *res,
>   */
>  int pcibios_add_device(struct pci_dev *dev)
>  {
> +	struct resource *res;
> +	int i;
> +
>  	dev->irq = of_irq_parse_and_map_pci(dev, 0, 0);
>  
> +	for (i = 0; i < PCI_NUM_RESOURCES; i++) {
> +		res = &dev->resource[i];
> +		if (res->parent || !res->flags)
> +			continue;
> +		pci_claim_resource(dev, i);
> +	}
> +
>  	return 0;
>  }
>  
> -- 
> 2.2.1
> 

  parent reply	other threads:[~2015-05-19 23:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-14 14:42 [RFC/RFT PATCH 1/2] ARM: kernel: bios32: implement PCI device resources claiming Lorenzo Pieralisi
2015-05-14 14:42 ` [RFC/RFT PATCH 2/2] ARM64: kernel: pci: " Lorenzo Pieralisi
2015-05-15  2:09   ` Suravee Suthikulanit
2015-05-18 17:38     ` Lorenzo Pieralisi
2015-05-18 19:44       ` Suravee Suthikulanit
2015-05-20  8:56     ` Lorenzo Pieralisi
2015-05-20 13:02       ` Bjorn Helgaas
2015-05-20 17:48         ` Lorenzo Pieralisi
2015-05-19 23:25   ` Bjorn Helgaas [this message]
2015-05-20  9:16     ` 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=20150519232531.GZ31666@google.com \
    --to=bhelgaas@google$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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