Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1234038ybg; Wed, 29 Jul 2020 08:59:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUluUX4zqipDOPf2jL9wtS6CU0DG6cayKiuj04wUSkH+cmBYXvdJDm+lsubgs++r9+gtJf X-Received: by 2002:a17:907:42cc:: with SMTP id nz20mr24821051ejb.429.1596038397615; Wed, 29 Jul 2020 08:59:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596038397; cv=none; d=google.com; s=arc-20160816; b=RXBiWzW8SuQy7etlpIY0JxjAGUXSOSZU4j53dj73m4zQH2GKZkzSk8FC55/IJHK2eK rGzFppBJjLMCfIXs7KGte2yJDmVS76+H75nMt5vCdMjLvSTjP7/WXG88UBiujnGpJqlc 2fPkGbblYb7tDPg7SjJW2Bbzf4pzGzQ44ufzNYy1OaPpiihbe91uzitRvOFQxIGo33DQ Iazn419lOXiGCDSaMhNCICUBlAefCSr0ibcclE/0M+S4dnGUT0q7UUbBgv2/lgLAuX2R X1wNZAf5pL582W3TNOssT9V2FQFM9e0UG+h8Go8mU4eJponu5oQ30AmVfKgO04ckETqY w1pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:ironport-sdr:ironport-sdr; bh=5hTMduidBHZSRMe/5xWARQbLEfuOjfF/70qMENGjnAI=; b=BxmqoGv52L9o+DDJvsMpqU++3/gNncJ4ZgIkQ2tGXHj+DHDXtSLNrLT4ppSNVcnFdy d4u/1O7EriAKLCZwEAZ1N0IOqOzOaRzLJ/LwlwYmbxfxG5U19HYAcqNA+7L3E5ryUR9l rrTM8Y7eeVIb90rV63slvgW4oRSXDikRqNBaNzPBw3KZNmuNL2j4j+UfnNmdGEwBqOqK SEuiMJ4XAPn/6Zz+AA3mpGT0mGHZd0TY4t4Dpgc8FHreEcVhkPxUtK1kenoz+FaOPuTO fom7Da5Uqgrb0lU1d8GyKT/7zciegqu6i5O2z5/FkZ4S9xb3b3DcmocnVED1c7wSJC/3 hepw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lo2si1297866ejb.709.2020.07.29.08.59.34; Wed, 29 Jul 2020 08:59:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726857AbgG2P4L (ORCPT + 99 others); Wed, 29 Jul 2020 11:56:11 -0400 Received: from mga05.intel.com ([192.55.52.43]:45859 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726341AbgG2P4L (ORCPT ); Wed, 29 Jul 2020 11:56:11 -0400 IronPort-SDR: GCDXTmlTOwpWj8psFXHAuM/OGuAWjBzyivdANsND9GpGYHoYIlmY0zy83Q2eMS2nk97olNdlGX MZ2y8FXT195Q== X-IronPort-AV: E=McAfee;i="6000,8403,9697"; a="236307529" X-IronPort-AV: E=Sophos;i="5.75,410,1589266800"; d="scan'208";a="236307529" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.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 Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org, Kevin Hilman , zhangn1985@outlook.com, Stephan Gerhold 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 */ >