From patchwork Wed Nov 29 14:12:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_K=C3=B6nig?= X-Patchwork-Id: 10082317 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B941B60353 for ; Wed, 29 Nov 2017 14:13:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B4C5E298EF for ; Wed, 29 Nov 2017 14:13:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A9A5B298F0; Wed, 29 Nov 2017 14:13:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 42613298F1 for ; Wed, 29 Nov 2017 14:13:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755196AbdK2OMj (ORCPT ); Wed, 29 Nov 2017 09:12:39 -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-Google-Smtp-Source: AGs4zMY2OAeYSr7IkvwKUeF9ZSoli1xQp2MqH4zihkyZlb+cZG3E4BHvvMXvowVI13T16i0MjXh2Fw== 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 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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