Received: by 10.213.65.68 with SMTP id h4csp2113434imn; Sun, 8 Apr 2018 20:03:25 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/tUoQdMfnNeo2/wgZWsT65+VNpfdJWz5/eaE7E8bO7J6XffEJ1ad7hADK84YywhkqSwRVO X-Received: by 2002:a17:902:6b45:: with SMTP id g5-v6mr36031933plt.171.1523243005601; Sun, 08 Apr 2018 20:03:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243005; cv=none; d=google.com; s=arc-20160816; b=VCSzORi/HXAHoBfCxMo1yWU8ZDvJP483qU+qe01+CvUuo4YWrtNK2bqSZm93wKh/LO bWU3qV4GgFKKa2sHjDaKl0s6v73xpB43l2uluwdJyVFW1iDwlJx6+17th+4Ge56S1oBg Nx4JmcYkJGKuXNyxr0sDr5cgpjf00H77V0JX7VJSDS+6fffgnhJWyvs20cMkITVmfYBc 6OCwVA5NDZQ9eA1qY+xdxuHY2Zr5OEpl9jZ0CwiQxxM0OjNXDUWxdZTKpHOL5H3YP0iV kk+Y6udrZFYj2PCk17TeL8dP7rV6bMBqyBFwzdGXemVcIPMxXPuIQdAOAfyw1zpiqSkb 52mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=laXjHp24mmPMyeahN0VQhdaG5P2j2qEK/aUcayUvLp8=; b=xatuSgUgIN12FM3wAGNJf6bcThP/mJFSIaUjFMgRF57sgN3B/XXT67qMe0V5Ky889U YTtBxUer/mSO/TMFsVtFNrIdGVgRSO41RkPRj0fZxgaq+8LiWalqGNhIh4yfIofDy/jm XtOYaL19+vjHsaTCg2Yl7HCzkfy8UnRTLLyR4thT/NX67EuARRx9RppGB/NXWI8zefjj /Cu/HUVfBxyLvBkxBpqd/KN1EH8MifSbPOZVz/bKq69JfZsf9S7+dA8jb2HEERblgCgd hSAfIL5SQhtORC4pbCClAqNuVDDbY2IDDVSY5eVF3kzC+DlT86gTaKmjk/2I6mQTchtn Btgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=DVlehfBH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q6si10384382pgt.130.2018.04.08.20.02.48; Sun, 08 Apr 2018 20:03:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=DVlehfBH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755705AbeDIA1s (ORCPT + 99 others); Sun, 8 Apr 2018 20:27:48 -0400 Received: from mail-sn1nam02on0101.outbound.protection.outlook.com ([104.47.36.101]:56960 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755652AbeDIA1j (ORCPT ); Sun, 8 Apr 2018 20:27:39 -0400 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=laXjHp24mmPMyeahN0VQhdaG5P2j2qEK/aUcayUvLp8=; b=DVlehfBHanPSba5lr4kJwZoupGfUHyTCJwlScY0/VpctlgUD9IIweT3ua93azH09taVA2eJwEkWbyxbf90148vQ0okay9QhrqtZGCrdTLVoN+60p/wBTcGFV8fHJwx/H/3R02Gk+jRBgkUXQ2Tz0bwwTZe/n4mjyFMsXfxYtYrM= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0871.namprd21.prod.outlook.com (10.167.110.167) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.2; Mon, 9 Apr 2018 00:27:33 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:27:33 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Sujith Pandel , Narendra K , Bjorn Helgaas , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 057/293] PCI: Add domain number check to find_smbios_instance_string() Thread-Topic: [PATCH AUTOSEL for 4.9 057/293] PCI: Add domain number check to find_smbios_instance_string() Thread-Index: AQHTz5j+QIG6keEwgU+A+7dOb3KC2w== Date: Mon, 9 Apr 2018 00:23:35 +0000 Message-ID: <20180409002239.163177-57-alexander.levin@microsoft.com> References: <20180409002239.163177-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002239.163177-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB0871;7:87ZtNKV80SyhZFg9btoMNqwhaOzMUEcgugn4Rc7REQWrSWdKtB1D0AmDVQK4DxESb9SYolEoR3gnuaMeDohv6Jnutt0PudNg7+erj+LI6aXMbGcS8xX9g49fj9cfSYhv7PVe/VzDE81kcrwUi84qgJf0Fhv4+ADavVaqOJXJsLevkZHk4iQBqD6z01w8ZdViqXMkFArD32OADV/ZJui+7IzGR3A9CXwYHXaybK/BxuxP75wrYlReS2EUm1oKGFGl;20:cFhWKSNJV+5r3yGcbD55rS6sZUqVQePWv5eSxbMo5lViLoM5i5/++Uz5tcV2JMH+536gQvVkVHx8szRw/+cFyvOz9OpXnIndjcdI0h7meyMMCnUHTVD/vObSWz677wS8g8nEgtg5lWuQmPx8rqc/jMv7kCy0J2cFcR75dItONvI= X-MS-Office365-Filtering-Correlation-Id: 9227bfb4-9ff3-45cf-3a81-08d59db0b02f x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(48565401081)(2017052603328)(7193020);SRVR:DM5PR2101MB0871; x-ms-traffictypediagnostic: DM5PR2101MB0871: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(85827821059158)(211936372134217)(153496737603132)(56004941905204); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(3231221)(944501327)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR2101MB0871;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0871; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(366004)(396003)(39380400002)(376002)(39860400002)(199004)(189003)(105586002)(8676002)(3660700001)(3280700002)(6506007)(81156014)(81166006)(14454004)(99286004)(72206003)(110136005)(8936002)(54906003)(305945005)(2906002)(316002)(10290500003)(478600001)(7736002)(53936002)(6512007)(486006)(11346002)(39060400002)(4326008)(86362001)(575784001)(446003)(3846002)(102836004)(76176011)(476003)(25786009)(22452003)(36756003)(107886003)(10090500001)(5660300001)(6486002)(86612001)(6436002)(2616005)(68736007)(8666007)(26005)(1076002)(186003)(2501003)(5250100002)(2900100001)(106356001)(66066001)(6116002)(97736004)(22906009)(37363001)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0871;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: zbOVAvWIjgS8vII+Y21yw2hv6W8hL3aNoCukuh2/w7y8bfv6YN+MXFsMhp0FRTFUJ3Y2+vRPIIk7ZU2ED9+DXqt/a7b349eNEP63MO7pMUwZy73F6vmYFxESMBpO0H9MRISLt2tdkZdCrdZK+GsgQpco85GgpyaTSfRSLoG+SVRN1ZFrMq14VrkZLXo3phCVTMOYCECcM3QDc4UBMkUzoiuUoaQNY1U3PbIcSdcwi2jMzKOYDtfCrKnOgL7MczOuFMI3FZaiQF6lON60nQjZj9amHdWqvXRd5J/3kJmx0wQRNFQc9Rnzq2KvFFMwVkYsH+1XCInF/kdlZS1DAGB9036jNUjBqJKOLGZNbUrl1rZgg5aFyggFGd+ozoRH21iZEA0Dw6xI/8eIyqfdDUx3DRQPMonU/QLjIE/TM4xFr1M= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9227bfb4-9ff3-45cf-3a81-08d59db0b02f X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:23:35.0655 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0871 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sujith Pandel [ Upstream commit 6c51c82c60991bdbfb937f3bf0cdbe68d042073d ] The function find_smbios_instance_string() does not consider the PCI domain number. As a result, SMBIOS type 41 device type instance would be exported to sysfs for all the PCI domains which have a PCI device with same bus/device/function, though PCI bus/device/func from a specific PCI domain has SMBIOS type 41 device type instance defined. Address the issue by making find_smbios_instance_string() check PCI domain number as well. Reported-by: Shai Fultheim Suggested-by: Shai Fultheim Tested-by: Shai Fultheim Signed-off-by: Sujith Pandel Signed-off-by: Narendra K Signed-off-by: Bjorn Helgaas Signed-off-by: Sasha Levin --- drivers/pci/pci-label.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/pci/pci-label.c b/drivers/pci/pci-label.c index 51357377efbc..1d828a614ac0 100644 --- a/drivers/pci/pci-label.c +++ b/drivers/pci/pci-label.c @@ -43,9 +43,11 @@ static size_t find_smbios_instance_string(struct pci_dev= *pdev, char *buf, { const struct dmi_device *dmi; struct dmi_dev_onboard *donboard; + int domain_nr; int bus; int devfn; =20 + domain_nr =3D pci_domain_nr(pdev->bus); bus =3D pdev->bus->number; devfn =3D pdev->devfn; =20 @@ -53,8 +55,9 @@ static size_t find_smbios_instance_string(struct pci_dev = *pdev, char *buf, while ((dmi =3D dmi_find_device(DMI_DEV_TYPE_DEV_ONBOARD, NULL, dmi)) !=3D NULL) { donboard =3D dmi->device_data; - if (donboard && donboard->bus =3D=3D bus && - donboard->devfn =3D=3D devfn) { + if (donboard && donboard->segment =3D=3D domain_nr && + donboard->bus =3D=3D bus && + donboard->devfn =3D=3D devfn) { if (buf) { if (attribute =3D=3D SMBIOS_ATTR_INSTANCE_SHOW) return scnprintf(buf, PAGE_SIZE, --=20 2.15.1