From patchwork Tue Mar 18 17:14:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 3848701 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 08F3ABF540 for ; Tue, 18 Mar 2014 17:14:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0AC292022F for ; Tue, 18 Mar 2014 17:14:11 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id DF61120108 for ; Tue, 18 Mar 2014 17:14:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6CE268E389; Tue, 18 Mar 2014 10:14:06 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) by gabe.freedesktop.org (Postfix) with ESMTP id 5AB768E389 for ; Tue, 18 Mar 2014 10:14:05 -0700 (PDT) Received: by mail-pa0-f52.google.com with SMTP id rd3so7649726pab.11 for ; Tue, 18 Mar 2014 10:14:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:to:from:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=98bontIOw+J7TwYem54pSuSBuCbCJLwqWp3QLW9FMH0=; b=Fs9PucSHhgXE9nRVSseySi5yWr9Y15TT2EJLlOwfYj8nUH/BHiO20cBC8B4jqs4+R+ Wo6OURmZCbO10iYoStakfV4ZktQqOVieFXid172V71ADK/h4ial/yAZ03jGxPbONAC8X ZLLNT58aupPqFrze6P522kTDjuMKY/5kncTx42vDqLUGJQadGRuxj6GkL37a6/KmzsTb H5fIpqBxcVo5jcMfd7Q2Hb/6Z6m+YICaq/NQQlhy8KzXqx7V8aFJTofCq68Qu614uSh4 JKaL90f+s9XXTyAmS1jeRVqtXVqfP5J2JQT7VHGFcyXSu6YyEC3PfoA2LN6y5+qjkzaL aQMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:from:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding; bh=98bontIOw+J7TwYem54pSuSBuCbCJLwqWp3QLW9FMH0=; b=jOeOchfulPY5gwN7yN6dAxLhgHaR2JJwo91cB5TxRIilvv9QdTtNZw5GztXAVofsdb lhM5j+OVAZ2lSPaZ0DrB4Q5OPdSOeN4DtjqGMLvrxEl/wkZfUAJuGae7g2bc5ph1SZxY Ln+tsT3cthRbXM+Pg+KtbRlplRod6WXPCL622CwS3H0iqFfxYB2ut5V3r8S5U49osdvN t0yuweQr0F8+3vPHJQzZDF9XGa8FeKlz1irYpnr+Gg/b7qitWwK0/CwDyVM9jkZu/1rO UObl6k/faBK8W950sSTxEUz0eWkTObJRXO5pv1cVUwfJJRon1U1n+ETLJN0lKW84z3om r43w== X-Gm-Message-State: ALoCoQmhIOIYCUKUjxy3VmMsZaNgPIl3Jj7s/sX755I5V8zinJx8B/jxPEehpDIuVSo2sPZJePjas5xXvKTetwwAEYVwNRjVEmh6sSeg8deNLbMUlknRypRVU6z+gCbZRA4W+hix+d2hT/gBCCxgqGojxjKVuFdI5gZ4reWB7a1QjBXD/KO2N4wd+WB9txZGjccwEQkb92rUI7vkW609SexnXbsIyPJw8Q== X-Received: by 10.68.231.35 with SMTP id td3mr12062321pbc.137.1395162845114; Tue, 18 Mar 2014 10:14:05 -0700 (PDT) Received: from localhost ([172.19.249.211]) by mx.google.com with ESMTPSA id ps1sm90536482pac.26.2014.03.18.10.14.02 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 18 Mar 2014 10:14:04 -0700 (PDT) Subject: [PATCH] Revert "[PATCH] Insert GART region into resource map" To: linux-pci@vger.kernel.org From: Bjorn Helgaas Date: Tue, 18 Mar 2014 11:14:01 -0600 Message-ID: <20140318171401.8189.46642.stgit@bhelgaas-glaptop.roam.corp.google.com> In-Reply-To: <20140318170841.8189.7972.stgit@bhelgaas-glaptop.roam.corp.google.com> References: <20140318170841.8189.7972.stgit@bhelgaas-glaptop.roam.corp.google.com> User-Agent: StGit/0.16 MIME-Version: 1.0 Cc: "H. Peter Anvin" , Jouni =?utf-8?b?TWV0dMOkbMOk?= , Aaron Durbin , x86@kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Ingo Molnar , Guo Chao , Daniel Vetter , Thomas Gleixner , Yinghai Lu X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,RCVD_IN_DNSWL_MED,T_DKIM_INVALID,T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This reverts commit 56dd669a138c, which makes the GART visible in /proc/iomem. This fixes a regression: e501b3d87f00 ("agp: Support 64-bit APBASE") exposed an existing problem with a conflict between the GART region and a PCI BAR region. The GART addresses are bus addresses, not CPU addresses, and therefore should not be inserted in iomem_resource. On many machines, the GART region is addressable by the CPU as well as by an AGP master, but CPU addressability is not required by the spec. On some of these machines, the GART is mapped by a PCI BAR, and in that case, the PCI core automatically inserts it into iomem_resource, just as it does for all BARs. Inserting it here means we'll have a conflict if the PCI core later tries to claim the GART region, so let's drop the insertion here. The conflict indirectly causes X failures, as reported by Jouni in the bugzilla below. We detected the conflict even before e501b3d87f00, but after it the AGP code (fix_northbridge()) uses the PCI resource (which is zeroed because of the conflict) instead of reading the BAR again. Conflicts: arch/x86_64/kernel/aperture.c Fixes: e501b3d87f00 agp: Support 64-bit APBASE Link: https://bugzilla.kernel.org/show_bug.cgi?id=72201 Reported-and-tested-by: Jouni Mettälä Signed-off-by: Bjorn Helgaas --- arch/x86/kernel/aperture_64.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/arch/x86/kernel/aperture_64.c b/arch/x86/kernel/aperture_64.c index fd972a3e4cbb..9fa8aa051f54 100644 --- a/arch/x86/kernel/aperture_64.c +++ b/arch/x86/kernel/aperture_64.c @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include @@ -54,18 +53,6 @@ int fallback_aper_force __initdata; int fix_aperture __initdata = 1; -static struct resource gart_resource = { - .name = "GART", - .flags = IORESOURCE_MEM, -}; - -static void __init insert_aperture_resource(u32 aper_base, u32 aper_size) -{ - gart_resource.start = aper_base; - gart_resource.end = aper_base + aper_size - 1; - insert_resource(&iomem_resource, &gart_resource); -} - /* This code runs before the PCI subsystem is initialized, so just access the northbridge directly. */ @@ -96,7 +83,6 @@ static u32 __init allocate_aperture(void) memblock_reserve(addr, aper_size); printk(KERN_INFO "Mapping aperture over %d KB of RAM @ %lx\n", aper_size >> 10, addr); - insert_aperture_resource((u32)addr, aper_size); register_nosave_region(addr >> PAGE_SHIFT, (addr+aper_size) >> PAGE_SHIFT); @@ -444,12 +430,8 @@ int __init gart_iommu_hole_init(void) out: if (!fix && !fallback_aper_force) { - if (last_aper_base) { - unsigned long n = (32 * 1024 * 1024) << last_aper_order; - - insert_aperture_resource((u32)last_aper_base, n); + if (last_aper_base) return 1; - } return 0; }