Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1786869ybn; Thu, 26 Sep 2019 02:09:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqzWXFYCdBxeNhVrGs8t21Oh8pWU2ym/0fsWNX+tt2Nt0gyMDK73RdhpEhWmJWbQmxq9tHFP X-Received: by 2002:a17:906:d92c:: with SMTP id rn12mr2128298ejb.16.1569488944089; Thu, 26 Sep 2019 02:09:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1569488944; cv=pass; d=google.com; s=arc-20160816; b=bYkplQqI/6VraGG/FiTUj0SjJxcUQFBK4de2+P2twls9vnRtc1dMbl9HLgtXkzYyqy ybU659dSefyDk5zvfcQY+V/WqI7s+BoyX1xkrGrvxGDkGkCusfyIGCv8bb6HkW1jWJfY nkRpH05xdFofIi9jMlT8WDFHoBBHAXV3NDSvKGysUU76TqkMG3n5oJoeu5klHXI2CYPY pxr6gvSeZ8xeqV7JWHKFijjOAXXslzN5AuZoB3cAeVkBaAKJqKlP4K7dsVZ4tLArPXR0 MT0wHh3A0U7qql81+BPCkFObynf1fSTWisbmHWIYvGQK/TZnGumghB0HExh5PcxGBT65 yFsg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature; bh=AQ6TgO9jjXwz6VthJCuxc4Hg8en8OdiiORD8G8ad0/M=; b=xBeljgvi9f8DxSzTJN/fvuE6VjX93UZyQK5cSpMdHdVTf9WnWc1U8vDvTeiZatDq7c r0GhyZwRRAmclC5V+3IH1+5Z5O9Lqxg6/ZtL9SFIViLGE4mb0jNkD2LM6wUIM3QOwj6d +Lk7jAKT4hxMtdY/NWorckj48NI5DDJhLpYTyt1MOLZB/RZJoaxRNq340alQDx5npzY+ QhhTfUAvb+Kce4tTt59hjBSLRk9axHXgz9IwD9K9OI43swAXKHSBYqlSjacCDV6/bBLo YbVxCcfN+B+sGknTHgcRovmiKXLB3BrtI/AELkbKcqoRI4fXqMKp0Rs4dzKojjLeboLN WnLA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=bnFF7R6N; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b50si962367ede.28.2019.09.26.02.08.40; Thu, 26 Sep 2019 02:09:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=bnFF7R6N; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2411554AbfIYDew (ORCPT + 99 others); Tue, 24 Sep 2019 23:34:52 -0400 Received: from mail-eopbgr70085.outbound.protection.outlook.com ([40.107.7.85]:30112 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2391325AbfIYDew (ORCPT ); Tue, 24 Sep 2019 23:34:52 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=URrGibzPduHFL4Cj/qbsI27S02o/A3AGkx59xNBeR+tCMy3P4pBt5uGu9VhgkAEBjHNSibxWYqOP069pLsS4KDDg1pH36y6XnwPSMWvH5E+uR/MEBSyTYFFA8fe2nGc5o2iWpDmd9p1glqGPx/OJ/gbquXSlRx0EM4jM+y73hWGZZiRTOybRz7ndm5cIXTqA/JJAviwriY86atlFZiVESNP7zFt4n8SdgtYUhTxuFzCBLXbLxmIFpqycOQHEntsuMwUPjelopo6Qq1t7ZLpXoT1qXStRDqWZfnJN7EU9Yw5zK5ECBIEsVTUPu946zJy9vNxUUprggkEzQ16dsdPUjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AQ6TgO9jjXwz6VthJCuxc4Hg8en8OdiiORD8G8ad0/M=; b=SG3qlnZY3neKFpSofcr75B8v9M0hovnwHxRcwDFHV1RCYEcQnbveEkcVypUpox57+F7CyacUaqbfUUg0bAZQkLhmdpPVU+ieCCSSth7ueY7rmcc9DDevp+q7ACqAOH73Xnuw9efNDQY6ZFpfPRwf0v0/y+7PrGHIjUDCuAU2tXdxvL+roR9ayI/wD/4VZxo20RdoNGAqJKgyO57YT+CKh4gTNFmCsxwpP0BywBJA3PUHqUjwbiYA5KXcAgBsIqbNgAzu+ubVrMVIw9/ZT44fsfEnqYFS3vWDj1MqjaFHlJ+Z9kcMm2WPJM4PIOX2xtPVYjgdjLwl+VdUYmL2y5NF8Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AQ6TgO9jjXwz6VthJCuxc4Hg8en8OdiiORD8G8ad0/M=; b=bnFF7R6NS/33mvy9PvK5UIS66YLbQ/E2q5rFLZIKEYMY8cWW8hASPVAeZgylPN3fTsJtcbcaULaWVyaqFV93/nE8BDt+lwwGQJKmMKy7T7oBYsJKd95+3JDmcdJUvfp2vdDcEmY0oj93+Wp97JTYsdXWTs7lU8aEs5htUPdqpG8= Received: from AM0PR04MB6468.eurprd04.prod.outlook.com (20.179.254.214) by AM0PR04MB4993.eurprd04.prod.outlook.com (20.177.41.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2284.25; Wed, 25 Sep 2019 03:34:45 +0000 Received: from AM0PR04MB6468.eurprd04.prod.outlook.com ([fe80::9974:f659:52e:40b6]) by AM0PR04MB6468.eurprd04.prod.outlook.com ([fe80::9974:f659:52e:40b6%4]) with mapi id 15.20.2284.023; Wed, 25 Sep 2019 03:34:44 +0000 From: "S.j. Wang" To: Nicolin Chen CC: "timur@kernel.org" , "Xiubo.Lee@gmail.com" , "festevam@gmail.com" , "lgirdwood@gmail.com" , "broonie@kernel.org" , "perex@perex.cz" , "tiwai@suse.com" , "alsa-devel@alsa-project.org" , "linuxppc-dev@lists.ozlabs.org" , "linux-kernel@vger.kernel.org" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "devicetree@vger.kernel.org" , "lars@metafoo.de" Subject: Re: [PATCH V4 4/4] ASoC: fsl_asrc: Fix error with S24_3LE format bitstream in i.MX8 Thread-Topic: [PATCH V4 4/4] ASoC: fsl_asrc: Fix error with S24_3LE format bitstream in i.MX8 Thread-Index: AdVzUXTsa3VOQwaBSAODOXmc76582A== Date: Wed, 25 Sep 2019 03:34:44 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=shengjiu.wang@nxp.com; x-originating-ip: [119.31.174.66] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4b17a451-efd2-40dd-64f3-08d741694f06 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600167)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020);SRVR:AM0PR04MB4993; x-ms-traffictypediagnostic: AM0PR04MB4993: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 01713B2841 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(4636009)(366004)(136003)(39860400002)(396003)(346002)(376002)(189003)(199004)(6116002)(1411001)(66556008)(3846002)(71190400001)(26005)(476003)(66446008)(2906002)(186003)(66476007)(7696005)(8676002)(99286004)(102836004)(14454004)(6246003)(305945005)(7736002)(81156014)(81166006)(86362001)(5660300002)(478600001)(54906003)(7416002)(55016002)(9686003)(6916009)(8936002)(6506007)(71200400001)(74316002)(66066001)(4326008)(14444005)(76116006)(33656002)(486006)(256004)(229853002)(52536014)(64756008)(316002)(6436002)(66946007)(25786009);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR04MB4993;H:AM0PR04MB6468.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: MeVQok7MfHaEFh60Ye2Xu1C4HDAXl6wOkhUJZZh72RqRZltvInCgDQwdcakS1ySDHbq461O7V+ndE5XBbymQrhLazo+7bXUc3FxjgiHQLyyaNvoMGfrMwkidPe/XRPVYOXyQWYylge2s5VKYIbXlAFlCUGCdliOMF/G0xvMFtrDQvuFnN8KCuKoAeIvEu9HOy7ui8w70wmmi/oIcJcLl9dnxCD18ecovuRBatUPEpMIZ0BEc9c4U2j0aP92F0FOL3Q7/4QyiCIYGs+Ey7cPVcUfTiK9GJIejsa+pObmFBCBIzuAloasEY2FlkMSnJBMgVuEhWRTBs/TpuD+iupc7mWwWVEv58MOgIzhgAjBhF/ZWgJgl4DOTujI0WY1sUz9rrHFpOewnBMfKP5a+Va1XoHREv9wZrq90aXJEVPVBvkY= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4b17a451-efd2-40dd-64f3-08d741694f06 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Sep 2019 03:34:44.8345 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Z+99T4hJgGWNuwtCFzBdPQUOBIoW37cS9ZydgqUys9BVT6EkVBB2K1i7aJ6p2GYerWe6GPjc/2pgsKOipkI6Fw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4993 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi > 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 =3D substream->stream =3D=3D SNDRV_PCM_STREAM_PLAYBACK; > > struct snd_soc_pcm_runtime *rtd =3D substream->private_data; > > struct snd_pcm_runtime *runtime =3D substream->runtime; > > struct snd_soc_component *component =3D > snd_soc_rtdcom_lookup(rtd, > > DRV_NAME); > > + struct snd_dmaengine_dai_dma_data *dma_data; > > struct device *dev =3D component->dev; > > struct fsl_asrc *asrc_priv =3D dev_get_drvdata(dev); > > struct fsl_asrc_pair *pair; > > + struct dma_chan *tmp_chan =3D NULL; > > + u8 dir =3D tx ? OUT : IN; > > + int ret =3D 0; > > > > pair =3D kzalloc(sizeof(struct fsl_asrc_pair), GFP_KERNEL); >=20 > 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 rout= ine, > prior to applying this change. >=20 > > if (!pair) > > @@ -285,11 +288,51 @@ static int fsl_asrc_dma_startup(struct > > snd_pcm_substream *substream) >=20 > > + /* 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. > > + */ >=20 > "temporary" =3D> "temporarily" >=20 > > + ret =3D 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. */ >=20 > "release" =3D> "released" Ok, will update them. Best regards Wang shengjiu