linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pci-hyperv: Use only 16 bit integer for PCI domain
@ 2017-05-24 20:39 Haiyang Zhang
  2017-05-24 20:43 ` Haiyang Zhang
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Haiyang Zhang @ 2017-05-24 20:39 UTC (permalink / raw)
  To: bhelgaas, linux-pci
  Cc: haiyangz, kys, sthemmin, olaf, vkuznets, driverdev-devel, linux-kernel

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.

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

^ permalink raw reply related	[flat|nested] 14+ messages in thread
* [PATCH] pci-hyperv: Use only 16 bit integer for PCI domain
@ 2017-04-20 16:35 Haiyang Zhang
  2017-04-20 18:33 ` Bjorn Helgaas
  0 siblings, 1 reply; 14+ messages in thread
From: Haiyang Zhang @ 2017-04-20 16:35 UTC (permalink / raw)
  To: bhelgaas, linux-pci
  Cc: haiyangz, kys, sthemmin, olaf, vkuznets, driverdev-devel, linux-kernel

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.

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 e73880c..b18dff3 100644
--- a/drivers/pci/host/pci-hyperv.c
+++ b/drivers/pci/host/pci-hyperv.c
@@ -1334,9 +1334,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

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2017-06-19 21:10 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-24 20:39 [PATCH] pci-hyperv: Use only 16 bit integer for PCI domain Haiyang Zhang
2017-05-24 20:43 ` Haiyang Zhang
     [not found]   ` <20170525141955.6cee8fbb@alans-desktop>
2017-05-25 15:52     ` Stephen Hemminger
2017-05-25  7:56 ` Christoph Hellwig
2017-06-19 21:07 ` Bjorn Helgaas
2017-06-19 21:10   ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2017-04-20 16:35 Haiyang Zhang
2017-04-20 18:33 ` Bjorn Helgaas
2017-04-20 18:37   ` Haiyang Zhang
2017-04-20 19:12     ` Christoph Hellwig
2017-04-24 23:06     ` John Hubbard
2017-04-25 13:00       ` Dan Carpenter
2017-04-25 13:14       ` Christoph Hellwig
2017-04-25 18:19         ` John Hubbard

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).