Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S263159AbUDAUsW (ORCPT ); Thu, 1 Apr 2004 15:48:22 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S263156AbUDAUsW (ORCPT ); Thu, 1 Apr 2004 15:48:22 -0500 Received: from fmr02.intel.com ([192.55.52.25]:4543 "EHLO caduceus.fm.intel.com") by vger.kernel.org with ESMTP id S263159AbUDAUry (ORCPT ); Thu, 1 Apr 2004 15:47:54 -0500 Subject: Re: [ACPI] Re: Linux 2.4.26-rc1 (cmpxchg vs 80386 build) From: Len Brown To: "Maciej W. Rozycki" Cc: Jamie Lokier , Bill Davidsen , Chris Friesen , Willy Tarreau , "Richard B. Johnson" , Alan Cox , Arkadiusz Miskiewicz , Marcelo Tosatti , Linux Kernel Mailing List , ACPI Developers In-Reply-To: References: <4069A359.7040908@nortelnetworks.com> <1080668673.989.106.camel@dhcppc4> <4069D3D2.2020402@tmr.com> <20040331150219.GC18990@mail.shareable.org> Content-Type: text/plain Organization: Message-Id: <1080852371.30349.19.camel@dhcppc4> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.3 Date: 01 Apr 2004 15:46:11 -0500 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1318 Lines: 35 On Thu, 2004-04-01 at 07:29, Maciej W. Rozycki wrote: > On Wed, 31 Mar 2004, Jamie Lokier wrote: > > > > Well, "cmpxchg", "xadd", etc. can be easily emulated with an aid of a > > > spinlock. With SMP operation included. > > > > Nope. Len Brown wrote: > > > > > Linux uses this locking mechanism to coordinate shared access > > > to hardware registers with embedded controllers, > > > which is true also on uniprocessors too. > > > > You can't do that with a spinlock. The embedded controllers would > > need to know about the spinlock. > > Hmm, does it mean we support x86 systems where an iomem resource has to > be atomically accessible by a CPU and a peripheral controller? ACPI specifies a location in regular memory that is used to contain the lock. The lock is used both by the CPU and by the embedded controller to cover access to shared registers. We don't spin on this lock because we don't know how long the embedded controller might hold it. Instead when we fail to acquire it we schedule an event to trigger when the lock is free. cheers, -Len - 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/