From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: snd_pcsp locking mess Date: Fri, 23 May 2008 12:51:03 +0200 Message-ID: References: <20080518172258.D0DFB108060@picon.linux-foundation.org> <4830737B.70108@aknet.ru> <4831B260.1060802@aknet.ru> <4835D774.3070306@aknet.ru> 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 mx2.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 32A322463C for ; Fri, 23 May 2008 12:51:04 +0200 (CEST) In-Reply-To: <4835D774.3070306@aknet.ru> 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: Stas Sergeev Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Fri, 23 May 2008 00:28:36 +0400, Stas Sergeev wrote: > > Hello. > > Takashi Iwai wrote: > > The substream lock can be removed from hrtimer callback gracefully. > > So, you have no longer the issue with this lock/unlock procedure. > > In hrtimer callback, you just need to have the DMA-buffer. That can > > be protected without the substream lock, too, I believe. > OK. But still, the substream have to > be protected against the close callback. No, close callback is always after the hw_free callback. So, in hw_free callback, you just need to assure that hrtimer callback is finished (and/or cancel it). After that, you are free to work without considering hrtimer stuff. We don't drop pcm substream lock here because we don't need to acquire it. Takashi