From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE716C2D0DB for ; Tue, 28 Jan 2020 16:45:13 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3663324683 for ; Tue, 28 Jan 2020 16:45:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="h4Is+UOc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3663324683 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 79B881657; Tue, 28 Jan 2020 17:44:21 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 79B881657 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1580229911; bh=YbnynsVmmNKMdx5k+aXUPCwN0DWTbC7yVHzqw9zR2Kc=; h=Date:From:To:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=h4Is+UOcUA606+3myANB0tMIpV1kwcWnO60qXT3XqO8o4oLZDo1f4qWRX7vfUNHMn A0WhvLje+KFh4I05VNnuNZ2hdHpRCOC3aD5mscwEmndvtswSc14Zmva05JBU1WeISV k41XF8yQMYkygN0jvF0XrqG+043sk9TrS+qvDEf0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 04EB4F8014B; Tue, 28 Jan 2020 17:44:21 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D7984F80150; Tue, 28 Jan 2020 17:44:19 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 4FE34F80082 for ; Tue, 28 Jan 2020 17:44:16 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4FE34F80082 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id BF116AE07; Tue, 28 Jan 2020 16:44:15 +0000 (UTC) Date: Tue, 28 Jan 2020 17:44:15 +0100 Message-ID: From: Takashi Iwai To: Pierre-Louis Bossart In-Reply-To: <47c4b6a4-0385-68b7-3570-9e0f960a6a70@linux.intel.com> References: <877e1doeis.wl-kuninori.morimoto.gx@renesas.com> <871rrloehp.wl-kuninori.morimoto.gx@renesas.com> <87eevk2g2y.wl-kuninori.morimoto.gx@renesas.com> <47c4b6a4-0385-68b7-3570-9e0f960a6a70@linux.intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Cc: Linux-ALSA , Mark Brown , Kuninori Morimoto Subject: Re: [alsa-devel] [PATCH 4/7] ASoC: soc-pcm: goto error after trying for_each_rtd_codec_dai X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Tue, 28 Jan 2020 17:31:05 +0100, Pierre-Louis Bossart wrote: > > > > >>> From: Kuninori Morimoto > >>> > >>> soc_pcm_open() might goto error process *during* for_each_rtd_codec_dai. > >>> In such case, fallback process need to care about operated/non-operated > >>> codec dai. > >>> > >>> But, if it goto error process *after* loop even though error happen > >>> during loop, it don't need to care about operated/non-operated. > >>> In such case code can be more simple. > >>> This patch do it. And this is prepare for soc_snd_open() cleanup > >> > >> This would mean that snd_soc_dai_shutdown() is called even for the > >> stream that returned the error. This isn't the expected behavior. > > > > Yeah. > > Actually, I have plan to add such flag by other patch. > > But indeed order was reversed. > > Will fixup. > > > >> Also, bit-OR-ing the multiple error codes isn't wise, they may return > >> different error codes, and you'll mixed up to a different number. > > > > It is used at some architecture. > > But yes, let's think about better idea. > > Will return 1st error. > > I also cringed on the bit-OR'ed error codes, but I saw it's already > used in soc-pcm.c so thought it was an agreed precedent? > > ret |= snd_soc_component_close(component, substream); > ret |= snd_soc_component_hw_free(component, substream); I think it's just an overlook. The driver may return arbitrary error codes so they can conflict. The bit-OR works only if the return code is always consistent. Takashi _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org https://mailman.alsa-project.org/mailman/listinfo/alsa-devel