All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Rahul Singh <Rahul.Singh@arm.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Andre Przywara <Andre.Przywara@arm.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>
Subject: Re: [PATCH v3 08/17] xen/device-tree: Add dt_get_pci_domain_nr helper
Date: Wed, 29 Sep 2021 07:35:20 +0000	[thread overview]
Message-ID: <E66E6BF0-5C3D-4290-BF0E-F23473A0B012@arm.com> (raw)
In-Reply-To: <f70ac215cd0c62d71231b8f61f12c1f8d801710e.1632847120.git.rahul.singh@arm.com>

Hi Rahul,

> On 28 Sep 2021, at 19:18, Rahul Singh <rahul.singh@arm.com> wrote:
> 
> Based Linux commit 41e5c0f81d3e676d671d96a0a1fafb27abfbd9d7
> 
> Import the Linux helper of_get_pci_domain_nr. This function will try to
> obtain the host bridge domain number by finding a property called
> "linux,pci-domain" of the given device node.
> 
> Signed-off-by: Rahul Singh <rahul.singh@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand

> ---
> Change in v3:
> - Modify commit message to include upstream Linux commit-id not stable
>  Linux commit-id
> - Remove return value as those are not valid for XEN
> Change in v2: Patch introduced in v2
> ---
> xen/common/device_tree.c      | 12 ++++++++++++
> xen/include/xen/device_tree.h | 17 +++++++++++++++++
> 2 files changed, 29 insertions(+)
> 
> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> index 53160d61f8..ea93da1725 100644
> --- a/xen/common/device_tree.c
> +++ b/xen/common/device_tree.c
> @@ -2183,6 +2183,18 @@ void __init dt_unflatten_host_device_tree(void)
>     dt_alias_scan();
> }
> 
> +int dt_get_pci_domain_nr(struct dt_device_node *node)
> +{
> +    u32 domain;
> +    int error;
> +
> +    error = dt_property_read_u32(node, "linux,pci-domain", &domain);
> +    if ( !error )
> +        return -EINVAL;
> +
> +    return (u16)domain;
> +}
> +
> /*
>  * Local variables:
>  * mode: C
> diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
> index 3ffe3eb3d2..2297c59ce6 100644
> --- a/xen/include/xen/device_tree.h
> +++ b/xen/include/xen/device_tree.h
> @@ -832,6 +832,23 @@ int dt_count_phandle_with_args(const struct dt_device_node *np,
>                                const char *list_name,
>                                const char *cells_name);
> 
> +/**
> + * dt_get_pci_domain_nr - Find the host bridge domain number
> + *            of the given device node.
> + * @node: Device tree node with the domain information.
> + *
> + * This function will try to obtain the host bridge domain number by finding
> + * a property called "linux,pci-domain" of the given device node.
> + *
> + * Return:
> + * * > 0    - On success, an associated domain number.
> + * * -EINVAL    - The property "linux,pci-domain" does not exist.
> + *
> + * Returns the associated domain number from DT in the range [0-0xffff], or
> + * a negative value if the required property is not found.
> + */
> +int dt_get_pci_domain_nr(struct dt_device_node *node);
> +
> #ifdef CONFIG_DEVICE_TREE_DEBUG
> #define dt_dprintk(fmt, args...)  \
>     printk(XENLOG_DEBUG fmt, ## args)
> -- 
> 2.17.1
> 



  parent reply	other threads:[~2021-09-29  7:35 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-28 18:18 [PATCH v3 00/17] PCI devices passthrough on Arm Rahul Singh
2021-09-28 18:18 ` [PATCH v3 01/17] xen/pci: Refactor MSI code that implements MSI functionality within XEN Rahul Singh
2021-09-29  7:28   ` Bertrand Marquis
2021-09-29 16:56   ` Stefano Stabellini
2021-09-30 14:22     ` Jan Beulich
2021-09-28 18:18 ` [PATCH v3 02/17] xen/arm: pci: Add stubs to allow selecting HAS_PCI Rahul Singh
2021-09-29  7:28   ` Bertrand Marquis
2021-09-28 18:18 ` [PATCH v3 03/17] xen/arm: solve compilation error on ARM with ACPI && HAS_PCI Rahul Singh
2021-09-29  7:29   ` Bertrand Marquis
2021-09-29  8:24   ` Jan Beulich
2021-09-29  9:29     ` Rahul Singh
2021-09-28 18:18 ` [PATCH v3 04/17] xen/arm: xc_domain_ioport_permission(..) not supported on ARM Rahul Singh
2021-09-29  7:30   ` Bertrand Marquis
2021-09-28 18:18 ` [PATCH v3 05/17] xen/arm: Add PHYSDEVOP_pci_device_* support for ARM Rahul Singh
2021-09-29  6:05   ` Stefano Stabellini
2021-09-29  7:34   ` Bertrand Marquis
2021-09-30 14:51   ` Jan Beulich
2021-10-01 16:19     ` Rahul Singh
2021-09-28 18:18 ` [PATCH v3 06/17] xen/device-tree: Add dt_property_read_variable_u32_array helper Rahul Singh
2021-09-29  6:06   ` Stefano Stabellini
2021-09-29  7:34   ` Bertrand Marquis
2021-09-28 18:18 ` [PATCH v3 07/17] xen/device-tree: Add dt_property_read_u32_array helper Rahul Singh
2021-09-29  6:07   ` Stefano Stabellini
2021-09-29  7:35   ` Bertrand Marquis
2021-09-28 18:18 ` [PATCH v3 08/17] xen/device-tree: Add dt_get_pci_domain_nr helper Rahul Singh
2021-09-29  6:09   ` Stefano Stabellini
2021-09-29  7:35   ` Bertrand Marquis [this message]
2021-09-28 18:18 ` [PATCH v3 09/17] xen/arm: Add support for PCI init to initialize the PCI driver Rahul Singh
2021-09-29  6:10   ` Stefano Stabellini
2021-09-29  7:35   ` Bertrand Marquis
2021-09-28 18:18 ` [PATCH v3 10/17] xen/arm: Add cmdline boot option "pci-passthrough = <boolean>" Rahul Singh
2021-09-29  6:11   ` Stefano Stabellini
2021-09-29  7:36   ` Bertrand Marquis
2021-09-30 15:00   ` Jan Beulich
2021-10-01 10:55     ` Rahul Singh
2021-09-28 18:18 ` [PATCH v3 11/17] xen/arm: PCI host bridge discovery within XEN on ARM Rahul Singh
2021-09-29  8:31   ` Jan Beulich
2021-09-29  8:59     ` Rahul Singh
2021-09-29 16:40   ` Stefano Stabellini
2021-09-30  7:47     ` Jan Beulich
2021-09-28 18:18 ` [PATCH v3 12/17] xen/arm: Add support for Xilinx ZynqMP PCI host controller Rahul Singh
2021-09-29 13:38   ` Bertrand Marquis
2021-09-29 14:17     ` Oleksandr Andrushchenko
2021-09-29 16:41   ` Stefano Stabellini
2021-09-30  7:48     ` Jan Beulich
2021-09-30 10:42       ` Rahul Singh
2021-09-28 18:18 ` [PATCH v3 13/17] xen/arm: Implement pci access functions Rahul Singh
2021-09-29 13:35   ` Bertrand Marquis
2021-09-29 16:42   ` Stefano Stabellini
2021-09-28 18:18 ` [PATCH v3 14/17] xen/arm: Enable the existing x86 virtual PCI support for ARM Rahul Singh
2021-09-29 16:45   ` Stefano Stabellini
2021-09-30 15:19   ` Jan Beulich
2021-10-01 11:44     ` Rahul Singh
2021-10-01 12:40       ` Jan Beulich
2021-09-28 18:18 ` [PATCH v3 15/17] xen/arm: Transitional change to build HAS_VPCI on ARM Rahul Singh
2021-09-29 13:39   ` Bertrand Marquis
2021-09-29 16:46   ` Stefano Stabellini
2021-09-28 18:18 ` [PATCH v3 16/17] arm/libxl: Emulated PCI device tree node in libxl Rahul Singh
2021-09-29 13:42   ` Bertrand Marquis
2021-09-29 16:47   ` Stefano Stabellini
2021-09-28 18:18 ` [PATCH v3 17/17] xen/arm: Add linux,pci-domain property for hwdom if not available Rahul Singh
2021-09-29 13:42   ` Bertrand Marquis
2021-09-29 16:48   ` Stefano Stabellini
2021-10-01  1:31 ` [PATCH v3 00/17] PCI devices passthrough on Arm Stefano Stabellini

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=E66E6BF0-5C3D-4290-BF0E-F23473A0B012@arm.com \
    --to=bertrand.marquis@arm.com \
    --cc=Andre.Przywara@arm.com \
    --cc=Rahul.Singh@arm.com \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /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.