From patchwork Thu Apr 20 16:35:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haiyang Zhang X-Patchwork-Id: 752905 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3w84Yz1Mhsz9s2x for ; Fri, 21 Apr 2017 02:48:23 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S971282AbdDTQsV (ORCPT ); Thu, 20 Apr 2017 12:48:21 -0400 Received: from a2nlsmtp01-03.prod.iad2.secureserver.net ([198.71.225.37]:55794 "EHLO a2nlsmtp01-03.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S971283AbdDTQsU (ORCPT ); Thu, 20 Apr 2017 12:48:20 -0400 X-Greylist: delayed 676 seconds by postgrey-1.27 at vger.kernel.org; Thu, 20 Apr 2017 12:48:20 EDT Received: from linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with SMTP id 1F3pdCwIBYdoi1F3pdk609; Thu, 20 Apr 2017 09:36:01 -0700 x-originating-ip: 107.180.71.197 Received: from haiyangz by linuxonhyperv.com with local (Exim 4.89) (envelope-from ) id 1d1F3o-0005y3-VG; Thu, 20 Apr 2017 09:36:01 -0700 From: Haiyang Zhang To: bhelgaas@google.com, linux-pci@vger.kernel.org Cc: haiyangz@microsoft.com, kys@microsoft.com, sthemmin@microsoft.com, olaf@aepfle.de, vkuznets@redhat.com, driverdev-devel@linuxdriverproject.org, linux-kernel@vger.kernel.org Subject: [PATCH] pci-hyperv: Use only 16 bit integer for PCI domain Date: Thu, 20 Apr 2017 09:35:23 -0700 Message-Id: <1492706123-22913-1-git-send-email-haiyangz@exchange.microsoft.com> X-Mailer: git-send-email 1.7.1 Reply-To: haiyangz@microsoft.com X-CMAE-Envelope: MS4wfMMWLbxMiveW5R0XbvHymCI+MP2gb8LV+p7xVycFt2kSwFvGYUgydtitjU0QixVuv3C68DVEY/H3dzb3uMDZph9qyAgGEsw9YU7P2Ts9VN2KBvzptNKs VIDK+tpkpItJKfuTXWzy3pAtu/yiEN1hBSvNkizwKr2IrUkjsL0tBKx847KaCqFyma5dg+PyJ/j09D8wTYt3l8DmpfNNOBHvIfsCjOvHxztHlYgLWJrlktmu Z8SFUOMEqE9EIeLXiewBP1PXICUi9bUiALuzQaEjOYFBsPQe9YdMyC7XIZ2Jty9homrcl21Q+uM5uvskLhBKs4qrWHctCnhyUhclg3skNcdTDh447DISMOtD w0nxp3lCXO0iCFCiw21oPd50cEP/sCNt6ITQisHAlBBro/0i+/J7jL2TcJtf1J9TmNQjHZDRXnwhLdXxbTR4KNJLfq9vdora4DmKGeOc9UYAoMIz15/V/dtS 9/Z65Xiz21LDPZ9d Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org From: Haiyang Zhang 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 --- 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;