From patchwork Mon Jan 20 08:19:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shengjiu Wang X-Patchwork-Id: 13944832 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2042.outbound.protection.outlook.com [40.107.22.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 55B3B1922DD; Mon, 20 Jan 2025 08:20:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.42 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737361232; cv=fail; b=qEp8BsYQ/0o7hZ590yxn2HarwX/klWrHCXaXWtH/oYeiFPZYW7DJEFQQ7Hy7IPlGotm/i3Adg9OdAaHcQ9HqYu1sSLOV99sufjTs3r92Pn90Nwxw7VnUptM2LVtIHCTmIVYzkfH7EahFFPajtyK/QtRmzpkjburJzGmnFcAOsXE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737361232; c=relaxed/simple; bh=xzPLK5MdmHgQgrGUrBdr5yzW3GJZsE/P6jBKTPHqZds=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=tYkOatC35K2GSFTYgekbwBQLtugda5qvi+agcukAoQOzHQ9rub7GPH6eZ5L1SdSVYdVBRrnY9+F1xBFWMsdYBIgpWAKNWvarICouZzzY8kDCtRq7tJSO8SOeMTyaGQiPm+GTFiXlxJPfdXdQGorklElxVIEm076/8C9KMwT161Q= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=WWDsvpi5; arc=fail smtp.client-ip=40.107.22.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="WWDsvpi5" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vdbXa8DVHLVLyLH4oOAGII5TqIEmBwajPQ20QlAM90uE4B+/LCeTN+OUpYfMi5Mtl6AJxD4RfoE1A6G1qinnOuh1b0yp7n0cr8bqgXaYsFMG5c2IlHw9NfY61KCcxSHIzCtxfi1zTXVy8GOaJvSoODBEpJbNJNrigvuN7OYmrS8Nl1zsclw5FfnGj94w1r6utAFske7zzlWgn97dw3GgJr64t5pOs7xjCbYbX03gP0Daoy9EuZ3pubZCR5dm/aDkMiYOhLhmXog4mybsHrQQtK3ZcpQpe++kemjP7A6bsH2LcSspphjmJJjX8PNRDjPhWbYiVi/WbARySVrhofe0Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dEed6f5VWQ8whxmtMEO4DotocEYWMDYrVgkprB6uXxA=; b=oIw9RayblbgYK0P25PEoiAmks8LldKdhN3NtytA1pidxYESQLlEX7KfZXYt9cx0FcgvHvUDX4obeKjbu+eNimTGr4wN0LsdbPwKuH3WikgbTdRAOuueoiF6aYtPXJSEuCRCcV2W1AdC76kJwhLAqvZBEIl3IIy1CuvXO1NuDlofqteEeWwjvtG1D31PC0XE0CjZY6qrDFi/tHozHKvMUoroc54NRpx5XyfRBAAW5X0ePu7iHQw4M9s7aYNO8y5q7cuOHirj2vrtOHKb59ovGAyTFcdea21kAv8+twd75FygHFCPpOZNCiZr5wb2Pv5m6O4bYn+Mrn34AebvssQK+jQ== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dEed6f5VWQ8whxmtMEO4DotocEYWMDYrVgkprB6uXxA=; b=WWDsvpi5WIHfaAXNmhZYn1pcH8bbcr3OjkXcLc/t/uJiPvfl3at1Z+TzjDCXSRsUSP80W9WCFuxjr9TGzANoEpcs/p+mCVpXsIDhlCKzU0BJcNIsrK7lQstA2VvnBWx1k2wQySflipMm8ieG3wjHiZDqU2dZEEsf/DYMptz/fbU3k3RpCacWWNolixF4vTAbiLKTxHYkS5QtONgErLpVnqj3nHCJ7sRSwGt6gsC13zdurGuOCthOf3FFv7h0s1vX7I4ZrEafIXQYpQpBMqpnqJQfWnG5v0fgevlzwB8TjyFsoVOMq2OZ1QcVKcpq8TFnQX1vCx3iMh1q/3u+kvRCMA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB7044.eurprd04.prod.outlook.com (2603:10a6:208:191::20) by DU2PR04MB8933.eurprd04.prod.outlook.com (2603:10a6:10:2e0::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8356.21; Mon, 20 Jan 2025 08:20:28 +0000 Received: from AM0PR04MB7044.eurprd04.prod.outlook.com ([fe80::7be0:296:768c:e891]) by AM0PR04MB7044.eurprd04.prod.outlook.com ([fe80::7be0:296:768c:e891%3]) with mapi id 15.20.8356.020; Mon, 20 Jan 2025 08:20:28 +0000 From: Shengjiu Wang To: shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, nicoleotsuka@gmail.com, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, linux-sound@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] ASoC: fsl_asrc_m2m: only handle pairs for m2m in the suspend Date: Mon, 20 Jan 2025 16:19:37 +0800 Message-Id: <20250120081938.2501554-2-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20250120081938.2501554-1-shengjiu.wang@nxp.com> References: <20250120081938.2501554-1-shengjiu.wang@nxp.com> X-ClientProxiedBy: SI2PR02CA0008.apcprd02.prod.outlook.com (2603:1096:4:194::12) To AM0PR04MB7044.eurprd04.prod.outlook.com (2603:10a6:208:191::20) Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB7044:EE_|DU2PR04MB8933:EE_ X-MS-Office365-Filtering-Correlation-Id: daa3a390-1f9e-4df2-3a5b-08dd392b4c66 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|7416014|52116014|376014|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: TuEf8i7IzLxoEjx64HMKRW6aJB7RMaFpY5E8iCZSPCngyYUGOioiiHL/srcxw1bOcffi8bao2NNutQNYkRqi4cpBxe1lUaDMY/uF9T9WbiqPLk5YL0nsWP0SG+bk5A656oHNkgTzJx5wfepMYWqqH7EAkYdpaCU0LmDVy41X26HxHaWWbzio7OB5/4iZuBiv+MdqTt3Tprprhm4aVEv1dZvYtL98Xgbq82FZ0R8PMtjl8Nk2gFkX10JTKTT0GA7RncOQujsmlvCkaT/CAI73myhBT8h1IuuKj5T4pRgLqgm/RDgGWFqYz6lUPncsaYSPC4AX+8GHdoniQjGhk5ZkVtKeEV36tOY6eJ1HlfNfNWjA/W/J61jO7Ynq/RhuwdAhgC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iE7A783krTqNLRje2dpMnXqT1ghp3V05wQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB7044.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(7416014)(52116014)(376014)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: uyPEkBjOoDkZbo/hFhQOM+M9zbj347JYYAxtXqIN+HzDbzfGRg53WyC2KfD602fkk5MhZPy7RaFA5pZEdnD2iHV2bHwx0mXNgP1clhXOETLfNQVGVNokb6KhsioKu4KV+/zCDBBfVQI4/tRRmkrEGRIdcgmDeSAiQIXIcDuk75SxLCK2wGgWcyhmOJMO+X52O+9MDEPVlMU2o+k5N9qijnN06DcAe02EGCWEAxCG24gG2T6s+jTdmQBx8dFFLDlL3Y25R2OVH1+WFbJEkKPVmA/zHQu6KfOE9V/ua6gMOrI9gCNLSKAcrxQ7TmyjyUyaJtNB6pcAVfa3zio0dXz7HaLvrNLd3tlkmDSnIul4dLzGX6ogHBcwzGz85rHq1GZ9wjGYTeU8XNUP5y3luliTfcYMNF2s80+c75adu6HrTkiTNA1h8S0IXEW4qsfk8PgnNuwy1D4h60/n69LVYPsySvb8D6EdFOGt1Ws9czxQT7DjFReg4G2huI2Szrg4lhV9tLLZjdLLHqET5FqVxFVrRpLWfxxZ+qnV0qiJ9UyQUPw1kbRV0cpXwG5QxWSycMAPutWyuCcktw71WejF7YI0iY+gOoCwOitl3b3ZgrvQbRkaLpj0DvJDgJQvw3gHily8m9ct+eEzVgrFZMNgiJGj0cX7nEHid3ZdVQXCbIwACjrRBjQF7yjmE+yTJ8aipLJlb5M6YRCl/NVvpCDqoFWIyGNebImB8WRS3R+VzFf5BCEX87/TEQEz/x5LdT88PoyExD+D+8qOME4L5Q6M2dLbU8VLF+a9yjtKlrRgKG1q66yiR4QyImPFhfmd3JlTxL9ngt0wLcyfgsmapkagx5NsrgoJDrKk+OFqXvPMdySMO+QxkzlSMUY9UMRmItNht3r7tmssCbwuxNkXGM7dV5ehKiiv/aGNwJbtgVU6LpkQme1aY8IKdWHdv3igAT3aw1+2n2DzseMPv3ywgiFf0SKRAy4ksPbt+K6YhEXsp+prj45gDOCBNtbFsGCetlyMGgLqsXXhxTOuBtMhurdE5tUZXgm6qu3hkPJaw55PpqcglH8izAL3vPXZsbvG9PL0/9io+O4473jNPD0kfrdf3g92k1fsp/vKrB1BkiiYzsgIP5TGqCpFomM/IOZwpPRbvkEA9bo1/ETNvPpm3/LrSKtyDRGoxSLhyuN03T7swECaat7bCMZDgbWk7bKOpcQ9aQjA6QK4ZeuPniRomthh+ygbvvbxZEg9INJ3CHj4by/8MNBi59HFTl2JzMddEIvd/Gjyv5dzw2Vv53EaO9ExOQ82wPyyZF6PW63zByk4zw2XnxlmCfgaQwrutRRnXVX/wT51lpF6oQgqWK0sPwvTSNgJI5+CBAo31Y4GbKmGopeSMf3IMDDmx3HjJPm5iS8k1Dy3CJlQuJaZCXBiaaIWQ+Z3P3DEA5TyG8/oocv8VWHWf7CkuREFrFFw7B6wMAHCCj2N6bHIGUUgPg7eDK0FOSs5HdjtCGTifXU8XSqOfC3rUVffuepr8o72hWlO1GYIO08ZSZXdAeA0KVaKPrtWHRaLc4h9vBCUZKWfnKaWGCIeqb0iYk+h8g9FmlMEfepdDIZ2 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: daa3a390-1f9e-4df2-3a5b-08dd392b4c66 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB7044.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jan 2025 08:20:28.8192 (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: 5q8MyU/pB7f7aaR8tmg6Uh2MaRTCqSsHXQaNPSkTE59teHPMCTpjA5TzLHRsS+cSO99fGAegLr7QN5n0is61+g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8933 ASRC memory to memory cases and memory to peripheral cases are sharing the same pair pools, the pairs got for m2m suspend function may be used for memory to peripheral, which is handled memory to peripheral driver and can't be handled in memory to memory suspend function. Use the "pair->dma_buffer" as a flag for memory to memory case, when it is allocated, handle the suspend operation for the related pairs. Fixes: 24a01710f627 ("ASoC: fsl_asrc_m2m: Add memory to memory function") Signed-off-by: Shengjiu Wang Reviewed-by: Daniel Baluta --- sound/soc/fsl/fsl_asrc_m2m.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/fsl/fsl_asrc_m2m.c b/sound/soc/fsl/fsl_asrc_m2m.c index 4906843e2a8f..ab9033ccb01e 100644 --- a/sound/soc/fsl/fsl_asrc_m2m.c +++ b/sound/soc/fsl/fsl_asrc_m2m.c @@ -633,7 +633,7 @@ int fsl_asrc_m2m_suspend(struct fsl_asrc *asrc) for (i = 0; i < PAIR_CTX_NUM; i++) { pair = asrc->pair[i]; - if (!pair) + if (!pair || !pair->dma_buffer[IN].area || !pair->dma_buffer[OUT].area) continue; if (!completion_done(&pair->complete[IN])) { if (pair->dma_chan[IN]) From patchwork Mon Jan 20 08:19:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shengjiu Wang X-Patchwork-Id: 13944833 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2066.outbound.protection.outlook.com [40.107.20.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 912E1196DB1; Mon, 20 Jan 2025 08:20:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.66 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737361236; cv=fail; b=fVjJRJZUttfhWkBSaLjhbqmdBFhk+flBC4xdEMrtfy8wRqCNcuHx74dKIRQQH4jr9a6ZpdHNobQKvdpOZR+c1mKGTdsMyGnptgCXgcOeH7Ax3WC0f3hVBz6HNWgzKmnHg77ufpyl192giqnCNctjbp6/O7aoAKd0kEdHSHU7JcQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737361236; c=relaxed/simple; bh=zdZWiRGhAtlWVwqBexZNSP8QP2/WicfSiAAuwqbFUZ8=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=c9BmGH4CbpdfMjNS2X8VLdgrGeNZiQAxAcFJfHMsAkD2gagM/t/GvBIKWHxjs95syG6rtvUFisrxoQoXx9xyG64F6V7IJIBC+QFyRxg5gEIQukoEwsEFxguubyipW3jboNDJkbEo0QBYH+SDUCK6zmRZ95vwt7gNUE6LAKksD7M= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=oAlFq53I; arc=fail smtp.client-ip=40.107.20.66 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="oAlFq53I" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=t1aZXda+Lx31iQ8spz6/QR0nZ43NNqkkFquYSv6cb5CtYm6GN/0H6LTmqZ+qqqBJcjWHl/dIzB7UVTm6aUbyAsgHGJyVAecb30gosXd+OM27lT6r10st7t0EpnYR+cX1VWMi0xShVJ4a/I/0B4ufqriS8SPqeyOCxtbh8048ndKtBvsr6cpgnWG0Sp4MfFZ98gI6uXpBm0iOvCXs3rxk73TOjx1sNjusw2TFE07wOEycPXVjEzDkvOjmj8nxw2dsuHSNksUgH9ySkSsck5+LcNUnA0PCiHU9fypVICHZij0zsvG9T3+xSIeBp+TdwwERDe9PIrz2Azxc3J5CHgzB9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=60PUvq+kqo8ZtB6HHCWWbhm607K49VvYrcNwSEFSI1c=; b=hLoQPdNCcyljK34bFeO3cVTZxqsg7hfjMER4lM/AWCdCEbJbckBPDTBCzUPIBvcyD88Q097FLDJeetJpYL3SGjqGEeyRtGWtlKrpuCOMeD5udRT1GTqVmSpPrwsSuNiESU9ox5VTH6ei8QOvAI5K2dT8g9ryZAtqSxBqwtvAC7u4Fpyp7OAlCL7yu1lKv3KCs3cU8whaQfFKl/NCVIs12qcoU7NgB9RLjNNW8Ga34UAK7R5p+dI6iEf/hFf5BoEsM7agg394KSOrXTmJ6VbpZnknNHr8h9zvQ2vyk7WOZNCDliScZ40vo0ktcvsnP1VSEwgXQNSACy+5V6Iicv5fVw== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=60PUvq+kqo8ZtB6HHCWWbhm607K49VvYrcNwSEFSI1c=; b=oAlFq53I1aZy5C4oKIPegUOlb5OObUzj2LpMZOb6pyOZsAGzA5lhgrHHmYS2UkCaTESZmmx6iYhQWIFlICurBwicxOINezUboVK73zWg9wriHohsYOIP8LxSehN9XYTuz0YK+N/jyEwDOGGL2nwQB4Dy+7oO9lOCfr41t8XfxLwyn3Q7Q18n2331zUtdV86wtFF/kL3rzTgEfxk34fFcq+pYqvKJHM/w05tOLVTfcRYhJvNBpj1Kk6jcj1BL+j5Pmvs7gSulzXiMnWnZP7MSAdoaCculwa9kQ1n0bsZUryGZI/BF4uzK/vbBgMD369QpVo3MO7eUC/WDVXwIVfKkMg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB7044.eurprd04.prod.outlook.com (2603:10a6:208:191::20) by DU2PR04MB8933.eurprd04.prod.outlook.com (2603:10a6:10:2e0::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8356.21; Mon, 20 Jan 2025 08:20:32 +0000 Received: from AM0PR04MB7044.eurprd04.prod.outlook.com ([fe80::7be0:296:768c:e891]) by AM0PR04MB7044.eurprd04.prod.outlook.com ([fe80::7be0:296:768c:e891%3]) with mapi id 15.20.8356.020; Mon, 20 Jan 2025 08:20:32 +0000 From: Shengjiu Wang To: shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, nicoleotsuka@gmail.com, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, linux-sound@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] ASoC: fsl_asrc_m2m: return error value in asrc_m2m_device_run() Date: Mon, 20 Jan 2025 16:19:38 +0800 Message-Id: <20250120081938.2501554-3-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20250120081938.2501554-1-shengjiu.wang@nxp.com> References: <20250120081938.2501554-1-shengjiu.wang@nxp.com> X-ClientProxiedBy: SI2PR02CA0008.apcprd02.prod.outlook.com (2603:1096:4:194::12) To AM0PR04MB7044.eurprd04.prod.outlook.com (2603:10a6:208:191::20) Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB7044:EE_|DU2PR04MB8933:EE_ X-MS-Office365-Filtering-Correlation-Id: 0ea227c6-5e6c-435f-56f6-08dd392b4ea0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|7416014|52116014|376014|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: dfUYdFVq8MoYczlOsfvKMNTBs3YwGlsOll1zz5txkddr2lhfkfLNnSLyjFjgrEKHP5SUggYk/r7cOMup9T8GVSv/Lp9z5V9dF6XaX+19GHVyFGIQJMvnY0jwUcYvtGjReqUTHAvF4nGQelKBQ2VPDOPT9Sw4BQVBigUYgm5qtfEKtbrQ6XGztHPl40kEatFFH6fuWSIAdGyl5bwJK4qWImXDZ30WdPiddRXepwwidbkHoGId0IvZeW18T2KMM71FsKVBksl/OofTOgYZq/QFjt9cp41k+mQcpSS9Nx5EIjfE1fav3cIMvpLzF8HOJyEENJRonwycrcnKK0/SDZc9Ir3nF5q3ZhfddGfhORoBBVRduf8Cv5/otSMD1o7CHrGAkhhpo+2IefwatKaeAC3X7g2oCw8qPvX4hO6dnqyg2kmFB2x/kFmZ/FO0PwzjDpySipQbqJQ/7Oc9odDbHJqlrx+s+cWdquafWgsMJpkiZIwFhBeggnAO/izzs90cFwm/tTKgNB0Or7/Wng84IhyI2G5L6VyMjivTRh3pa4z2qvy0C7cMDxh6JK4CN3xpnzA6pQbCxTULhPfK8xgtbmV+fdMVazusheFDq6/3UqY+3Z21var5rwgoLEKBVuawymZWmH/gGybB5q8Vf7pLwRxgxz60y5iiS56bXG20LtkmoV5cOmWpdg9ifIKePQrL5pb7yHpD5GGSwybvfFcYWWcfas5hTktZZU9j5BR/ePFX95zqrgZTRuJmMfQMZuXcs24f8X7nEAe03bq3cnjeyfHV4wuCTg4by+jgSKqhYslKegSndxgxXHDh+1haFxCtlGCORcc/i+047eF17BgiWFQYOx09reUsaRP/8CkDQc+qrPhVVTllw+pan4qZZmEX0IjQpUbwjcc+ICXoIePM+ttky2a0l08+Az2osnkODsti60a89uclsADfJhLhtXXEgXAi/0HTiDlwB3TTbkvVCaGMp2Pz7r2l03k3hnRp65RMBng4aM5FNj00CoGHA0tm5tu1kfy5b5Y8ZNO0NYBjJHNRDWQ3ft8VhMhphfS+QZSz3Em722i8wb9ZYhSLnluL+JLZ8B5m6JCZII0uDfzg9l5CRJ0UirV1FOACLJ0LDM0Oa/gOARyXSg69aeqH/5hy2y/8CadHZPd1qKd62A/lFTdJIUq6HpzaAmYBXoKz/uOj/w/ltv1IL74tf5todjcA8yY3AYS26mkCWfKAk/lu9ce21qqeYTzjVJDRQRmydDhyZQ/eIr6oV4gzi8XVex0JQFK0rpvsVLFAFtXSS9Q1JkLSxkFKdB07SDx+Vbn2NkpAVky0EEHpzYWSbZ2cfZytN9mcF2llLaJsuuV9aKUURDfU6ZEQixwW2gP7EXPENg5O0kKPT+er/anPwgq/W9uy79pMENC6x2ayh+ITOiAFf/r/E6q3bQEKNPL0rdTo3r8oboLA7rYQHcyVoUsIVBSn5YMnn+hNCBApOLCFPk3DDWY3HA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB7044.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(7416014)(52116014)(376014)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: PjZ0zXNCPGZk2cmIMCW3eWk7NPF1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W1btBZfRwsv9D1li29bbJVpNkDQy2tt9S1BBdRXcig8FDtWrTmap5QGYJodqjFbj3jXIXk1uJnN2TcSFLp/7sJrJEZNEelzrKO2FPyFGgn0vAp223QF9G9Y4rFHn5MPIxjN+74xStvIfsHMWHyGUrLRgfRHr7A7nYNvzfVvOxgfEh2hW8QymWbKcDOsUj7XPJyZB6Qum9SOQfqGcViJj10ciOCSwYwUQTTlwaChs9Sj/xjl/EztEV4uPThmrHyslI00lh3WGv2vh/1E8PbMruB944FEAfAtkAs5jMg729/whA/XQlcmQ1iP9RgrQx+5SIcZ+5xIi1pITlZtA+0ZoRd/8cR+dvI7PmG1VcqTgtqQ0LHL6raEzGYgt63Y7I02P5LV37SgG8snNPgO7opCngfD1SOOoSTufez/oX/KvMYifPGEBPTB+Vv5GH8YJVkJeX9kPzEo/4zZk/fHJNhtQwn+x13BKNCIRdZyNCTW1NupROTgnD7mWevCRdFU3 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0ea227c6-5e6c-435f-56f6-08dd392b4ea0 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB7044.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jan 2025 08:20:32.3827 (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: 5i8Dg8RUge/1Thsi4OZrYyApCnO21gpkVzjn6/0kAdcxbbNK6rZkVc/yjxUzg4V+yiD5KzuIFIi2m6lYr4a8Mg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8933 The asrc_m2m_device_run() function is the main process function of converting, the error need to be returned to user, that user can handle error case properly. Fixes: 24a01710f627 ("ASoC: fsl_asrc_m2m: Add memory to memory function") Signed-off-by: Shengjiu Wang Reviewed-by: Daniel Baluta --- sound/soc/fsl/fsl_asrc_m2m.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sound/soc/fsl/fsl_asrc_m2m.c b/sound/soc/fsl/fsl_asrc_m2m.c index ab9033ccb01e..f46881f71e43 100644 --- a/sound/soc/fsl/fsl_asrc_m2m.c +++ b/sound/soc/fsl/fsl_asrc_m2m.c @@ -183,7 +183,7 @@ static int asrc_dmaconfig(struct fsl_asrc_pair *pair, } /* main function of converter */ -static void asrc_m2m_device_run(struct fsl_asrc_pair *pair, struct snd_compr_task_runtime *task) +static int asrc_m2m_device_run(struct fsl_asrc_pair *pair, struct snd_compr_task_runtime *task) { struct fsl_asrc *asrc = pair->asrc; struct device *dev = &asrc->pdev->dev; @@ -193,7 +193,7 @@ static void asrc_m2m_device_run(struct fsl_asrc_pair *pair, struct snd_compr_tas unsigned int out_dma_len; unsigned int width; u32 fifo_addr; - int ret; + int ret = 0; /* set ratio mod */ if (asrc->m2m_set_ratio_mod) { @@ -215,6 +215,7 @@ static void asrc_m2m_device_run(struct fsl_asrc_pair *pair, struct snd_compr_tas in_buf_len > ASRC_M2M_BUFFER_SIZE || in_buf_len % (width * pair->channels / 8)) { dev_err(dev, "out buffer size is error: [%d]\n", in_buf_len); + ret = -EINVAL; goto end; } @@ -245,6 +246,7 @@ static void asrc_m2m_device_run(struct fsl_asrc_pair *pair, struct snd_compr_tas } } else if (out_dma_len > ASRC_M2M_BUFFER_SIZE) { dev_err(dev, "cap buffer size error\n"); + ret = -EINVAL; goto end; } @@ -263,12 +265,14 @@ static void asrc_m2m_device_run(struct fsl_asrc_pair *pair, struct snd_compr_tas if (!wait_for_completion_interruptible_timeout(&pair->complete[IN], 10 * HZ)) { dev_err(dev, "out DMA task timeout\n"); + ret = -ETIMEDOUT; goto end; } if (out_dma_len > 0) { if (!wait_for_completion_interruptible_timeout(&pair->complete[OUT], 10 * HZ)) { dev_err(dev, "cap DMA task timeout\n"); + ret = -ETIMEDOUT; goto end; } } @@ -278,7 +282,7 @@ static void asrc_m2m_device_run(struct fsl_asrc_pair *pair, struct snd_compr_tas /* update payload length for capture */ task->output_size = out_dma_len; end: - return; + return ret; } static int fsl_asrc_m2m_comp_open(struct snd_compr_stream *stream) @@ -525,9 +529,7 @@ static int fsl_asrc_m2m_comp_task_start(struct snd_compr_stream *stream, struct snd_compr_runtime *runtime = stream->runtime; struct fsl_asrc_pair *pair = runtime->private_data; - asrc_m2m_device_run(pair, task); - - return 0; + return asrc_m2m_device_run(pair, task); } static int fsl_asrc_m2m_comp_task_stop(struct snd_compr_stream *stream,