Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1751915pxj; Wed, 19 May 2021 13:05:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1ltj7mXOhepR0i9hT9G8Io7EnZLFNnQHdjilWBAxq12CqSIFoV9V49Kxqiz1YusPSq6sn X-Received: by 2002:a17:906:1997:: with SMTP id g23mr913322ejd.168.1621454729431; Wed, 19 May 2021 13:05:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621454729; cv=none; d=google.com; s=arc-20160816; b=kiHCdgHw/hZ2vfLPk0dHsbPC72sxjwgRLTh2FjodB4/yElfyxdd2ueSmYl67VDGPXm boF6DsA7sXrPkFvIN7DpnNjTtGYe+ZyiMEzCGIanDpo7WLt+lgAO8JygYyBprtXr7eva WHCnLgvv3LRbCBKMm2FkosGzy8QOF3Adlq29Azmsm7RZr7w4EjyWXXAMvdQsd7B/I9MH hQMR3ljLYvQMRzyWUCdnwF8D3SLqtgFvnsLpr28YUZ5ZfXnhAT1uYo2atTHX+Jb4T5Dv 0lS9wvJZYP/JppYu3FJpif7CbBonedFlraWYWpW7Avdt78gIgU+8b1IB2Hdg/4RnALV6 C+aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date; bh=kMW4tzoNiXIhnpDXn9tdrervUGx3DsNiuY7oVH3QuaU=; b=qzawj6+aW19ueY1uJ7TzrC97ojWv1aXQ1qm7pF0gw3ANGe36A8qd9qZ7swFS3zpyZk bVP49Bng67/Zg5HzaDCwU0T1r1TugyNYayvkgUjWlU7J9KVtHLO1mMsdv3CoMON7YWeE aDQSPD/ilA9Z+MTNfP8FVfTL6S5qSMnLpotURcmNUTR8HvCOfTP8oTMk4QJz2gs1MY2t nw84jEDuE0D5PxbLeLTR/vReMqr5E3IorZSN6Y7pyeircapPyWdhNDPzGxbOJLTTajip 4pLgI+kD2jdzTr3HA+Zlai7iFwhPjFFKhLyzEYaC6t0yqXCE3qFDjxIY6dRbbu0ZwkgA Dt2A== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a5si217251edq.133.2021.05.19.13.05.04; Wed, 19 May 2021 13:05:29 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347540AbhESOR4 (ORCPT + 99 others); Wed, 19 May 2021 10:17:56 -0400 Received: from mx2.suse.de ([195.135.220.15]:60054 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354208AbhESOQa (ORCPT ); Wed, 19 May 2021 10:16:30 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 9FC31AB7C; Wed, 19 May 2021 14:15:09 +0000 (UTC) Date: Wed, 19 May 2021 16:15:08 +0200 Message-ID: From: Takashi Iwai To: Codrin Ciubotariu Cc: , , , , , , , , , , , Subject: Re: [RFC PATCH 0/6] soc-pcm: Add separate snd_pcm_runtime for BEs In-Reply-To: <20210519104842.977895-1-codrin.ciubotariu@microchip.com> References: <20210519104842.977895-1-codrin.ciubotariu@microchip.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") Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 19 May 2021 12:48:36 +0200, Codrin Ciubotariu wrote: > > This patchset adds a different snd_pcm_runtime in the BE's substream, > replacing the FE's snd_pcm_runtime. With a different structure, the BE > HW capabilities and constraints will no longer merge with the FE ones. > This allows for error detection if the be_hw_params_fixup() applies HW > parameters not supported by the BE DAIs. Also, it calculates values > needed for mem-to-dev/dev-to-mem DMA transfers, such as buffer size and > period size, if needed. > > The first 4 patches are preparatory patches, that just group and export > functions used to allocate and initialize the snd_pcm_runtime. Also, the > functions that set and apply the HW constraints are exported. > The 5th patch does (almost) everything need to create the new snd_pcm_runtime > for BEs, which includes allocation, initializing the HW capabilities, > HW constraints and HW parameters. The BE HW parameters are no longer > copied from the FE. They are recalculated, based on HW capabilities, > constraints and the be_hw_params_fixup() callback. > The 6th and last patch basically adds support for the PCM generic > dmaengine to be used as a platform driver for BE DAI links. It allocates > a buffer, needed by the DMA transfers that do not support dev-to-dev > transfers between FE and BE DAIs. > > This is a superset of > https://mailman.alsa-project.org/pipermail/alsa-devel/2021-March/182630.html > which only handles the BE HW constraints. This patchset aims to be more > complete, defining a a snd_pcm_runtime between each FE and BE and can > be used between any DAI link connection. I am sure I am not handling all > the needed members of snd_pcm_runtime (such as handling > struct snd_pcm_mmap_status *status), but I would like to have your > feedback regarding this idea. I'm also concerned about the handling of other fields in runtime object, maybe allocating a complete runtime object for each BE is an overkill and fragile. Could it be rather only hw_constraints to be unique for each BE, instead? Also, the last patch allows only IRAM type, which sounds already doubtful. The dmaengine code should be generic. Last but not least, one minor nitpick: please use EXPORT_SYMBOL_GPL() for the newly introduced symbols. thanks, Takashi