From patchwork Fri Mar 9 05:02:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sridhar Pitchai X-Patchwork-Id: 883462 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=reject dis=none) header.from=microsoft.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=microsoft.com header.i=@microsoft.com header.b="So/mwaUE"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zyFcc141fz9scb for ; Fri, 9 Mar 2018 16:02:40 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750948AbeCIFCi (ORCPT ); Fri, 9 Mar 2018 00:02:38 -0500 Received: from mail-cys01nam02on0094.outbound.protection.outlook.com ([104.47.37.94]:56480 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750918AbeCIFCh (ORCPT ); Fri, 9 Mar 2018 00:02:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=vkbrOBVAVB3bzc/1outLCaL56Z7+NwvIQBJa4FVp3+w=; b=So/mwaUE0NBbhksvdG8VPt9W1fFm69XVDdmLwPF7QsncnKzcK2P1DBJcGZiGjmmHoFucOKJrsKbz7EwRxfbH87LIutxCq6lndWKz5xnX4gKI01LhJIU08kbtFCO7Psf3PttoshkBzE+IshhcTD6XBBKOF5WVrc8AV4hqyI7FN3Y= Received: from DM5PR21MB0826.namprd21.prod.outlook.com (10.173.172.8) by DM5PR21MB0779.namprd21.prod.outlook.com (10.173.172.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.588.3; Fri, 9 Mar 2018 05:02:34 +0000 Received: from DM5PR21MB0826.namprd21.prod.outlook.com ([fe80::6d1c:76eb:b21e:1a40]) by DM5PR21MB0826.namprd21.prod.outlook.com ([fe80::6d1c:76eb:b21e:1a40%5]) with mapi id 15.20.0588.009; Fri, 9 Mar 2018 05:02:34 +0000 From: Sridhar Pitchai To: Lorenzo Pieralisi , Bjorn Helgaas , Jake Oshins , Haiyang Zhang , Stephen Hemminger , Dexuan Cui CC: KY Srinivasan , "devel@linuxdriverproject.org" , "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH] PCI: hv: fix bus domain ID corruption Thread-Topic: [PATCH] PCI: hv: fix bus domain ID corruption Thread-Index: AQHTt2LLU4f2U+zlPUKLwzS9FiUhSKPG0skA Date: Fri, 9 Mar 2018 05:02:34 +0000 Message-ID: <19EE9647-AE9B-443E-ADBD-51CCEFC3EDEA@microsoft.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Owner=srpitcha@microsoft.com; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2018-03-08T21:58:55.7326370Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=General; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Application=Microsoft Azure Information Protection; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Extended_MSFT_Method=Automatic; Sensitivity=General x-originating-ip: [98.232.109.128] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DM5PR21MB0779; 7:3CzSf+Xdi0jw/K+IydLdSEnaZ3Mxak6GJXOWIcT+CfVddsbcCTVVcsbJf6LqtnL2i0DPBqNEsllVcJeFsL8bZpJpAykSDKa1VgnxSsNBJK2nN4WLl4vntz8OC1ewOxtkfssZUaWwSJ1AicCF2gItK9B7mbKwgudrmTZUolvYffg6CXsDqImSQTXIghgMRovw28Qw9hfcvJqf9F/HU2a25numrDJfnQSXOZlIfK98hZe4JXdmdHyhlAZH9pksCeG5; 20:turHkGOtrdYYPMqk5INLzT8RT1E195j8AUO1yv6Ta02AoFRVOSyxeLl32CNAxkeKrmlDoqnzijBXv2sJMhessD/+0XGTXgBadjmcKJVr6MCG48ZdeBIpq6Lx3+/sRQVberAUBKt22B+GEle85rDG8JPc2nBWupl87i4hBAucm6U= x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 26983074-eaf4-4acf-f70a-08d5857af8be x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020); SRVR:DM5PR21MB0779; x-ms-traffictypediagnostic: DM5PR21MB0779: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Sridhar.Pitchai@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(9452136761055); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3231220)(944501255)(52105095)(93006095)(93001095)(3002001)(6055026)(61426038)(61427038)(6041310)(20161123564045)(20161123562045)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DM5PR21MB0779; BCL:0; PCL:0; RULEID:; SRVR:DM5PR21MB0779; x-forefront-prvs: 0606BBEB39 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(346002)(376002)(39860400002)(366004)(39380400002)(396003)(189003)(199004)(40224003)(36756003)(10090500001)(4326008)(25786009)(106356001)(68736007)(6436002)(6512007)(82746002)(5250100002)(33656002)(6486002)(22452003)(53936002)(186003)(26005)(59450400001)(102836004)(1857600001)(66066001)(316002)(6506007)(86612001)(3280700002)(110136005)(54906003)(105586002)(2906002)(3660700001)(2900100001)(2950100002)(6636002)(99286004)(1511001)(76176011)(97736004)(8936002)(86362001)(14454004)(7736002)(6116002)(83716003)(72206003)(5660300001)(81166006)(305945005)(81156014)(3846002)(478600001)(8676002)(10290500003)(22906009); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR21MB0779; H:DM5PR21MB0826.namprd21.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: jYdXnDZKtj39+RhQLdYjVfkhqM0NaeME0saGPELaeMBpIaR4swpydMl5nPkEwaeMi9DH2u9JQVZDtZwKXEwcOCslKxblZ830LwthhKh1zt1Je0GXlzYid8cYIZiKu4C866mBFcq1EvuN9C3KdGWdlye+NoxGPFxSY4cadEXV4C96zB56cy8xPAoxPSb/IOJk6/s0tcDa0Kl7WMm32yNvMe2L85uAwTMAgtZXH9Ft7RZZCqaUJrE0k6IiceImOfme/hapl8cLwVOjkHiNh6o9vCg5/xMLGiCqab6BLqrf1HCbNLasNnoHWUCzniYNo8bkK+GQz0slCFmOq/tGOuggVA== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-ID: <5CDB13B82B129F48B3D574DF9F2EE0F9@namprd21.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 26983074-eaf4-4acf-f70a-08d5857af8be X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Mar 2018 05:02:34.7571 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR21MB0779 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org When PCI BUS is added, PCI_BUS domain ID is set. When PCI_BUS and a device added to the bus is racing against each other, the first device tends to overwrite the domain ID. In order to avoid the race, this patch make sure when a device is added to a bus, it never updated the bus domain ID. Since we have the transparent SRIOV mode now, the short VF device name is no longer needed. Fixes: 4a9b0933bdfc("PCI:hv:Use device serial number as PCI domain") Cc: stable@vger.kernel.org Signed-off-by: Sridhar Pitchai --- drivers/pci/host/pci-hyperv.c | 11 ----------- 1 file changed, 11 deletions(-) -- 2.7.4 diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c index 2faf38e..ac67e56 100644 --- a/drivers/pci/host/pci-hyperv.c +++ b/drivers/pci/host/pci-hyperv.c @@ -1518,17 +1518,6 @@ static struct hv_pci_dev *new_pcichild_device(struct hv_pcibus_device *hbus, get_pcichild(hpdev, hv_pcidev_ref_childlist); spin_lock_irqsave(&hbus->device_list_lock, flags); - /* - * When a device is being added to the bus, we set the PCI domain - * number to be the device serial number, which is non-zero and - * unique on the same VM. The serial numbers start with 1, and - * increase by 1 for each device. So device names including this - * 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. - */ - if (list_empty(&hbus->children)) - hbus->sysdata.domain = desc->ser; list_add_tail(&hpdev->list_entry, &hbus->children); spin_unlock_irqrestore(&hbus->device_list_lock, flags); return hpdev;