From mboxrd@z Thu Jan 1 00:00:00 1970 From: Len Brown Subject: Re: Re: Linux 2.4.26-rc1 (cmpxchg vs 80386 build) Date: 01 Apr 2004 15:46:11 -0500 Sender: acpi-devel-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Message-ID: <1080852371.30349.19.camel@dhcppc4> References: <4069A359.7040908@nortelnetworks.com> <1080668673.989.106.camel@dhcppc4> <4069D3D2.2020402@tmr.com> <20040331150219.GC18990@mail.shareable.org> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Errors-To: acpi-devel-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: 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 List-Id: linux-acpi@vger.kernel.org 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 ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click