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=-5.0 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,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 9350BC4320D for ; Tue, 24 Sep 2019 21:54:07 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (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 14003214DA for ; Tue, 24 Sep 2019 21:54:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PiWxYZbA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 14003214DA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46dFMJ5Jj5zDqb9 for ; Wed, 25 Sep 2019 07:54:04 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::543; helo=mail-pg1-x543.google.com; envelope-from=nicoleotsuka@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="PiWxYZbA"; dkim-atps=neutral Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46dF8R1kmyzDqVb for ; Wed, 25 Sep 2019 07:44:38 +1000 (AEST) Received: by mail-pg1-x543.google.com with SMTP id 4so1977331pgm.12 for ; Tue, 24 Sep 2019 14:44:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=8TaXClZL44x6R6m23BGIIOYUw8sFdA7SimmvF1Bs6II=; b=PiWxYZbA9Phtp8IDK7idRhXLPFpVl8Nivv0bnnYLe3e3GtA0prmh/cyb4fHtq4Gim9 aqlwpu5kw/gwGvZgr1PevcKG1YZRm4NRav9JQY8t4jD9ouA1/i6jCrKJGPq1MnRdm8Za zcVcS52Iw7UOovvfOTsRw0smUUa/8C1pIbP5pRVkoBa2JcIuY3/NaibW6X98J/DrVnPP u4jagDKOIj26zhiMKPopz6CkiPG+busIukqq/hxVnslcJhWs4Uqbf5clU765/Ug97tzP vOBIcRr6706g6selmfD9KRihs4X4HljViLD/zguw80jjUXENnR6hn1v0FEDtWG+aN/C7 T+Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=8TaXClZL44x6R6m23BGIIOYUw8sFdA7SimmvF1Bs6II=; b=pgrJ3oysd1gTdpKlY8742rFW2GU9WkMJwQEVpoWothCptVdkIY5LX9mE1KBIl7H2hR OscEesY8JAjhN2EOL98ylU54hAhzfK4rwESEz/s4YmyGqZ4w1M3jeAvC/yOhpWyAbB8U cEJHbV4LB29nzce+BMq9UYTp8P0u/Mr+TAdaE39uvC0U0LGnsu5UT7EVGN+EveopI0Tk cP290Ye8c/ngqjRaoHx5kXe7syoIkCGtHobwSB9y9WWn449ct2/asOI3CIuHw+G/z3lG d8GE3skOihaI3Ey+9gNsN4q6vKjOwpqP8n8D+OCVDVePeR8q1jdYd7/E3aGBw4X9ZdpH zA1w== X-Gm-Message-State: APjAAAV6tjPnB05CBa/5i1caSbwMH5ZfLBQtR0MplFwsghiw+ZEBhF93 icQ8ea9GisWEPx50wGm+wyy7uFDhZas= X-Google-Smtp-Source: APXvYqx85giUVZhiQHsCv//r2YbURAPCdsrA+9rcufqztCRKD6LsbMJVknHc1eyohUWvf/YPUk/5ZA== X-Received: by 2002:a65:64d5:: with SMTP id t21mr5237437pgv.43.1569361472982; Tue, 24 Sep 2019 14:44:32 -0700 (PDT) Received: from Asurada-Nvidia.nvidia.com (thunderhill.nvidia.com. [216.228.112.22]) by smtp.gmail.com with ESMTPSA id b22sm4651877pfo.85.2019.09.24.14.44.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Sep 2019 14:44:32 -0700 (PDT) Date: Tue, 24 Sep 2019 14:43:44 -0700 From: Nicolin Chen To: Shengjiu Wang Subject: Re: [PATCH V4 4/4] ASoC: fsl_asrc: Fix error with S24_3LE format bitstream in i.MX8 Message-ID: <20190924214343.GA964@Asurada-Nvidia.nvidia.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, lars@metafoo.de, timur@kernel.org, Xiubo.Lee@gmail.com, linuxppc-dev@lists.ozlabs.org, tiwai@suse.com, lgirdwood@gmail.com, robh+dt@kernel.org, perex@perex.cz, broonie@kernel.org, festevam@gmail.com, linux-kernel@vger.kernel.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Tue, Sep 24, 2019 at 06:52:35PM +0800, Shengjiu Wang wrote: > There is error "aplay: pcm_write:2023: write error: Input/output error" > on i.MX8QM/i.MX8QXP platform for S24_3LE format. > > In i.MX8QM/i.MX8QXP, the DMA is EDMA, which don't support 24bit > sample, but we didn't add any constraint, that cause issues. > > So we need to query the caps of dma, then update the hw parameters > according to the caps. > > Signed-off-by: Shengjiu Wang > --- > sound/soc/fsl/fsl_asrc.c | 4 +-- > sound/soc/fsl/fsl_asrc.h | 3 ++ > sound/soc/fsl/fsl_asrc_dma.c | 59 +++++++++++++++++++++++++++++++----- > 3 files changed, 56 insertions(+), 10 deletions(-) > > @@ -270,12 +268,17 @@ static int fsl_asrc_dma_hw_free(struct snd_pcm_substream *substream) > > static int fsl_asrc_dma_startup(struct snd_pcm_substream *substream) > { > + bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; > struct snd_soc_pcm_runtime *rtd = substream->private_data; > struct snd_pcm_runtime *runtime = substream->runtime; > struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, DRV_NAME); > + struct snd_dmaengine_dai_dma_data *dma_data; > struct device *dev = component->dev; > struct fsl_asrc *asrc_priv = dev_get_drvdata(dev); > struct fsl_asrc_pair *pair; > + struct dma_chan *tmp_chan = NULL; > + u8 dir = tx ? OUT : IN; > + int ret = 0; > > pair = kzalloc(sizeof(struct fsl_asrc_pair), GFP_KERNEL); Sorry, I didn't catch it previously. We would need to release this memory also for all error-out paths, as the code doesn't have any error-out routine, prior to applying this change. > if (!pair) > @@ -285,11 +288,51 @@ static int fsl_asrc_dma_startup(struct snd_pcm_substream *substream) > + /* Request a dummy pair, which will be released later. > + * Request pair function needs channel num as input, for this > + * dummy pair, we just request "1" channel temporary. > + */ "temporary" => "temporarily" > + ret = fsl_asrc_request_pair(1, pair); > + if (ret < 0) { > + dev_err(dev, "failed to request asrc pair\n"); > + return ret; > + } > + > + /* Request a dummy dma channel, which will be release later. */ "release" => "released"