Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1669954 > unrolled thread

Re: [PATCH] pci-hyperv: Use only 16 bit integer for PCI domain

Started byBjorn Helgaas <helgaas@kernel.org>
First post2017-06-19 23:10 +0200
Last post2017-06-19 23:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] pci-hyperv: Use only 16 bit integer for PCI domain Bjorn Helgaas <helgaas@kernel.org> - 2017-06-19 23:10 +0200
    Re: [PATCH] pci-hyperv: Use only 16 bit integer for PCI domain Christoph Hellwig <hch@infradead.org> - 2017-06-19 23:20 +0200

#1669954 — Re: [PATCH] pci-hyperv: Use only 16 bit integer for PCI domain

FromBjorn Helgaas <helgaas@kernel.org>
Date2017-06-19 23:10 +0200
SubjectRe: [PATCH] pci-hyperv: Use only 16 bit integer for PCI domain
Message-ID<tUc5Q-7Wx-15@gated-at.bofh.it>
[+cc Christoph]

On Wed, May 24, 2017 at 01:39:15PM -0700, Haiyang Zhang wrote:
> From: Haiyang Zhang <haiyangz@microsoft.com>
> 
> This patch uses the lower 16 bits of the serial number as PCI
> domain, otherwise some drivers may not be able to handle it.
> 
> Besides Nvidia drivers, we also found X.org, and DPDK handle
> only 16 bit PCI domain.

If you've sent patches to X.org and DPDK, please includes URLs to
them.

Christoph pointed out the conflict with VMD: vmd_find_free_domain()
allocates domains starting at 0x10000 to avoid the 16-bit domains
returned by ACPI _SEG.

I think we need a solution that works for both Nvidia/Hyper-V and VMD.
As it is, it looks like this will fix one place but break things
elsewhere.

If you believe that this will not break VMD, please explain.

Bjorn

> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
> ---
>  drivers/pci/host/pci-hyperv.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c
> index 8493638..51a815d 100644
> --- a/drivers/pci/host/pci-hyperv.c
> +++ b/drivers/pci/host/pci-hyperv.c
> @@ -1335,9 +1335,11 @@ static void put_pcichild(struct hv_pci_dev *hpdev,
>  	 * can have shorter names than based on the bus instance UUID.
>  	 * Only the first device serial number is used for domain, so the
>  	 * domain number will not change after the first device is added.
> +	 * The lower 16 bits of the serial number is used, otherwise some
> +	 * drivers may not be able to handle it.
>  	 */
>  	if (list_empty(&hbus->children))
> -		hbus->sysdata.domain = desc->ser;
> +		hbus->sysdata.domain = desc->ser & 0xFFFF;
>  	list_add_tail(&hpdev->list_entry, &hbus->children);
>  	spin_unlock_irqrestore(&hbus->device_list_lock, flags);
>  	return hpdev;
> -- 
> 1.7.1
> 

[toc] | [next] | [standalone]


#1669962

FromChristoph Hellwig <hch@infradead.org>
Date2017-06-19 23:20 +0200
Message-ID<tUcfw-7ZZ-15@gated-at.bofh.it>
In reply to#1669954
FYI, I've also got another driver in progress that will need domains
assigned outside the ACPI range, so it's not just limited to VMD.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web