All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rahul Singh <Rahul.Singh@arm.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
	Bertrand Marquis <Bertrand.Marquis@arm.com>,
	Andre Przywara <Andre.Przywara@arm.com>,
	Julien Grall <julien@xen.org>
Subject: Re: [PATCH v2 08/17] xen/device-tree: Add dt_get_pci_domain_nr helper
Date: Thu, 23 Sep 2021 11:52:39 +0000	[thread overview]
Message-ID: <8D1C3683-3AB7-4A83-B6A9-2442102164BB@arm.com> (raw)
In-Reply-To: <alpine.DEB.2.21.2109221649260.17979@sstabellini-ThinkPad-T480s>

Hi Stefano,

> On 23 Sep 2021, at 12:50 am, Stefano Stabellini <sstabellini@kernel.org> wrote:
> 
> On Wed, 22 Sep 2021, Rahul Singh wrote:
>> Based on tag Linux v5.14.2 commit bbdd3de144fc142f2f4b9834c9241cc4e7f3d3fc
> 
> Please use an upstream commit id
Ack.
> 
> 
>> 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>
>> ---
>> Change in v2: Patch introduced in v2
>> ---
>> xen/common/device_tree.c      | 12 ++++++++++++
>> xen/include/xen/device_tree.h | 19 +++++++++++++++++++
>> 2 files changed, 31 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 497144b8a7..9069040ef7 100644
>> --- a/xen/include/xen/device_tree.h
>> +++ b/xen/include/xen/device_tree.h
>> @@ -831,6 +831,25 @@ 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.
>> + * * -ENODATA   - The linux,pci-domain" property does not have value.
>> + * * -EOVERFLOW - Invalid "linux,pci-domain" property value.
> 
> This doesn't match reality for us because it can only return EINVAL

I will remove in next version.

Regards,
Rahul
> 
>> + * 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



  reply	other threads:[~2021-09-23 11:53 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-22 11:34 [PATCH v2 00/17] PCI devices passthrough on Arm Rahul Singh
2021-09-22 11:34 ` [PATCH v2 01/17] xen/pci: Refactor MSI code that implements MSI functionality within XEN Rahul Singh
2021-09-22 11:34 ` [PATCH v2 02/17] xen/pci: solve compilation error on ARM with HAS_PCI enabled Rahul Singh
2021-09-22 22:04   ` Stefano Stabellini
2021-09-23  2:07   ` Julien Grall
2021-09-23 11:14     ` Rahul Singh
2021-09-22 11:34 ` [PATCH v2 03/17] xen/arm: solve compilation error on ARM with ACPI && HAS_PCI Rahul Singh
2021-09-22 22:08   ` Stefano Stabellini
2021-09-22 11:34 ` [PATCH v2 04/17] xen/arm: xc_domain_ioport_permission(..) not supported on ARM Rahul Singh
2021-09-22 22:13   ` Stefano Stabellini
2021-09-22 11:34 ` [PATCH v2 05/17] xen/arm: Add PHYSDEVOP_pci_device_* support for ARM Rahul Singh
2021-09-22 22:37   ` Stefano Stabellini
2021-09-23 11:19     ` Rahul Singh
2021-09-22 11:34 ` [PATCH v2 06/17] xen/device-tree: Add dt_property_read_variable_u32_array helper Rahul Singh
2021-09-22 23:06   ` Stefano Stabellini
2021-09-23 11:21     ` Rahul Singh
2021-09-22 11:34 ` [PATCH v2 07/17] xen/device-tree: Add dt_property_read_u32_array helper Rahul Singh
2021-09-22 23:44   ` Stefano Stabellini
2021-09-22 11:34 ` [PATCH v2 08/17] xen/device-tree: Add dt_get_pci_domain_nr helper Rahul Singh
2021-09-22 23:50   ` Stefano Stabellini
2021-09-23 11:52     ` Rahul Singh [this message]
2021-09-22 11:34 ` [PATCH v2 09/17] xen/arm: Add support for PCI init to initialize the PCI driver Rahul Singh
2021-09-23  0:03   ` Stefano Stabellini
2021-09-23 14:53     ` Rahul Singh
2021-09-22 11:34 ` [PATCH v2 10/17] xen/arm: Add cmdline boot option "pci-passthrough = <boolean>" Rahul Singh
2021-09-23  0:14   ` Stefano Stabellini
2021-09-23 15:03     ` Rahul Singh
2021-09-22 11:34 ` [PATCH v2 11/17] xen/arm: PCI host bridge discovery within XEN on ARM Rahul Singh
2021-09-23  2:09   ` Stefano Stabellini
2021-09-23 13:03     ` Oleksandr Andrushchenko
2021-09-23 15:36       ` Stefano Stabellini
2021-09-23 17:08     ` Rahul Singh
2021-09-23 19:12       ` Stefano Stabellini
2021-09-24 12:54         ` Rahul Singh
2021-09-24 21:42           ` Stefano Stabellini
2021-09-24 23:26             ` Stefano Stabellini
2021-09-27 16:20               ` Rahul Singh
2021-09-27 16:59             ` Julien Grall
2021-09-22 11:34 ` [PATCH v2 12/17] xen/arm: Add support for Xilinx ZynqMP PCI host controller Rahul Singh
2021-09-23  2:11   ` Stefano Stabellini
2021-09-23 15:08     ` Rahul Singh
2021-09-22 11:34 ` [PATCH v2 13/17] xen:arm: Implement pci access functions Rahul Singh
2021-09-23  2:23   ` Stefano Stabellini
2021-09-23  8:52     ` Julien Grall
2021-09-23 15:17       ` Rahul Singh
2021-09-23  9:02     ` Julien Grall
2021-09-23 15:19       ` Rahul Singh
2021-09-23 15:15     ` Rahul Singh
2021-09-22 11:35 ` [PATCH v2 14/17] xen/arm: Enable the existing x86 virtual PCI support for ARM Rahul Singh
2021-09-23  2:41   ` Stefano Stabellini
2021-09-23 15:34     ` Rahul Singh
2021-09-24  7:21       ` Oleksandr Andrushchenko
2021-09-24  7:37     ` Jan Beulich
2021-09-24  7:44   ` Jan Beulich
2021-09-28 16:32     ` Rahul Singh
2021-09-22 11:35 ` [PATCH v2 15/17] xen/arm: Transitional change to build HAS_VPCI on ARM Rahul Singh
2021-09-22 11:35 ` [PATCH v2 16/17] arm/libxl: Emulated PCI device tree node in libxl Rahul Singh
2021-09-23 20:41   ` Stefano Stabellini
2021-09-22 11:35 ` [PATCH v2 17/17] xen/arm: Add linux,pci-domain property for hwdom if not available Rahul Singh
2021-09-23  2:52   ` Stefano Stabellini
2021-09-23 15:21     ` Rahul Singh

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=8D1C3683-3AB7-4A83-B6A9-2442102164BB@arm.com \
    --to=rahul.singh@arm.com \
    --cc=Andre.Przywara@arm.com \
    --cc=Bertrand.Marquis@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.