Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935665AbXHHAxq (ORCPT ); Tue, 7 Aug 2007 20:53:46 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1761602AbXHHAxd (ORCPT ); Tue, 7 Aug 2007 20:53:33 -0400 Received: from livid.absolutedigital.net ([66.92.46.173]:48982 "EHLO mx2.absolutedigital.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761114AbXHHAxc (ORCPT ); Tue, 7 Aug 2007 20:53:32 -0400 Date: Tue, 7 Aug 2007 20:53:21 -0400 (EDT) From: Cal Peake To: Andi Kleen cc: Kernel Mailing List Subject: [PATCH] drop unneeded variable in amd_apic_timer_broken In-Reply-To: <20070808000631.GB7353@one.firstfloor.org> Message-ID: References: <46B22BDA.8090604@redhat.com> <46B23E08.4070106@redhat.com> <20070808000631.GB7353@one.firstfloor.org> 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 Content-Length: 1508 Lines: 45 On Wed, 8 Aug 2007, Andi Kleen wrote: > Not sure why the MSR varies between cores though. Yeah that boggled me too. > It's better to just make it a global instead. Haven't gotten to figuring out how to do *that* yet... but here's a cleanup for the detection function: From: Cal Peake We only care about the lower 32-bits when reading the Interrupt Pending Message Register so drop the 'hi' variable and use rdmsrl() instead. Signed-off-by: Cal Peake --- ./arch/i386/kernel/cpu/amd.c~orig 2007-08-07 20:22:26.000000000 -0400 +++ ./arch/i386/kernel/cpu/amd.c 2007-08-07 20:23:22.000000000 -0400 @@ -34,7 +34,7 @@ __asm__(".align 4\nvide: ret"); /* AMD systems with C1E don't have a working lAPIC timer. Check for that. */ static __cpuinit int amd_apic_timer_broken(void) { - u32 lo, hi; + u32 msr; u32 eax = cpuid_eax(CPUID_PROCESSOR_SIGNATURE); switch (eax & CPUID_XFAM) { case CPUID_XFAM_K8: @@ -42,8 +42,8 @@ static __cpuinit int amd_apic_timer_brok break; case CPUID_XFAM_10H: case CPUID_XFAM_11H: - rdmsr(MSR_K8_ENABLE_C1E, lo, hi); - if (lo & ENABLE_C1E_MASK) + rdmsrl(MSR_K8_ENABLE_C1E, msr); + if (msr & ENABLE_C1E_MASK) return 1; break; default: - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/