From: Takashi Iwai Subject: Re: problems writing pcm driver Date: Wed, 22 Aug 2007 11:24:34 +0200 Message-ID: References: <46CB60E0.7000805@audioscience.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (ns1.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id 1E5782440F for ; Wed, 22 Aug 2007 11:24:35 +0200 (CEST) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Trent Piepho Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Tue, 21 Aug 2007 22:13:45 -0700 (PDT), Trent Piepho wrote: > > > > This means I have to use locking between the irq handler > > > and the pointer callback, which I have been able to avoid so far. > > > > ?? probably not as long as you only read the cached value from the chip > > struct once in the pointer callback. > > However you might need locking to provide exclusive access to the > > hardware if there are accesses that have to happen in sequence. > > I was under the impression that one should not count on writing to an integer > on one while cpu reading from the same integer on another cpu at the same time > working correctly. If you want to do this, you have to use atomic_t and > related functions. See $LINUXKERNEL/Documentation/memory-barriers.txt. Worth to read to understand what you need for such a case. Takashi