linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
To: Jan Kiszka <jan.kiszka@siemens.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	<linux-pci@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>
Cc: Jingoo Han <jingoohan1@gmail.com>,
	Joao Pinto <Joao.Pinto@synopsys.com>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Subject: Re: [PATCH v3 4/8] PCI: Replace dev_node parameter of of_pci_get_host_bridge_resources with device
Date: Tue, 15 May 2018 10:54:33 +0300	[thread overview]
Message-ID: <f74386a1-48b5-ebe0-1b6c-dbef1847cda8@mentor.com> (raw)
In-Reply-To: <5f2226585c6af9920b266d0503e32042d4c9e440.1526363896.git.jan.kiszka@siemens.com>

Hi Jan,

On 05/15/2018 08:58 AM, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
> 
> Another step towards a managed version of
> of_pci_get_host_bridge_resources(): Feed in the underlying device,
> rather than just the OF node. This will allow to use managed resource
> allocation internally later on.
> 
> CC: Jingoo Han <jingoohan1@gmail.com>
> CC: Joao Pinto <Joao.Pinto@synopsys.com>
> CC: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>

[snip]

> diff --git a/drivers/pci/of.c b/drivers/pci/of.c
> index 8d4778ef5806..ac97491ba377 100644
> --- a/drivers/pci/of.c
> +++ b/drivers/pci/of.c
> @@ -245,7 +245,7 @@ EXPORT_SYMBOL_GPL(of_pci_check_probe_only);
>  #if defined(CONFIG_OF_ADDRESS)
>  /**
>   * of_pci_get_host_bridge_resources - Parse PCI host bridge resources from DT
> - * @dev_node: device node of the host bridge having the range property
> + * @dev: host bridge device
>   * @busno: bus number associated with the bridge root bus
>   * @bus_max: maximum number of buses for this bridge
>   * @resources: list where the range of resources will be added after DT parsing
> @@ -262,10 +262,11 @@ EXPORT_SYMBOL_GPL(of_pci_check_probe_only);
>   * It returns zero if the range parsing has been successful or a standard error
>   * value if it failed.
>   */
> -int of_pci_get_host_bridge_resources(struct device_node *dev_node,
> +int of_pci_get_host_bridge_resources(struct device *dev,
>  			unsigned char busno, unsigned char bus_max,
>  			struct list_head *resources, resource_size_t *io_base)
>  {
> +	struct device_node *dev_node = dev->of_node;
>  	struct resource_entry *window;
>  	struct resource *res;
>  	struct resource *bus_range;
> @@ -599,12 +600,12 @@ int pci_parse_request_of_pci_ranges(struct device *dev,
>  				    struct resource **bus_range)
>  {
>  	int err, res_valid = 0;
> -	struct device_node *np = dev->of_node;
>  	resource_size_t iobase;
>  	struct resource_entry *win, *tmp;
>  
>  	INIT_LIST_HEAD(resources);
> -	err = of_pci_get_host_bridge_resources(np, 0, 0xff, resources, &iobase);
> +	err = of_pci_get_host_bridge_resources(dev, 0, 0xff, resources,
> +						    &iobase);

just a note, it's a funny selected indentation style across this change
to avoid indentation issues in v3 6/8. It seems to be innocent though.

>  	if (err)
>  		return err;
>  
> diff --git a/include/linux/of_pci.h b/include/linux/of_pci.h
> index 74eec1943ad2..e6684c68cb94 100644
> --- a/include/linux/of_pci.h
> +++ b/include/linux/of_pci.h
> @@ -71,11 +71,11 @@ of_irq_parse_and_map_pci(const struct pci_dev *dev, u8 slot, u8 pin)
>  #endif
>  
>  #if defined(CONFIG_OF_ADDRESS)
> -int of_pci_get_host_bridge_resources(struct device_node *dev_node,
> +int of_pci_get_host_bridge_resources(struct device *dev,
>  			unsigned char busno, unsigned char bus_max,
>  			struct list_head *resources, resource_size_t *io_base);
>  #else
> -static inline int of_pci_get_host_bridge_resources(struct device_node *dev_node,
> +static inline int of_pci_get_host_bridge_resources(struct device *dev,
>  			unsigned char busno, unsigned char bus_max,
>  			struct list_head *resources, resource_size_t *io_base)
>  {
> 

Tested-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Reviewed-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>

--
With best wishes,
Vladimir

  reply	other threads:[~2018-05-15  7:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-15  5:58 [PATCH v3 0/8] PCI: leak fixes, removable generic PCI host, assorted stuff Jan Kiszka
2018-05-15  5:58 ` [PATCH v3 1/8] PCI: Make pci_get_new_domain_nr() static Jan Kiszka
2018-05-15  5:58 ` [PATCH v3 2/8] PCI: Fix memory leak of devm_pci_alloc_host_bridge() Jan Kiszka
2018-05-15  5:58 ` [PATCH v3 3/8] PCI: Rename device node parameter of of_pci_get_host_bridge_resources() Jan Kiszka
2018-05-15  7:58   ` Vladimir Zapolskiy
2018-05-15  5:58 ` [PATCH v3 4/8] PCI: Replace dev_node parameter of of_pci_get_host_bridge_resources with device Jan Kiszka
2018-05-15  7:54   ` Vladimir Zapolskiy [this message]
2018-05-15  5:58 ` [PATCH v3 5/8] PCI: Replace pr_*() with dev_*() in of_pci_get_host_bridge_resources() Jan Kiszka
2018-05-15  7:57   ` Vladimir Zapolskiy
2018-05-15  5:58 ` [PATCH v3 6/8] PCI: Rework of_pci_get_host_bridge_resources() to devm_of_pci_get_host_bridge_resources() Jan Kiszka
2018-05-15  7:54   ` Vladimir Zapolskiy
2018-05-15  8:36     ` Jan Kiszka
2018-05-15  5:58 ` [PATCH v3 7/8] PCI: Add support for unbinding the generic PCI host controller Jan Kiszka
2018-05-15  5:58 ` [PATCH v3 8/8] PCI: Enable PCI_DOMAINS along with " Jan Kiszka
2018-05-15  7:58 ` [PATCH v3 0/8] PCI: leak fixes, removable generic PCI host, assorted stuff Vladimir Zapolskiy
2018-05-15  8:39   ` Jan Kiszka

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=f74386a1-48b5-ebe0-1b6c-dbef1847cda8@mentor.com \
    --to=vladimir_zapolskiy@mentor.com \
    --cc=Joao.Pinto@synopsys.com \
    --cc=bhelgaas@google.com \
    --cc=jan.kiszka@siemens.com \
    --cc=jingoohan1@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@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).