From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH 5/6] adding support for multiple external clock types Date: Tue, 15 Sep 2009 15:29:00 +0200 Message-ID: References: <1252968303-29334-1-git-send-email-pavel.hofman@ivitera.com> <1252968303-29334-2-git-send-email-pavel.hofman@ivitera.com> <1252968303-29334-3-git-send-email-pavel.hofman@ivitera.com> <1252968303-29334-4-git-send-email-pavel.hofman@ivitera.com> <1252968303-29334-5-git-send-email-pavel.hofman@ivitera.com> <4AAF91F4.2050501@ivitera.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 (cantor.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id F3784103872 for ; Tue, 15 Sep 2009 15:29:00 +0200 (CEST) In-Reply-To: <4AAF91F4.2050501@ivitera.com> 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: Pavel Hofman Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Tue, 15 Sep 2009 15:09:08 +0200, Pavel Hofman wrote: > > Takashi Iwai wrote: > > At Tue, 15 Sep 2009 00:45:02 +0200, > > pavel.hofman@ivitera.com wrote: > >> From: Pavel Hofman > >> > >> > >> Signed-off-by: Pavel Hofman > >> > >> diff --git a/pci/ice1712/ice1712.h b/pci/ice1712/ice1712.h > >> --- a/pci/ice1712/ice1724.c > >> +++ b/pci/ice1712/ice1724.c > >> @@ -120,7 +122,7 @@ static inline int stdclock_is_spdif_master(struct snd_ice1712 *ice) > >> > >> static inline int is_pro_rate_locked(struct snd_ice1712 *ice) > >> { > >> - return ice->is_spdif_master(ice) || PRO_RATE_LOCKED; > >> + return (!ice->is_spdif_master(ice)) && PRO_RATE_LOCKED; > > > > What is the reason of this change of logic? > > The original code comes from times when the sole use of > is_pro_rate_locked in snd_vt1724_set_pro_rate was simple: > > if (!force && is_pro_rate_locked(ice)) > return 0; > > I.e. if the RATE_LOCK control is activated, no change in rate was allowed. > > Later in > http://git.alsa-project.org/?p=alsa-kmirror.git;a=commitdiff;h=f1abd41e000348151d02d9ece830a0039fac3bbe > the code was changed to > > if (!force && is_pro_rate_locked(ice)) { > return (rate == ice->cur_rate) ? 0 : -EBUSY; > > The extra check rate == ice->cur_rate does not make sense for > external-clock modes and sometimes I experienced EBUSY when testing the > external-clock functionality. Fair enough. Please add the description in the patch, or better split once to fix this issue solely in a patch as this fix is basically independent from the addition of another external clock source. thanks, Takashi