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: 3854601 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A516D9F369 for ; Wed, 19 Mar 2014 17:51:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B9BC520131 for ; Wed, 19 Mar 2014 17:51:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D06CC200DF for ; Wed, 19 Mar 2014 17:51:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755162AbaCRROM (ORCPT ); Tue, 18 Mar 2014 13:14:12 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:65385 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932118AbaCRROG (ORCPT ); Tue, 18 Mar 2014 13:14:06 -0400 Received: by mail-pa0-f41.google.com with SMTP id fa1so7590703pad.14 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=fN4mhVy1c0fIdyLn1TYqnWYfvJQ9F0VB14fy7tTaSSKS62VbtkzoK0dD7Ckr8GukpD SzCxt4YupTW9hWRtV3EIOXHeNa/rg33hwjfcG9DBVhuQEx1GtnMGEJ17WulRIuwB1b94 msgkZMa2ayM10Krj777ddfzWkOnJG23KQu5hxPVI0i2woDw+vQD4WoW3/K5Mny3adEis wKmzUvykKfae+Wc2lpGl0Vu2jNF7rGiVK3u8euRFBlqrcw4fgDunu24dys35eLG2yudG y7gN0/I2UIvG3fhJ+pChchcTWqccB5ShvPw8AUinyGSZQJ4G1nQGg92PtWUTVYN+leEu pvmg== X-Gm-Message-State: ALoCoQmRy5U1pQDjocclAcr2y0mKkBDHKMWHvluwKEKLN5Oy0vSnBZH38p9AGEbmSWgCOHUZLxq63yeaTp6JxRiwfBAz708GAPIgDnGLe1PVQJyxx9c+qllbL9eOhAeh6O6WAe0B0fbo2b/j6FoQ2lifLzGB2QFmyKfJguuq3htkPExPEZF/kHK6HYiNA+FS/q+wKLoATNbnDDMlMaw9zxy+Gkbao4DR7b/sWMBrBgaW6lrv3shuzog= 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 Cc: Aaron Durbin , David Airlie , Daniel Vetter , x86@kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Ingo Molnar , Guo Chao , "H. Peter Anvin" , Yinghai Lu , Thomas Gleixner , Jouni =?utf-8?b?TWV0dMOkbMOk?= 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 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,RCVD_IN_DNSWL_HI,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(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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; }