Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp2497696ybg; Fri, 31 Jul 2020 01:06:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6rahZK4xL9k6kPx8se6o0uZ3d90oshPX0XcRW6L5TXAyiNn3KWlCrGpaXa46KKd8/IuPW X-Received: by 2002:a17:906:694b:: with SMTP id c11mr2794002ejs.232.1596182812492; Fri, 31 Jul 2020 01:06:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596182812; cv=none; d=google.com; s=arc-20160816; b=ImZL9fOR4SxhGaWQreAp7ooz3c98SkP4d/fiHdqoToE+5R7EKIxpjBaf3k0asWPhse 8RUKN6iDebgMICqWWPXBo9f0/QiyBiknzJnxSLzPLlD2ireF6inGSOOK6mr9/b7hVJUM VKev2qoTt2/o3OYE8eH73P3JDa/aj3QiZtlKYR9JPjBBqpg5d8hx17SYGHx/qpV2j8FE bY4ccJvRrzEn3L/wbn/c/jwxDblNho01ylNMjPMam31mtq9ZPeslQ5VhmJeAYK24J+0a Ueuk6U7TU2syvfN6F3opY3aaeKAk7NleYDitbtIZha2vlgdH/6gosFeanJNejLiIkw8y I3Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:in-reply-to :subject:cc:to:from:user-agent:references:dkim-signature; bh=fucMGEr5CXFfOMcRe7EoTEOJr1Kr4QCI6uUDYVzs0gU=; b=YNvZA50tyDc8DW/Z2PBh2ElLet9m059uY+ErQrOdphihQxB0KKEAedlqOpkDm8VazY 1OK8kOiT/7bS+bMuLgJimdTVxQHOA3wIRROhVYKVKuniNVzB49F1MBXQAJDKHbhWJtiQ jdVsqN2SH/6E2Z/qQzVyoIKRBK2GLEXRNj1WsIcTnR6Kv7lcBdaHwuRsadl+ADX5V6nI ey8Xvai8bLVXa9bYynyoo5Ol1fKLTwI1yRhgntQ0cwWtNkyNGauY8wR8VP9ZRP9uvnZD /ilRFsx0PZSQE8tviQwB+MhXPHAcBscBqVkD2HP5maEwhobuCzAo2+ATMCEm9Kopj50j qTUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=paELUECn; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e26si5353273edv.66.2020.07.31.01.06.30; Fri, 31 Jul 2020 01:06:52 -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; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=paELUECn; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731524AbgGaIGH (ORCPT + 99 others); Fri, 31 Jul 2020 04:06:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731436AbgGaIGG (ORCPT ); Fri, 31 Jul 2020 04:06:06 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BDCFC061574 for ; Fri, 31 Jul 2020 01:06:06 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id 88so27113662wrh.3 for ; Fri, 31 Jul 2020 01:06:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=fucMGEr5CXFfOMcRe7EoTEOJr1Kr4QCI6uUDYVzs0gU=; b=paELUECntKBbuSCyCcBVLOaExS6IKoAliKkoF5FO2Vx4ae1xzSit3j2MPx+WVR+MVK zaZ97aVOzr+rKYKirG+gD6cR0v04FzDc6B5ygXWb1JXdKTzDsq1s8YL+kMqlPzHx+uYq bDPB70KKa6GlMjDvyz/4JdTWKHxlYVXB9+w7f4k3yTX722eL5WLL+5uMHaCXA9zx6Ujk E543xx2Kq/QfbljQhO9bln/Proogp8rAe1XWwfjZ3x9S3wHfY0u+gXUN8JSoUfrC1ORK wdXqXbDwIpZ6MS3sThUTAa6zbDEMedNXGowA0RrhSgs4Sd1aQcEIGXCkT3k7ztrH1PH8 7B7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=fucMGEr5CXFfOMcRe7EoTEOJr1Kr4QCI6uUDYVzs0gU=; b=XF4AM5aSj45eLFsjlldt3o8b+7qHebEEk59sZ8jSZSQClA10H7pxlmvrN7sKGBs95e Eul9c9Q25qihPo2XUBfv53bPZb8sJ2jnNWM5yjxQiXD5HOZuTWw0k+mbQaezZfO82ssA BI3Mio68FovH8sYkQ4KP5ZzJaeYemGwwV14D2AinDzEx9pixxKMVkLCpFrMomTQ9CckA SR5kznh/urHJqvr/lIeHgB6622ZAyl4SSsPJEAZuPSNoygPaawNT/4lFLBxqLV8J8m4O sPT/Xetbz4rsMpOrQPorRujDnTFl+mPZ/sN4n7nNjtaviPiHksuoqz/1oOIABx58bZiQ YVmQ== X-Gm-Message-State: AOAM532fm27UdQARsu3V6SgbXKRHeU++epAFUN/TDehbnbapipYSacCH o5PwQacqfb7N5HQOKLotn5ypqkVbWszYnA== X-Received: by 2002:adf:9e90:: with SMTP id a16mr2541831wrf.40.1596182764941; Fri, 31 Jul 2020 01:06:04 -0700 (PDT) Received: from localhost (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id z63sm13311387wmb.2.2020.07.31.01.06.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jul 2020 01:06:04 -0700 (PDT) References: <20200723180533.220312-1-pierre-louis.bossart@linux.intel.com> <20200729154639.1983854-1-jbrunet@baylibre.com> <2ad13f95-434d-376a-bc38-b209623b461e@linux.intel.com> <1jft998jbe.fsf@starbuckisacylon.baylibre.com> <936d6e37-0ad0-b0d7-814a-1ace12087746@linux.intel.com> User-agent: mu4e 1.3.3; emacs 26.3 From: Jerome Brunet To: Pierre-Louis Bossart , Mark Brown , Liam Girdwood Cc: alsa-devel@alsa-project.org, Stephan Gerhold , Kevin Hilman , linux-kernel@vger.kernel.org, zhangn1985@outlook.com, linux-amlogic@lists.infradead.org Subject: Re: [PATCH] ASoC: core: restore dpcm flags semantics In-reply-to: <936d6e37-0ad0-b0d7-814a-1ace12087746@linux.intel.com> Date: Fri, 31 Jul 2020 10:06:03 +0200 Message-ID: <1ja6zg85xw.fsf@starbuckisacylon.baylibre.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 30 Jul 2020 at 18:06, Pierre-Louis Bossart wrote: > On 7/30/20 4:04 AM, Jerome Brunet wrote: >> >> On Wed 29 Jul 2020 at 17:56, Pierre-Louis Bossart wrote: >> >>> 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. >> >> Again, why ? All there is so far is your personal preference. no facts. > > What would be the meaning/purpose of a dailink with .dpcm_capture set, with > only dais that support playback only? > > What would be the meaning/purpose of a dailink with .capture_only set, but > with a dai that supports playback? You get to throw an error in those case > > What happens if none of these flags are set? I think I already suggested to throw an error in the initial review of your patch > > What happens when all these flags are set? I don't see the problem here > > No one seems to know, so my suggestion is to align first on consistent > configurations, then see what can be removed. > >> * What we had gave capabilities to the link, independent of the DAI >> components. ASoC just computes the intersection of all that to >> determine which direction needs to be enabled. Seems rather simple >> and straight forward. > > that's what my last patch did, and when there is no intersection it > complains. Please clarify what you expect when there is no overlap between > dai and dailink capabilities. Keep in mind that we have a mix of hard-codec > configuration and DT-created ones, your case is not the general one. > >> * It worked for every user of DPCM so a far. > > Not completely true, when Morimoto-san added snd_soc_dai_stream_valid() it > exposed tons of cases where the information on direction was not provided > in a reliable at the DAI level. I will assert that we are still finding out > cases with broken DAI configurations, and as a result we will also find > broken dailink configurations. Your picture of DPCM as a perfectly > functional system that I broke is a distortion of reality. If it was not working, it was certainly not clear in the changelog. What's clear is the regression it caused > > The reality is that we have to work in steps, first make sure all DAIs are > properly described, then work on the dailinks and optimize at a later > point. we will need warnings to find out what the problem cases are, and > move slowly. Sure, have it your way