From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: Re: [alsa-cvslog] CVS: alsa-kernel/core rawmidi.c,1.40,1.41 Date: Mon, 02 Feb 2004 12:13:53 +0100 Sender: alsa-devel-admin@lists.sourceforge.net Message-ID: References: <401D318E.4020100@tin.it> Mime-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: <401D318E.4020100@tin.it> Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Abramo Bagnara Cc: Jaroslav Kysela , alsa-devel List-Id: alsa-devel@alsa-project.org At Sun, 01 Feb 2004 18:04:14 +0100, Abramo Bagnara wrote: (snip) > With this patch you break write and read atomicity, you should: > > 1) read and save appl_ptr > 2) update appl_ptr and avail > 3) leave critical area > 4) copy from/to user using saved appl_ptr > 5) reenter critical area > > I've just checked and a similar mistake has been done too for PCM (and > other places?). or simply use semaphore instead of spinlock? (kernel=1 can be in the interrupt context, so it'd better to down/up semaphore in snd_rawmidi_read(), write(), etc.) Takashi ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn