Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp172208pxa; Wed, 26 Aug 2020 07:41:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqC4T8B3dhBL7okvPzbTZR7WhxNGL5BRJGgfeGn5E7qVcsaGtNeQxa5zmw2QMpeUaLAeE4 X-Received: by 2002:a17:906:c351:: with SMTP id ci17mr7553659ejb.266.1598452884930; Wed, 26 Aug 2020 07:41:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598452884; cv=none; d=google.com; s=arc-20160816; b=H74v95wjfDPIY+BuqEfVywPjU9pb8yDwkd7ZSfGipZiEwy3Ti/KdwuRUIdzHNkw0eZ WqGTOIRlhhDeCK5qYeBuTGBNGLK+KqdWQDqJb++PKcr49ii/75ozCcwmGhNcXa4JivRl tLDv5M16BzJGpu4L5K7q7wnIqyS4oG5HLWKj4aAviK2ebo+Dg7BhnnPKuv+9eYnPR231 ZLyKuXwaciCSoPJ0ieSv7oj8FWic7B2WQ4amF0Ijj6bMaHmz6zqOqWiw0D1hW8lSgSHN 2eI02nWvETWhAHfUHOsjlVFIWvxvNHmRRqwL3wfzQZfKHqcTnmSgx6SaypBvVWVrVEGU FBbA== 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=Be8nyHFlXFrFpTQ1R7tVTQDzVCUE0n2Dbx/r4KMSLEc=; b=qBsPmVqv5z1Wm4IfRcWK0QIywVQoiwBtzuDKMhZzmO6AT/VvEfyIXPBMp+S4cQHI5j +3fdD6Mf+7QgDGTNdAQwC3vLgrib3it/IlY+Tx2dIG28NdDq3nEUVOFhE+pJubB+snU7 2g1MwAs5FPgGzj5mIsLOXvgun59DNRLfp5hU4AdEMXx9VcxC/V5VDox1FI1TEvg18ppP hHf3v75kopnu1trCDXPMJfLQrwZrQxtWPXtqC5pekB07FYTLqJrVPcChYxg1csuQtR3p JY2SJZMmqYDh8341gpRo8hsOChQ6IBUrM4zTeIlItz3qKTtZ70AKXiiQ/k/Qdy7LfHM2 EY+Q== 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 l17si1588960edf.58.2020.08.26.07.41.01; Wed, 26 Aug 2020 07:41:24 -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 S1726968AbgHZOk0 (ORCPT + 99 others); Wed, 26 Aug 2020 10:40:26 -0400 Received: from mga11.intel.com ([192.55.52.93]:3727 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726874AbgHZOkW (ORCPT ); Wed, 26 Aug 2020 10:40:22 -0400 IronPort-SDR: ddinD+VX9dI5epistoKIqeEZXli0yYGOb2v+mSGsIYgUSJsxQcZMVzvbGxm0d6PkdZ6YwnIAtQ VmaYvuTfkGFw== X-IronPort-AV: E=McAfee;i="6000,8403,9725"; a="153869866" X-IronPort-AV: E=Sophos;i="5.76,356,1592895600"; d="scan'208";a="153869866" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Aug 2020 07:40:22 -0700 IronPort-SDR: 3qQWmHAeoyu+Ah83AqVvZtMwmiF0fwP9YBedaITiYvRLqQEMSxRS2DLLjiu+Bf2T0sqk4dB+OS AK/EvdCcWAvQ== X-IronPort-AV: E=Sophos;i="5.76,356,1592895600"; d="scan'208";a="299494867" Received: from gillelas-mobl1.amr.corp.intel.com (HELO [10.255.231.51]) ([10.255.231.51]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Aug 2020 07:40:20 -0700 Subject: Re: [PATCH 07/11] soundwire: intel: Only call sdw stream APIs for the first cpu_dai To: Vinod Koul , Bard Liao Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, tiwai@suse.de, broonie@kernel.org, gregkh@linuxfoundation.org, jank@cadence.com, srinivas.kandagatla@linaro.org, rander.wang@linux.intel.com, ranjani.sridharan@linux.intel.com, hui.wang@canonical.com, sanyog.r.kale@intel.com, mengdong.lin@intel.com, bard.liao@intel.com References: <20200818024120.20721-1-yung-chuan.liao@linux.intel.com> <20200818024120.20721-8-yung-chuan.liao@linux.intel.com> <20200826094636.GB2639@vkoul-mobl> From: Pierre-Louis Bossart Message-ID: <5a7b75e5-4d64-9927-df81-68164ef2662a@linux.intel.com> Date: Wed, 26 Aug 2020 09:35:19 -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: <20200826094636.GB2639@vkoul-mobl> 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 >> - ret = sdw_prepare_stream(dma->stream); >> + /* >> + * All cpu dais belong to a stream. To ensure sdw_prepare_stream >> + * is called once per stream, we should call it only when >> + * dai = first_cpu_dai. >> + */ >> + if (first_cpu_dai == dai) >> + ret = sdw_prepare_stream(dma->stream); > > Hmmm why not use the one place which is unique in the card to call this, > hint machine dais are only called once. we are already calling directly sdw_startup_stream() and sdw_shutdown_stream() from the machine driver. We could call sdw_stream_enable() in the dailink .trigger as well, since it only calls the stream API. However for both .prepare() and .hw_free() there are a set of dai-level configurations using static functions defined only in intel.c, and I don't think we can move the code to the machine driver, or split the prepare/hw_free in two (dailink and dai operations). I am not against your idea, I am not sure if it can be done. Would you be ok to merge this as a first step and let us work on an optimization later (which would require ASoC/SoundWire synchronization)?