From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ross Lagerwall Subject: Re: [PATCH] xen/pci: Try harder to get PXM information for Xen Date: Thu, 9 Apr 2015 07:55:22 +0100 Message-ID: <5526225A.1080300@citrix.com> References: <1428500345-1752-1-git-send-email-ross.lagerwall@citrix.com> <552534D3.9090806@oracle.com> <55255AEB.4090401@citrix.com> <5525628F.3030507@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Yg6RN-0007Rs-D0 for xen-devel@lists.xenproject.org; Thu, 09 Apr 2015 06:59:53 +0000 In-Reply-To: <5525628F.3030507@oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Boris Ostrovsky , David Vrabel , xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org On 08/04/15 18:17, Boris Ostrovsky wrote: > On 04/08/2015 12:44 PM, David Vrabel wrote: >> On 08/04/15 15:01, Boris Ostrovsky wrote: >>> On 04/08/2015 09:39 AM, Ross Lagerwall wrote: >>>> If the device being added to Xen is not contained in the ACPI table, >>>> walk the PCI device tree to find a parent that is contained in the ACPI >>>> table before finding the PXM information from this device. >>>> >>>> Signed-off-by: Ross Lagerwall >>>> --- >>>> drivers/xen/pci.c | 15 +++++++++++++-- >>>> 1 file changed, 13 insertions(+), 2 deletions(-) >>>> >>>> diff --git a/drivers/xen/pci.c b/drivers/xen/pci.c >>>> index 95ee430..6837181 100644 >>>> --- a/drivers/xen/pci.c >>>> +++ b/drivers/xen/pci.c >>>> @@ -19,6 +19,7 @@ >>>> #include >>>> #include >>>> +#include >>>> #include >>>> #include >>>> #include >>>> @@ -67,8 +68,18 @@ static int xen_add_device(struct device *dev) >>>> #ifdef CONFIG_ACPI >>>> handle = ACPI_HANDLE(&pci_dev->dev); >>>> - if (!handle && pci_dev->bus->bridge) >>>> - handle = ACPI_HANDLE(pci_dev->bus->bridge); >>>> + if (!handle) { >>>> + /* >>>> + * This device was not listed in the ACPI name space at >>>> + * all. Try to get acpi handle of parent pci bus. >>>> + */ >>>> + struct pci_bus *pbus; >>>> + for (pbus = pci_dev->bus; pbus; pbus = pbus->parent) { >>>> + handle = acpi_pci_get_bridge_handle(pbus); >>>> + if (handle) >>>> + break; >>>> + } >>>> + } >>>> #ifdef CONFIG_PCI_IOV >>>> if (!handle && pci_dev->is_virtfn) >>>> handle = ACPI_HANDLE(physfn->bus->bridge); >>> >>> Shouldn't we first look at physfn, before going up the tree? >> That sounds sensible but should be a separate pre-requisite patch. > > It's already there: the last two (unchanged) lines above. The added > chunk should just move to after those two. > OK, I can swap it around. -- Ross Lagerwall