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=-12.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, NICE_REPLY_A,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable 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 1F02FC433E0 for ; Wed, 29 Jul 2020 15:57:17 +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 A1A3C206D4 for ; Wed, 29 Jul 2020 15:57:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="EnpZCrBU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A1A3C206D4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com 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 2B4F11704; Wed, 29 Jul 2020 17:56:25 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2B4F11704 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1596038235; bh=ypKljuw+rWHc8pjVYuOK8ExU6hHd7bIlhR7AstImwLo=; h=Subject:To:References:From:Date:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=EnpZCrBUWvHFwn5hMtwGVlUxxcmJietUIwp57n0jQRLGXc/TgzQ8HmPHSRheDtocL XIQqQe011XnygclVHbXoaGxxic76ZHY0m/e3sM/LA11Xod+4IIhFWKkmxk0orv2s54 G7c8IdR9yZVHidmQ0in4EsfLrJMNAncNELC0uyJQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 950B9F8012F; Wed, 29 Jul 2020 17:56:24 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 60997F801A3; Wed, 29 Jul 2020 17:56:23 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id B91F5F800DE for ; Wed, 29 Jul 2020 17:56:13 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B91F5F800DE IronPort-SDR: 5U7TwJ+j97pL2sCVQ+fG+tkchLf5M7bWAKvDT9C+FzbxoUNY+SgBl4rAexxCz0PMuMgMeVibCp HtTMvvYCNhXQ== X-IronPort-AV: E=McAfee;i="6000,8403,9697"; a="215936396" X-IronPort-AV: E=Sophos;i="5.75,410,1589266800"; d="scan'208";a="215936396" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jul 2020 08:56:10 -0700 IronPort-SDR: IDiwGItDXIzja3qJHXtAQwZsgkfdvjN51ZFJYyn4gETjqIXmWP3NNyN85itVh4GNZZCNBIn5O4 HqvTijKzaFgQ== X-IronPort-AV: E=Sophos;i="5.75,410,1589266800"; d="scan'208";a="322594221" Received: from vmlivin-mobl1.amr.corp.intel.com (HELO [10.209.108.29]) ([10.209.108.29]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jul 2020 08:56:08 -0700 Subject: Re: [PATCH] ASoC: core: restore dpcm flags semantics To: Jerome Brunet , Mark Brown , Liam Girdwood References: <20200723180533.220312-1-pierre-louis.bossart@linux.intel.com> <20200729154639.1983854-1-jbrunet@baylibre.com> From: Pierre-Louis Bossart Message-ID: <2ad13f95-434d-376a-bc38-b209623b461e@linux.intel.com> Date: Wed, 29 Jul 2020 10:56:05 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200729154639.1983854-1-jbrunet@baylibre.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Cc: alsa-devel@alsa-project.org, Stephan Gerhold , Kevin Hilman , linux-kernel@vger.kernel.org, zhangn1985@outlook.com, linux-amlogic@lists.infradead.org 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On 7/29/20 10:46 AM, Jerome Brunet wrote: > commit b73287f0b0745 ('ASoC: soc-pcm: dpcm: fix playback/capture checks') > changed dpcm_playback and dpcm_capture semantic by throwing an error if > these flags are not aligned with DAIs capabilities on the link. > > The former semantic did not force the flags and DAI caps to be aligned. > The flag previously allowed card drivers to disable a stream direction on > a link (whether or not such feature is deemed useful). > > With change ('ASoC: core: use less strict tests for dailink capabilities') > an error is thrown if the flags and and the DAI caps are not aligned. Those > parameters were not meant to aligned initially. No technical reason was > given about why cards should now be considered "broken" in such condition > is not met, or why it should be considered to be an improvement to enforce > that. > > Forcing the flags to be aligned with DAI caps just make the information > the flag carry redundant with DAI caps, breaking a few cards along the way. > > This change drops the added error conditions and restore the initial flag > semantics. or rather lack thereof. I am ok to move dev_err to dev_warn and remove the return -EINVAL, but I maintain that we have to reach a point where configurations make sense before we can clean them up. If we implicitly push issues under the rug by not even being aware of them we'll never make progress. > > Cc: Pierre-Louis Bossart > Signed-off-by: Jerome Brunet > --- > > Hi Mark, > > Because b73287f0b0745 ('ASoC: soc-pcm: dpcm: fix playback/capture checks') > introduced more than one problem, the change > "ASoC: core: use less strict tests for dailink capabilities" [0] is still > necessary but the change of semantic remains a problem with it. > > This patch applies on top of it. > > sound/soc/soc-pcm.c | 14 -------------- > 1 file changed, 14 deletions(-) > > diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c > index 00ac1cbf6f88..2e205b738eae 100644 > --- a/sound/soc/soc-pcm.c > +++ b/sound/soc/soc-pcm.c > @@ -2749,13 +2749,6 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num) > break; > } > } > - > - if (!playback) { > - dev_err(rtd->card->dev, > - "No CPU DAIs support playback for stream %s\n", > - rtd->dai_link->stream_name); > - return -EINVAL; > - } > } > if (rtd->dai_link->dpcm_capture) { > stream = SNDRV_PCM_STREAM_CAPTURE; > @@ -2766,13 +2759,6 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num) > break; > } > } > - > - if (!capture) { > - dev_err(rtd->card->dev, > - "No CPU DAIs support capture for stream %s\n", > - rtd->dai_link->stream_name); > - return -EINVAL; > - } > } > } else { > /* Adapt stream for codec2codec links */ >