From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261532AbUL3TJY (ORCPT ); Thu, 30 Dec 2004 14:09:24 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261699AbUL3TJY (ORCPT ); Thu, 30 Dec 2004 14:09:24 -0500 Received: from one.firstfloor.org ([213.235.205.2]:49075 "EHLO one.firstfloor.org") by vger.kernel.org with ESMTP id S261532AbUL3TJQ (ORCPT ); Thu, 30 Dec 2004 14:09:16 -0500 To: Vincent ETIENNE Cc: linux-kernel@vger.kernel.org, discuss@x86-64.org Subject: Re: AMD64-AGP pb with AGP APERTURE on IWILL DK8N References: <200412282049.48616.ve@vetienne.net> From: Andi Kleen Date: Thu, 30 Dec 2004 20:09:14 +0100 In-Reply-To: <200412282049.48616.ve@vetienne.net> (Vincent ETIENNE's message of "Tue, 28 Dec 2004 20:49:48 +0000") Message-ID: User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Vincent ETIENNE writes: > IOMMU reports a 128MB aperture for CPU0 ( that's the value i used in my bios) > at F0000000 but only 32MB at 4000000 for CPU1 and declare i have no valid > aperture as show in this dmesg extract. First you should complain to your BIOS vendor because it is just another kind of BIOS bug (of which there seems to be an infinite supply ...) > + if ( last_aper_order ) > + { > + if ( aper_order != last_aper_order ) > + { > + printk("Aperture size changed!! use old one (%x,%x)", last_aper_order, > last_aper_base ); > + write_pci_config(0, num, 3, 0x90, last_aper_order<<1); > + write_pci_config(0, num, 3, 0x94, last_aper_base>>25); > + aper_order = last_aper_order; > + aper_base = last_aper_base; > + aper_size = (32 * 1024 * 1024) << aper_order; > + } There is already code to do this at the end of the function. A better patch would be the attached one. This would also handle the case of a wrong aper_base. Untested, uncompiled right now. Can you test if that works on your board? If yes I can add it. -Andi Based on debugging&code from Vincent ETIENNE >> I have some problem with AGP initialization with my board : IWILL DK8N (Bi opteron chipset NFORCE3 ). I use kernel 2.6.10-rc3-mm1, but i have try with different kernel always with the same result : IOMMU reports a 128MB aperture for CPU0 ( that's the value i used in my bios) at F0000000 but only 32MB at 4000000 for CPU1 << This patch checks for this condition and fixes the other CPUs up. Signed-off-by: Andi Kleen diff -u linux-2.6.10/arch/x86_64/kernel/aperture.c-o linux-2.6.10/arch/x86_64/kernel/aperture.c --- linux-2.6.10/arch/x86_64/kernel/aperture.c-o 2004-12-24 22:35:23.000000000 +0100 +++ linux-2.6.10/arch/x86_64/kernel/aperture.c 2004-12-30 19:56:22.000000000 +0100 @@ -200,8 +200,8 @@ void __init iommu_hole_init(void) { int fix, num; - u32 aper_size, aper_alloc = 0, aper_order; - u64 aper_base; + u32 aper_size, aper_alloc = 0, aper_order, last_aper_order = 0; + u64 aper_base, last_aper_base = 0; int valid_agp = 0; if (iommu_aperture_disabled || !fix_aperture) @@ -230,7 +230,15 @@ if (!aperture_valid(name, aper_base, aper_size)) { fix = 1; break; - } + } + + if ((last_aper_order && aper_order != last_aper_order) || + (last_aper_base && aper_base != last_aper_base)) { + fix = 1; + break; + } + last_aper_order = aper_order; + last_aper_base = aper_base; } if (!fix && !fallback_aper_force)