From patchwork Thu Sep 26 21:15:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?KO2VmeyDnSkg7J6l7J246recICjsu7Ttk6jthLDqs7XtlZnqs7wp?= X-Patchwork-Id: 832448 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8F0FCCE7D12 for ; Tue, 1 Oct 2024 12:39:27 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 943F4827; Tue, 1 Oct 2024 14:39:15 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 943F4827 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1727786365; bh=PqL3Pl6zhZE3g7J0nUEAS8V+gUiZy/QuIfE5rvizv98=; h=From:To:CC:Subject:Date:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=O1hqE7sAjWYGZfU/7HXYo3Ev43xNU1cOBgN+Ed74D4GXE28AQRHkxhMIfdj7xEL/S 280SBue2hpl24GcoXiVRu0pDFeTj/KqIb0D/y6NdBm1NOaUTX4i4A9yxyGV4iQDjRT ogvTbajvIeIAS8vx4iR5ymsm1wQRYVPl+wq/XZKY= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 114AEF8061D; Tue, 1 Oct 2024 14:36:17 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 9B665F80602; Tue, 1 Oct 2024 14:36:16 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 72AA1F802DB; Thu, 26 Sep 2024 23:15:30 +0200 (CEST) Received: from PUWP216CU001.outbound.protection.outlook.com (mail-koreasouthazlp170100001.outbound.protection.outlook.com [IPv6:2a01:111:f403:c410::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 4A8DAF80007 for ; Thu, 26 Sep 2024 23:15:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4A8DAF80007 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=unist.ac.kr header.i=@unist.ac.kr header.a=rsa-sha256 header.s=selector1 header.b=Pj01/eO2 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YAN6xesapLb367xtpbyNs+mOaskxVZS/NY2qmkYp3Qb5AbimrVRbtvc/vGoIS/XPVvE59qxqfM+hCOoVvp8r/jpaK1vNG8dB0TCzRsXRoYCQa12GQu5ry7eWvF+nbx15b92cBETFIx8aNnYxTh7+MkXIgn642eaxuc8Dq6oaD8dNnwSYn74pedqwqWTUe33582eocqVSS3f/0KorB9Pw4Wyr69BVYuUwyHJpwJTZ+ODAK8KrolEBn4x0M7coCXuvVpoxZOPnjVr+rm/nIPkCOnxhJ1RjtVdxivqnfxgnNLhuwReWfJPgU6Hznf2hq4yZ47H4mvBqURwSvZN4ymTl3Q== 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=PqL3Pl6zhZE3g7J0nUEAS8V+gUiZy/QuIfE5rvizv98=; b=Tkf/TcubMsHADgN/+FntFo/rrWN3fKEaVDAN8862yu2H0RqM4jpyUS5OXJdyndR+wM7EuH8CDzizRTPcGjCnlOTpD1I9xBOzyKFLQjpMm8wDJL3cLyc/IFxAkwe5UAMWetTp5oU9J5KMlQs8g/s5ADBUpwG67XyUPH6cXouVRhPv4oL3+4RH14avgr/YhFE8nBrmsxOLvlUkKdj69y+COQiLAtSYfmzc7YnfUJLdqfgzVK2v/qIvgpWDUsh7oto4qf7auwVFAJS37yzNcM/qjC6z1IAnPihJkluJSS8R906u5eDTVjlA/PI3anlS5RHgKMao0cbHluuT3gjyMp62DQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=unist.ac.kr; dmarc=pass action=none header.from=unist.ac.kr; dkim=pass header.d=unist.ac.kr; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unist.ac.kr; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PqL3Pl6zhZE3g7J0nUEAS8V+gUiZy/QuIfE5rvizv98=; b=Pj01/eO2DBL0uCIVbGVQ+O1iRKCG1kne3yti02Om/JA6BO4E2bF+y4bgAWM44maD/PtaWSU8enqLxqQalKE2sRtOaZgrn6gu50rQKujz9kghtyeYQDEycMEBwmkh1rErrqDehRG01pQQs99t8GMWA1oFGD4rrLTBR9rYZEH5s9I= Received: from SE1P216MB2287.KORP216.PROD.OUTLOOK.COM (2603:1096:101:15d::5) by SL2P216MB2865.KORP216.PROD.OUTLOOK.COM (2603:1096:101:285::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.22; Thu, 26 Sep 2024 21:15:19 +0000 Received: from SE1P216MB2287.KORP216.PROD.OUTLOOK.COM ([fe80::abfa:51df:7a24:2f06]) by SE1P216MB2287.KORP216.PROD.OUTLOOK.COM ([fe80::abfa:51df:7a24:2f06%4]) with mapi id 15.20.8005.020; Thu, 26 Sep 2024 21:15:18 +0000 From: =?ks_c_5601-1987?b?KMfQu/0pIMDlwM6x1CAoxMTHu8XNsPjH0LD6KQ==?= To: "perex@perex.cz" , "tiwai@suse.com" , "hayashi.kunihiko@socionext.com" , "mhiramat@kernel.org" CC: "lgirdwood@gmail.com" , "broonie@kernel.org" , "alsa-devel@alsa-project.org" , "linux-sound@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH] sound: soc: uniphier: Handle regmap_write errors in aio_src_set_param() Thread-Topic: [PATCH] sound: soc: uniphier: Handle regmap_write errors in aio_src_set_param() Thread-Index: AdsQWOQVzV45oQfQS/+H6footqgKlQ== Date: Thu, 26 Sep 2024 21:15:18 +0000 Message-ID: Accept-Language: ko-KR, en-US Content-Language: ko-KR X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=unist.ac.kr; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SE1P216MB2287:EE_|SL2P216MB2865:EE_ x-ms-office365-filtering-correlation-id: a6f8526d-6383-4f06-8341-08dcde7052ef x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|7416014|376014|1800799024|366016|41320700013|38070700018; x-microsoft-antispam-message-info: =?ks_c_5601-1987?q?8afefoEMP1+qmC3YOA4OSO?= =?ks_c_5601-1987?q?31BjkCD0NbH39OVxrUVTbdo17V8oNslsHZPU81owwu6FLWHH35vxP9cW?= =?ks_c_5601-1987?q?nT55uSxNK194gRQ5yb0k0TVf4ahUdzXA4K7HlFE0a8toDpMCc+5ADmFK?= =?ks_c_5601-1987?q?HMldraEpAIM8fWNjynir5OPBQvy4Dwl1fpjim5fw+3aA4gqqoGI0vi3c?= =?ks_c_5601-1987?q?Psb3YxUn+vPzh7mpqIDAUaD4xmJZITMZHBDT1gsyhfR2i1Vp0fEZMWvK?= =?ks_c_5601-1987?q?5YccfLBH8QMSOZg15HRYRsjF6F9ywfoliG1ej3hK/NpSMTpvn4g4Y4uB?= =?ks_c_5601-1987?q?64KObc3k3TiQOdsZIg/k85qY/7X7uD27fZx1+9hbH/F1iE2g5EEzy960?= =?ks_c_5601-1987?q?GhOnWVoOhJP8xbIfQ368KaeH5/Nxa6DCeEfyHLYqzr+ayBOQMz7iG7Bk?= =?ks_c_5601-1987?q?JDMXhxWDwo0ciedE0WigbETwenxAq+yQ34K1kpzBHMiYDdNZC37wzAX8?= =?ks_c_5601-1987?q?aCG70sYrwp6kNPmGGcoCM5HnOBXyHVMiTYgHZ0enQ5sJMmc5aHmniqX0?= =?ks_c_5601-1987?q?//5h1/9mz6nNBzgiC8+8TBqQQRqz3kh6/n9LofJOhv3SqVZT5us8AV7t?= =?ks_c_5601-1987?q?J63Bd/hk0KYVD6A/8KaacvG9KFp85+WovFHEEWTJ7rChq4AQdReBzdls?= =?ks_c_5601-1987?q?eUyRms+hY5aiJySXRx1/iKNtbpoeOEht3KZsFUCX9Vce0e/jSGxVBthE?= =?ks_c_5601-1987?q?hqwjO7s7NLKTme/VHG35JVNhUTg0feyPg4YxelWyxSR2e0DJWsk4SHKH?= =?ks_c_5601-1987?q?z/5U/ApNnYwkYGWHBdwO50lRWGhcb4XVy3VbSIXuADfIYxbPo3mNTyiN?= =?ks_c_5601-1987?q?ib17bRJySTLBmslvpPkgf2cU66X6ZBdwl17wziJz/2DIBNGVxo7k0O78?= =?ks_c_5601-1987?q?bWfjuYbENeRwgj0m6cpZs7DfUgFaDMX95D2RXGJt+P4V91Ew99mibMUJ?= =?ks_c_5601-1987?q?Q59k4AouO3wC2FYC1W/1QDP8vgABNf7LyOVTrKLHDIVaeJWlshfRCvO+?= =?ks_c_5601-1987?q?mIhiuPCHYnid0unl7HoNYBvIX3CAKF2k7pJip/uL4yQafCus3/t/Y/o8?= =?ks_c_5601-1987?q?cE78NOksdLQL3P6myP191+sl2XrbY83IGxIVtlwhVrlY3WYhRKcrgEKT?= =?ks_c_5601-1987?q?nvF3aldF0RWCFTtTsh3voHm2wpqNWKMrS5YBesfxWTr0RnNYGdMK75Xe?= =?ks_c_5601-1987?q?XzGKMCeHrSZ+IVvWWtosmUehr1D/bH3T9U6SSzINuKIl0+M3rhph6FaR?= =?ks_c_5601-1987?q?f3XdRMCArv1TBpF3EI4Ck184IvAnb+Q+e5Qre3qN+6Hu+4Ez08caMZIa?= =?ks_c_5601-1987?q?cUeM/qQx+pybDlCk0WPV+AUJoTjfE/pK7A3Zq/tqt2RbV+TPgj+xSKQZ?= =?ks_c_5601-1987?q?/O9GEd5JIvvGRmu8yMouD2w7UhDJ40kiRJpfmB9sizBfRSYFMLAanxMA?= =?ks_c_5601-1987?q?=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:ko; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SE1P216MB2287.KORP216.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230040)(7416014)(376014)(1800799024)(366016)(41320700013)(38070700018); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?ks_c_5601-1987?q?fxE3g4H4IJShGE5O7P5?= =?ks_c_5601-1987?q?cy5HXz5p6dsactSn/7G7o31OJvB9PXqvvdCOI6n81haUgK0G93dCnP0T?= =?ks_c_5601-1987?q?pMQsFOWERsF+Ca/6Uhk4UXohmZj1qaI3A6WGXpz8iewMLIe1rzpHy1mW?= =?ks_c_5601-1987?q?MpmZ0g56At3MWLmM3CPkE6jUplwZRqlRI8Zd+Kg6Gty/iO5ROxa8V/OU?= =?ks_c_5601-1987?q?s1s5HFt7TjddYAPrNqV+rMMnZvMYfSDLbT289RspJtaWklZ00Wm/LavP?= =?ks_c_5601-1987?q?Ui5vNT8t4ZqXXDfmua+JOFjyZZlAkssO2UKzkBhuJAV6sOrBZJfz4oHN?= =?ks_c_5601-1987?q?9fE7qVT7p9By7qhHrSTnWT8laMrXQnV9HcKF1lpGJeLAnln9qW709vZE?= =?ks_c_5601-1987?q?x34ssXbvlQ6c+Wq7wNjoCBE9iWNtVirpx+pdToEbe55E3qaSRrWY8qLA?= =?ks_c_5601-1987?q?lXyBFGq3/Lftm9b8SP2lX3tWuEbypXBhLlcr7pug/Rtctt/Ujb4vqkpG?= =?ks_c_5601-1987?q?I7mG+TgozEQeO1v21RtGwD/keARlD5uy5dXTCCXtdsPmk/6zItmA6AwO?= =?ks_c_5601-1987?q?nCNaCfPHs/OCWYJ5Tsalj9ALsOoca6Q8FUN/9D8CjM7Gnk1i+Xm1zCsg?= =?ks_c_5601-1987?q?2BgN+5XQQt8xtugXi8c7w+v+/2KJFASlTrdGnPOu+CHmx9+81lePBck5?= =?ks_c_5601-1987?q?z87wwcvJlSP9cnJ3FzdZGUCLwt9JHIpfv8dmuuNR/oRVllRRoEadT8EA?= =?ks_c_5601-1987?q?DC6zr1GrX8Q71vD7rL8uEpAoWVQOa0C1xlMRqVOk8Y074UzgVDglEVsq?= =?ks_c_5601-1987?q?np8bCLF1ZLfbpYkIUS/Q17k50xLvxFUYfTv+4/vgCFOqRpP+GafFueIi?= =?ks_c_5601-1987?q?u3XFpCIrYkWhX8lAw/4p9DFJjNMR1qoxVCO3T+rigb/U4OLJfoKGMP/D?= =?ks_c_5601-1987?q?pI/+BQeBYeFQ0YUA9vU3a2/G90blXSoPeRvG1gbNL3kV7x6MQfk7skN6?= =?ks_c_5601-1987?q?Ut9DFp0MuFD6ayB5+e0uIPwz02L6D0HeAH+EVYTP4UJn3XYp4A/fWZTi?= =?ks_c_5601-1987?q?7ZDrYB9hKp9NeEQs7796o2+9u8xs2k2Vo360PN5ztKvHwJDYS4EUXu26?= =?ks_c_5601-1987?q?iTYlAnY1kxdVujroXDU9GwB9midD1Vvu6amLBQn/CghoUMIjZKBrcms2?= =?ks_c_5601-1987?q?n3m9FDVFBVDrFn8Ulj+GFtgmU1SrOUTFLGiQrHoK+9vjGA1g/trxoMUC?= =?ks_c_5601-1987?q?PNyFBWcizNY6IBPnO6fyVzsOFEDYHcunm7q6KcVeL1n6brbkt+ik98x6?= =?ks_c_5601-1987?q?wgQjNae8BI+WNtqOBK7nY/2iFRUzLjWG7ojZsBPQAGjLhL7O6DpxSgD2?= =?ks_c_5601-1987?q?tjdTgBPPz1WE/yoaG+i1FD3Bd6oz1murNl0qPShia6FdCdCI73jGXOnH?= =?ks_c_5601-1987?q?SLyXHAyutuh3n72WM2lsSGquEHfSD6AuELjzi8bK0ouDgbDxIvM/6da3?= =?ks_c_5601-1987?q?bHgMkeOvLa6rDvIVTX4GXYE5i8mjb6fJCm7mRUMRLonuPQVZV+Vfxnul?= =?ks_c_5601-1987?q?3ZuKOda93TTV384MumQx8ykud7lVyNx0WNUXGGb8Y8wNMjGWfIS1IJBS?= =?ks_c_5601-1987?q?EHbk6lvHWs8U3JR3wX6jhmlemhP0lcjXX8ow2Hzv48kjtc4IZiSc40Xs?= =?ks_c_5601-1987?q?BX32Tvkq/UtFxl17s4ozMPd/93fJXzvo5qRz3tfEz228/1Ef6aMGMicE?= =?ks_c_5601-1987?q?EXdfQwA2lrmoR?= MIME-Version: 1.0 X-OriginatorOrg: unist.ac.kr X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SE1P216MB2287.KORP216.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: a6f8526d-6383-4f06-8341-08dcde7052ef X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Sep 2024 21:15:18.8570 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: e8715ec0-6179-432a-a864-54ea4008adc2 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 7hL+BCz4xFeSE6w1QzKN74FaiuhsJEJalpudvbJsknByHCI+knSa2q7kFsjSs+dbnVm/uZDUWzCAbnKIYwKikg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SL2P216MB2865 X-MailFrom: ingyujang25@unist.ac.kr X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 Message-ID-Hash: AGMYKUWKNWUY3ZV44XDTDS2IIVTUYKYA X-Message-ID-Hash: AGMYKUWKNWUY3ZV44XDTDS2IIVTUYKYA X-Mailman-Approved-At: Tue, 01 Oct 2024 12:36:09 +0000 X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: >From 791716bf359b8540c519810848fd1f8006d7c3c5 Mon Sep 17 00:00:00 2001 From: Ingyu Jang Date: Thu, 26 Sep 2024 19:40:04 +0900 Subject: [PATCH] sound: soc: uniphier: Handle regmap_write errors in aio_src_set_param() The aio_src_set_param() function did not previously check the return values of regmap_write() and regmap_update_bits(). If these functions fail, it could lead to silent failures when configuring the sample rate converter (SRC), causing improper behavior in audio processing without any indication of an error. This patch modifies aio_src_set_param to check the return values of regmap_write() and regmap_update_bits(). If either function returns an error, the error code is propagated back to the caller to ensure proper error handling. This change aligns with the existing error-handling behavior in functions like uniphier_aio_prepare(), where a failure in a sub-function should result in an immediate return of the error. Signed-off-by: Ingyu Jang --- sound/soc/uniphier/aio-core.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/sound/soc/uniphier/aio-core.c b/sound/soc/uniphier/aio-core.c index 0eba60758134..2c4e8b873253 100644 --- a/sound/soc/uniphier/aio-core.c +++ b/sound/soc/uniphier/aio-core.c @@ -921,16 +921,19 @@ int aio_src_set_param(struct uniphier_aio_sub *sub, { struct regmap *r = sub->aio->chip->regmap; u32 v; + int ret; if (sub->swm->dir != PORT_DIR_OUTPUT) return 0; - regmap_write(r, OPORTMXSRC1CTR(sub->swm->oport.map), + ret = regmap_write(r, OPORTMXSRC1CTR(sub->swm->oport.map), OPORTMXSRC1CTR_THMODE_SRC | OPORTMXSRC1CTR_SRCPATH_CALC | OPORTMXSRC1CTR_SYNC_ASYNC | OPORTMXSRC1CTR_FSIIPSEL_INNER | OPORTMXSRC1CTR_FSISEL_ACLK); + if (ret) + return ret; switch (params_rate(params)) { default: @@ -951,12 +954,18 @@ int aio_src_set_param(struct uniphier_aio_sub *sub, break; } - regmap_write(r, OPORTMXRATE_I(sub->swm->oport.map), + + ret = regmap_write(r, OPORTMXRATE_I(sub->swm->oport.map), v | OPORTMXRATE_I_ACLKSRC_APLL | OPORTMXRATE_I_LRCKSTP_STOP); - regmap_update_bits(r, OPORTMXRATE_I(sub->swm->oport.map), + if (ret) + return ret; + + ret = regmap_update_bits(r, OPORTMXRATE_I(sub->swm->oport.map), OPORTMXRATE_I_LRCKSTP_MASK, OPORTMXRATE_I_LRCKSTP_START); + if (ret) + return ret; return 0; }