Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp202709pxb; Tue, 17 Aug 2021 23:45:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBMPmO+Y+Xv6Wr5OPsIYwgUb6u8VW6YI7yd1kLnpF7dbxQxWBvf+UWBBz+6fbwvmIvaTkQ X-Received: by 2002:a05:6402:5112:: with SMTP id m18mr8496460edd.47.1629269126793; Tue, 17 Aug 2021 23:45:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1629269126; cv=pass; d=google.com; s=arc-20160816; b=g9gx5IQpGicVtXTThH6tbA/5hRESnueWCe9hCXQnaB4YZ5Rh7GzqzblbWZCeidFqbN YiFzY1QmxFTVkSewoHsW2wB8VLtg9oQ91N8nRedE1jjppf8nhNC13apgZe1Soi9EujIc kbHlC90/j4jC30JOcoTyp8nsVzQcA/tkPmTeVuisRfXkpoyBW2+eWr4g2P5lDSYTCsRS 9R6l/pJ2g1dpSuXdiC9PXBBjDOHow6tuTumQ21RRsgiJnyy3a50+9kLoarElW4wZ8sKX 4N8wYvI++o2UxxeP5zoa2dFSmjOFF2PmdNB/YP4tldfkGIoIVTFwtmAjcRIga7b+F52H Rekw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=hENU6nXYjQ2rfUF00nTaBpwtAi9lKBKQU8QIZ4PHTBA=; b=otkrf+gfDdoB6Sb7wRY2NPFO/0nLPtjrR6Jr8L/UMGO3Y3Qmveyyc3k+PQX9nHw8Vv XwIDI1B22jZs5BPctBEXpiJNmxr5+COeujmoY4VbyKqimeq07ntYzKlsMcrzRu0JHNrZ G3P9whyvNsxg+adMsNUYnKOOU+miMdw84MIWY3PsWy5mDF9eXNcJpwO1Tep+wK4sM7JG /4wOTG6holAUy5mOwvfS++Hxh1rBUEy6tXvJXsOdIw2yd9lrLGbyvI80Hu5ooVh8y58Q B4MU/2qRwgzN1LV9G/2BFYG2tTcLqpY79CmGpQwAYuKPtXjA1+0EY2RByyXV0GO/9x7o /Usg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@renesasgroup.onmicrosoft.com header.s=selector2-renesasgroup-onmicrosoft-com header.b=IizrW+7q; arc=pass (i=1 spf=pass spfdomain=bp.renesas.com dkim=pass dkdomain=bp.renesas.com dmarc=pass fromdomain=bp.renesas.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 jz20si4576617ejb.263.2021.08.17.23.45.03; Tue, 17 Aug 2021 23:45:26 -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=@renesasgroup.onmicrosoft.com header.s=selector2-renesasgroup-onmicrosoft-com header.b=IizrW+7q; arc=pass (i=1 spf=pass spfdomain=bp.renesas.com dkim=pass dkdomain=bp.renesas.com dmarc=pass fromdomain=bp.renesas.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 S238049AbhHRGoU (ORCPT + 99 others); Wed, 18 Aug 2021 02:44:20 -0400 Received: from mail-eopbgr1410124.outbound.protection.outlook.com ([40.107.141.124]:56544 "EHLO JPN01-OS2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S238034AbhHRGoM (ORCPT ); Wed, 18 Aug 2021 02:44:12 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mcw4sbez+3GTPGi0ZWzP18FESIQ/TywOtaunGFsF6MLj9lOUYpvZ500Q1UnL4lUyjVUGgh6EyKHHwWVTKXEWPCc0krIhBwYuZzWrfmA0aO+XlHWl4EbDMFhCO4Vb+fHmsOeVcDBcaTt45KE8wQtPQ6imEYkI11izeapiE/unsfi2IbbmixaRiwKG/cSOhzX+/emm6Nm73LAFOPp3/zTboT245H/CBtqT4SD4lkGhHhYuV9Epc/ACG1BZ18Ug9MFl3lGcKrPxvHO08NLA4pQuHA/+sSs4FlQzhIUkKMLM0aFEuSnqEpZijE/1c9g4D54FeqRW+KE9uO+p7s0mUPbjXA== 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=hENU6nXYjQ2rfUF00nTaBpwtAi9lKBKQU8QIZ4PHTBA=; b=LqAIKHmXAoestl4FFbAkBIoiBbL3sF8XSeUrJCJ/uKhuGzEnaWFkM69Pp8lZXlq4NtUhzGCVVrzGVR9BgPTIt+KicjHmo69Z6qnq1NKIV2EGv1ygh4n+9EtQ56XhPpPxC5dLXksJYL/PFPkdVYMnyXqZgcCh09zMLH5si+j4m9kX8HvFPUKjH057mUX4uGdHp7nhtl90FQfThwxMEhGBTWQPrQi8PCl55dHptsP1LLWNpVHnsOBKWeHAafWbiE6W3zt0EVQ7m27kAH5iSm8wB4qfeeITlza/+BC6Siojqe50gXgHy6BkLnrXwj3cMIcoSuHyCRWoffnJgurdKPSTxA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=bp.renesas.com; dmarc=pass action=none header.from=bp.renesas.com; dkim=pass header.d=bp.renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector2-renesasgroup-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hENU6nXYjQ2rfUF00nTaBpwtAi9lKBKQU8QIZ4PHTBA=; b=IizrW+7qb06qAQ1SwMo3tlfAWA1VTjyrhcYwswrfia3hcDU/wDUxHyxKSqIRFq1oT0TOaq6ibHxkR9Xvpi+S893kCJB9mScjgzl1ds06orFsTdlorgjkDyXdRqK4Z3Ei39XeofeTBN/vw0BGTVDAPxOx+czUNUpDILRf6rGpfT8= Received: from OS0PR01MB5922.jpnprd01.prod.outlook.com (2603:1096:604:bb::5) by OSBPR01MB2936.jpnprd01.prod.outlook.com (2603:1096:604:18::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.20; Wed, 18 Aug 2021 06:43:36 +0000 Received: from OS0PR01MB5922.jpnprd01.prod.outlook.com ([fe80::c6f:e31f:eaa9:60fe]) by OS0PR01MB5922.jpnprd01.prod.outlook.com ([fe80::c6f:e31f:eaa9:60fe%9]) with mapi id 15.20.4415.024; Wed, 18 Aug 2021 06:43:36 +0000 From: Biju Das To: Yang Yingliang , "linux-kernel@vger.kernel.org" , "alsa-devel@alsa-project.org" CC: "broonie@kernel.org" , Prabhakar Mahadev Lad , "lgirdwood@gmail.com" Subject: RE: [PATCH -next] ASoC: sh: rz-ssi: Fix return value check in rz_ssi_dma_request() Thread-Topic: [PATCH -next] ASoC: sh: rz-ssi: Fix return value check in rz_ssi_dma_request() Thread-Index: AQHXkxM86qyxelIXFUSoh7N/p/Brr6t3O6JQgAGTTaA= Date: Wed, 18 Aug 2021 06:43:35 +0000 Message-ID: References: <20210817030027.1462671-1-yangyingliang@huawei.com> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: huawei.com; dkim=none (message not signed) header.d=none;huawei.com; dmarc=none action=none header.from=bp.renesas.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9fd1f804-fa5e-4d71-a48e-08d962138122 x-ms-traffictypediagnostic: OSBPR01MB2936: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: mjn6irK1hof4iiCdKysHEAuk7Zog6OJIcZGkAgM9oKfuhwT3RiA/wsTKNChvGUff3OPwBz/AcUep0jZM/sl2Qte7D4i69uqdv+E015q0X6Gua8WwOvXH/aAWNH5hRp2kLtX6PFfovJRCeZGc2xyU6rRIjH4nG2r/PIe4FmWcsctP15KJKNau3cBhMlnLNFwwCupUp9Chf+yXBNegbAzwnhFbKfVflJqH0A9E+5Y+Gvg2zuO/F/ia03VhXiZprroZr2mPDPLP+D/rBajqbYwG0/aNyBJYDdoOV6wPtucJvd859hifeFc6Zfz06MI7oN3HBArhpxE+yZXRaaz7y2M6TqZAiWKJPju1y7Jca/c7b6l1QkWAIBRGvBunvxVFQnsxSK4iNrv8e/9p/q2RYuZpa+UP6VIFK4AjrhWlYI9Tbb9iExvpAF+YTicMbtO8IiaNinATfwmsD3dr/m7gCAj9QNEk0/yOprtE8/tsLVOpBv4HVZxjtqolNwpomFbhj3mHKZJNZmmkjcLzrAC74WLjB6pEv+tXZKu2twsTD065v6/SyzaeTCMUFD6GVyukZ7v5xWfLT6yKkOQr3t+46NigsFh/9wL36co9tq0lashl9K/sJl0aVbh1Pg9RK7uXD7+UTzzVzBjFhrxSFbuTUdHC9fO1hKL7Qvu4k3OhOBL/uPdZaE8eihJXcfdhJ6iJBl78ECfjsEyRYh/WEFdE77it+S/HHtiVZFfvTUp7Ef03uCT7bi1gMXH7fL8TUf/qIyiTWmDBeDuDbvGEGuDB29Z0OYbZgnp7G+SoF0bZ/M6mBXk= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS0PR01MB5922.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(346002)(136003)(376002)(39860400002)(366004)(396003)(9686003)(38070700005)(33656002)(86362001)(6506007)(38100700002)(7696005)(316002)(2906002)(54906003)(110136005)(55016002)(83380400001)(71200400001)(122000001)(8936002)(478600001)(966005)(52536014)(8676002)(186003)(64756008)(66446008)(5660300002)(66556008)(53546011)(4326008)(66476007)(76116006)(26005)(66946007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?pa3PzaOU0W99OcqqYsnBQ9ZG0BYkkxMDcyqeDLwCMpM0PU9MLJvyWrOTMHOh?= =?us-ascii?Q?nN7Hp97DwT1Koofz9B004eIdPAFpS7LdXZ/zFqCapfeu3/Dp7S0WsW9417ct?= =?us-ascii?Q?oSjc56p6A6cva+0Yc+oZLYBAeFvX2rXdHY5DorG0t8GtMBObVeOJF51ewtOi?= =?us-ascii?Q?/i1gKq1NRoa+PA5BZurtX6VakNWLLBtDUMtbKKaNXKUGP18XiMmFlLheKbYO?= =?us-ascii?Q?QqNvqkzV5X/j6b+pz3AwclzKs55x2PYfJ6DRPhBh9dNcMicaYLpQh7BFGJN/?= =?us-ascii?Q?KGnea+OpgQDD0wb+/CamF+qDo3DZnZMbTvyrExyEJQSqFHqNep7M9oqpAnbV?= =?us-ascii?Q?vW1IFBXU32/jIF/dCDtOrS4FbpIumqwQ6ob8dUMHse7xyz61e3u19eeyz0ws?= =?us-ascii?Q?IW5YqbAWqa4N4Gg0pjKz4J7KYNjhCiY3PVmiYZbV+TEFOfxAnoVvhxGFAfyq?= =?us-ascii?Q?+vZIVG3N76fy31keb6/tx+BTl+92fczgKI3jTIscswPinaCqQR4E5NbQAu1U?= =?us-ascii?Q?uxldJ1ibIEDO1tYxupeXRmLWDblTkKmF9IUZ1jW/3+wJOkb2z1VUYtlJY4Xd?= =?us-ascii?Q?aVkjDaFKOuc6aMvfE+tKok7hJ1VREBrsw8SO104FduU49laDsi58hwGe4D/I?= =?us-ascii?Q?eZKX/OKVD9wOMo3SHd44VnpVblOIoI4EMWksBLwPPCTKMgT8Hb67Qluou6Ky?= =?us-ascii?Q?kI9KGtx9MBJLMnp968VtQ5ZmDC3OmeAypSNx325HnxTduDrb4CAzv8zWHkQe?= =?us-ascii?Q?hs8bkXYHGg6SMsWKgU6wXXkUVJuN+X9GUVOppNSHNX+9KTtlTDubZjLnfwdq?= =?us-ascii?Q?5Pt40Nj527A7jIYNZtv8JRwTtHvpvvMimWAwWrfUrA1cjDiU2HP7+dfaOibj?= =?us-ascii?Q?qChxxtbuS/91Wgi1m4bd8wsobXj1wRszmohEyBjIO0zFP6beoe9CHNJJ9dRP?= =?us-ascii?Q?hooGrn83MbWRvF3O8WbRNSpyeN3+nYp4xqufMVhvIWmRrV/wwNvr63gBTIGT?= =?us-ascii?Q?akwk111Brs1eEui74/X2RcERyCwKFuCcGBLzaflGKNQBiJc8HvHh6upoGyNR?= =?us-ascii?Q?IxtN6MKGivclfOsqCtbs0KYG8+fvwpRLOpu2SPejCxtyqDaN0EeFNsM2DLhe?= =?us-ascii?Q?HO3Dn1woKdK8foBXe9lob0twj8xvud8qhs/dd5xDIc8RJ/H9RAbZIONgumqc?= =?us-ascii?Q?0c0j0APpSKRenhIo2n+t0hobx1Yw2Vyok0A+NkndAStpixrMqRUGPaefxZBg?= =?us-ascii?Q?QA/BLrNxA0+SyNRT/vjagCxfYruoyJYyIe11JovBDG8m+lanFKKBE5HgiiQn?= =?us-ascii?Q?bHEWSQpITNRDAkC5UfiQ9Lkz?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: bp.renesas.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: OS0PR01MB5922.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9fd1f804-fa5e-4d71-a48e-08d962138122 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Aug 2021 06:43:35.8499 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 9Q67rCHAlBQp/iP54gNQLaZ40S884yQA0/Y8rtx+9BOO8oSmlTeQnBMwOpptYICGmt4LW8pDMlvSUM+2R6tUsDOfCg/l+6Sxh+isGPSZ7EY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSBPR01MB2936 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Yang Yingliang, Still some improvements to be done on this patch. If one of the dma channel is failed, we should fallback that channel to PIO= . Something like below. I will post a new patch after testing this. ssi->playback.transfer =3D rz_ssi_pio_send; ssi->capture.transfer =3D rz_ssi_pio_recv; /* Detect DMA support */ ret =3D rz_ssi_dma_request(ssi, &pdev->dev); if (ret < 0) { dev_warn(&pdev->dev, "DMA not available, using PIO\n"); } else { dev_info(&pdev->dev, "DMA enabled"); if (ssi->playback.dma_ch) ssi->playback.transfer =3D rz_ssi_dma_transfer; if (ssi->capture.dma_ch) ssi->capture.transfer =3D rz_ssi_dma_transfer; } Regards, Biju > Subject: RE: [PATCH -next] ASoC: sh: rz-ssi: Fix return value check in > rz_ssi_dma_request() >=20 > Hi Yang Yingliang, >=20 > Thanks for your patch. >=20 > Already I have posted a patch for fixing it. >=20 > https://patchwork.kernel.org/project/alsa- > devel/patch/20210814180120.18082-1-biju.das.jz@bp.renesas.com/ >=20 > Since you posted a similar patch as Reported-by: Hulk Robot > , I am adding my Rb tag for this patch. >=20 > Regards, > Biju >=20 >=20 > > -----Original Message----- > > From: Yang Yingliang > > Sent: 17 August 2021 04:00 > > To: linux-kernel@vger.kernel.org; alsa-devel@alsa-project.org > > Cc: broonie@kernel.org; Biju Das ; > > Prabhakar Mahadev Lad ; > > lgirdwood@gmail.com > > Subject: [PATCH -next] ASoC: sh: rz-ssi: Fix return value check in > > rz_ssi_dma_request() > > > > In case of error, the function dma_request_chan() returns ERR_PTR() > > and never returns NULL. Set 'dma_ch' to NULL, if dma_request_chan() > > returns error, so the code using 'dma_ch' can work correctly. > > > > Fixes: 26ac471c5354 ("ASoC: sh: rz-ssi: Add SSI DMAC support") > > Reported-by: Hulk Robot > > Signed-off-by: Yang Yingliang >=20 > Reviewed-by: Biju Das >=20 > > --- > > sound/soc/sh/rz-ssi.c | 8 +++++++- > > 1 file changed, 7 insertions(+), 1 deletion(-) > > > > diff --git a/sound/soc/sh/rz-ssi.c b/sound/soc/sh/rz-ssi.c index > > ea8d33ede5d2..5ec78fd94d94 100644 > > --- a/sound/soc/sh/rz-ssi.c > > +++ b/sound/soc/sh/rz-ssi.c > > @@ -676,11 +676,17 @@ static void rz_ssi_release_dma_channels(struct > > rz_ssi_priv *ssi) static int rz_ssi_dma_request(struct rz_ssi_priv > > *ssi, struct device *dev) { > > ssi->playback.dma_ch =3D dma_request_chan(dev, "tx"); > > + if (IS_ERR(ssi->playback.dma_ch)) > > + ssi->playback.dma_ch =3D NULL; > > ssi->capture.dma_ch =3D dma_request_chan(dev, "rx"); > > + if (IS_ERR(ssi->capture.dma_ch)) > > + ssi->capture.dma_ch =3D NULL; > > if (!ssi->playback.dma_ch && !ssi->capture.dma_ch) { > > ssi->playback.dma_ch =3D dma_request_chan(dev, "rt"); > > - if (!ssi->playback.dma_ch) > > + if (IS_ERR(ssi->playback.dma_ch)) { > > + ssi->playback.dma_ch =3D NULL; > > goto no_dma; > > + } > > > > ssi->dma_rt =3D true; > > } > > -- > > 2.25.1