Received: by 10.223.164.202 with SMTP id h10csp4695186wrb; Wed, 29 Nov 2017 10:18:13 -0800 (PST) X-Google-Smtp-Source: AGs4zMa9iv2rrsUP2w1qZklrSBb/cFa2KrbeJKkfl/w1s7/w7uVeeIhBoidAQdgLdThKa3v3kj2K X-Received: by 10.98.253.3 with SMTP id p3mr3934687pfh.20.1511979493014; Wed, 29 Nov 2017 10:18:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511979492; cv=none; d=google.com; s=arc-20160816; b=atswJBxEe3R6mUqO3aGEBir3xV6KY6PUcPevNCH0Sgvm0xb0JB9tVXUtKHWicLIobZ jdLdlilArSoc39w6u+tN7WZo8/isJIKTndKwEf8bCZ9880Qf2pnV7G9p3gUosx5eWA6m AAVqOZmgPJGQV/FLmOAynRz+yVOxO7KLqF6HLbVyb4BeHxkY1aUr03uq15iwvLRv4579 HUlHhzK5qqt3RT87lTFMknKc/6Z35oNsYkhtxs99+r6n1dhwPPMC0FjCct1CkGfNWDZ7 yTdR3Hiuu0W9gVpspaofbUSET46HBLU0iszRd4z6LL/dHnE9SQj+MUTLdAAG1+nD07DF y2kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature:arc-authentication-results; bh=nvTXZoufWzrJO+LDeiMqNHJeBGYJU0/WVyQ1Ajxwq0Q=; b=IGMSFz9EaZkmzjNeNaQ+ELnmqqltaKilOBx830EDzpGqsreaEpyZRXn3gg8rbYR7Z1 XRhByRzmhk5LKJ7xqcln4omOieTp/PvhPaLLQ2SVhuDEQKhBDso96+ad8ZTui1tqhmv5 N45LHiP4BN3ZqiqBOUx2jpXuGof1hqRY//UNm2Lc+gE+g2tUl6wWhfv/inyF8QQ5LMs8 9w6zUc67j/BkThODVTBobG2LlHFFOmdULouTRT2kgNmYRL3DpGHxYb1KtRED2fbbQmMx X168WHNKoYdlURjCajr88ryTv8bM3LF0G/ruege3tZEcgWNT5sXWwu9mXuL1Q88qiZDy Z8UA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=f4AXwtR7; 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=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n59si1611420plb.673.2017.11.29.10.18.02; Wed, 29 Nov 2017 10:18:12 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=f4AXwtR7; 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=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755226AbdK2OMn (ORCPT + 70 others); Wed, 29 Nov 2017 09:12:43 -0500 Received: from mail-wr0-f194.google.com ([209.85.128.194]:36325 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755158AbdK2OMh (ORCPT ); Wed, 29 Nov 2017 09:12:37 -0500 Received: by mail-wr0-f194.google.com with SMTP id v105so3525636wrc.3; Wed, 29 Nov 2017 06:12:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=nvTXZoufWzrJO+LDeiMqNHJeBGYJU0/WVyQ1Ajxwq0Q=; b=f4AXwtR7nptTpU3/n46R+xdQHsZ0pVB15MY4B5V665tabJGoDNakAp+RE55ht/ddGL 6h6uwQMBajjaA/l9XcfX22FCmpBz1YI3bQpRfa12JHQgd6uW741Bt+S3p90UQ3K89i7I yp5cEzgxa9rNLZBdhqYWitNyZFdCI/v3VSlPOpQSN1vbOryuLrZ/7lMrEZw/TPaqliC2 Ox1Vu6HWinhKGnYAoUVj0JOSE0/2YZyX4oLOKlqGFNvqPvyP7m0OlPNVgV4G8gQend2I xrCut71TetQmgiEEOYG3mk1o1q/iWgb/JoPm2Xi0O0mMtjI7KyRLWhZLECa28Nqov4a0 QGow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nvTXZoufWzrJO+LDeiMqNHJeBGYJU0/WVyQ1Ajxwq0Q=; b=Lcfa2gH0RghgUD/dQKSr3wSwNV1rOB+l/bCciGlIpDI5uULQdrO9dIhhK1qvNaZc7L 2MzylgrX2rHbEd4zextrotLeS3sNx/jQRY5M9Rb+qqmBtbFHre4R/jROTeMwwbvNjWVE CWb/Voym2RhN/N+2nC75LzVeVbQAaPSEn6gxsruHYrgoxXFZ0qOfVUp260xR5vpXWXj4 6S5wIrgo/8xs8jDqK+WVA1r5+lDOmY/AxEOS4oHVNOVeQt2xejSgC/v+3D4g9dDwKxK8 SACsxiVFIkSORH0BL5bsPjmREbkzjtoKkDleM1wSBRTdzHhYVRTPGXMe1FgL+/4xFN5Y bnMg== X-Gm-Message-State: AJaThX62ZR9XFz85vagQpuTTFjWxTRBnOIISCY9nAoF2MN1TeacTQ+ZT XVz4tdUUD+ucyrmtb3WNpzc= X-Received: by 10.223.138.182 with SMTP id y51mr2806383wry.273.1511964756366; Wed, 29 Nov 2017 06:12:36 -0800 (PST) Received: from localhost.localdomain ([2a02:908:1251:7981:a0f4:e653:80fe:4e7d]) by smtp.gmail.com with ESMTPSA id n12sm2533445wrn.76.2017.11.29.06.12.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Nov 2017 06:12:35 -0800 (PST) From: "=?UTF-8?q?Christian=20K=C3=B6nig?=" X-Google-Original-From: =?UTF-8?q?Christian=20K=C3=B6nig?= To: helgaas@kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] x86/PCI: only enable a 64bit BAR on single socket AMD Family 15h systems Date: Wed, 29 Nov 2017 15:12:28 +0100 Message-Id: <20171129141229.6107-3-christian.koenig@amd.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171129141229.6107-1-christian.koenig@amd.com> References: <20171129141229.6107-1-christian.koenig@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When we have a multi socket system each CPU core needs the same setup. Since this is tricky to do in the fixup code disable enabling a 64bit BAR on multi socket systems for now. Signed-off-by: Christian König --- arch/x86/pci/fixup.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c index e857b3ac5755..c817ab85dc82 100644 --- a/arch/x86/pci/fixup.c +++ b/arch/x86/pci/fixup.c @@ -664,6 +664,16 @@ static void pci_amd_enable_64bit_bar(struct pci_dev *dev) unsigned i; u32 base, limit, high; struct resource *res, *conflict; + struct pci_dev *other; + + /* Check that we are the only device of that type */ + other = pci_get_device(dev->vendor, dev->device, NULL); + if (other != dev || + (other = pci_get_device(dev->vendor, dev->device, other))) { + /* This is a multi socket system, don't touch it for now */ + pci_dev_put(other); + return; + } for (i = 0; i < 8; i++) { pci_read_config_dword(dev, AMD_141b_MMIO_BASE(i), &base); @@ -718,10 +728,10 @@ static void pci_amd_enable_64bit_bar(struct pci_dev *dev) pci_bus_add_resource(dev->bus, res, 0); } -DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AMD, 0x1401, pci_amd_enable_64bit_bar); -DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AMD, 0x141b, pci_amd_enable_64bit_bar); -DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AMD, 0x1571, pci_amd_enable_64bit_bar); -DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AMD, 0x15b1, pci_amd_enable_64bit_bar); -DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AMD, 0x1601, pci_amd_enable_64bit_bar); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, 0x1401, pci_amd_enable_64bit_bar); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, 0x141b, pci_amd_enable_64bit_bar); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, 0x1571, pci_amd_enable_64bit_bar); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, 0x15b1, pci_amd_enable_64bit_bar); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, 0x1601, pci_amd_enable_64bit_bar); #endif -- 2.11.0 From 1585425319116366636@xxx Wed Nov 29 18:16:47 +0000 2017 X-GM-THRID: 1585425319116366636 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread