From patchwork Thu Sep 26 20:58:19 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: 13813643 Received: from SEVP216CU002.outbound.protection.outlook.com (mail-koreacentralazon11022131.outbound.protection.outlook.com [40.107.43.131]) (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 A09C2282FA; Thu, 26 Sep 2024 20:58:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.43.131 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727384305; cv=fail; b=UXt4dKCE3upzyXKVDXs8+fx197xXV3yDyHs0WxGA+YHPIFMApBQvP3QRA7c3OukqVWgqot5QEypO+X0yu667giN0v/6mcx1jXaRkgeAlUFMcsOOn5kZmBvRsryYtxIcFLaaZApmEq7YvoEL/TJa6palVb6Dh8D5YFlS0R77FngM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727384305; c=relaxed/simple; bh=PqL3Pl6zhZE3g7J0nUEAS8V+gUiZy/QuIfE5rvizv98=; h=From:To:CC:Subject:Date:Message-ID:Content-Type:MIME-Version; b=drG9Dwj++qrMCsWu7GddHifN4axXENgHN1JwoEI6N1Esu1ywTofnFeemCeTdkWeEa54iDBcCb+oaXN81SL0Yp3jKb3h8Z6ffjj7hOm3oqb1O0y49xV0TWs3YHQdTvlsoUpxyLuvu4r5/lUaB3JmbLWcIb6CVnzGcs8VTii6Mq00= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=unist.ac.kr; spf=pass smtp.mailfrom=unist.ac.kr; dkim=pass (1024-bit key) header.d=unist.ac.kr header.i=@unist.ac.kr header.b=W7/Z2TXn; arc=fail smtp.client-ip=40.107.43.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=unist.ac.kr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=unist.ac.kr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=unist.ac.kr header.i=@unist.ac.kr header.b="W7/Z2TXn" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=nL8jj6xc1Uw2ZoyW6QiwiXEYEtF1eYKnrxXdZlxtKtXUAHlNdjsNwViwyqisEVpHx3o42RBksG2MkayZsawUSyPtVPW37wIGs4fuKPQjbG+JbzbOasdxQvYsLQXa9F9mrLpzPAGiM3Zicnr8eT51yAEkN4VGKgf6ooOzJjd5k/LqVBkZVyLZ1xKAkJhlRxJWNy7aZDs5k+6WsBKCQZ8513XdzNSup0esB8gLqb06rjk8oPkB9jXO7i1Ja/p1wuF4CRUKoZhrxIAjLhQX4Pliwy4LwzMbAenBFSqhy7mKnhyqtoblwW36KDTG+Tb4quxNflQRHbxa2TSCR1aH73OaAQ== 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=pjvK6ZI/AZYXcRBAfZlwweGeul6Vl71cbqXuqJXOfiUclKaziNNCjCMqWxFWIldf/ogb4VuSy16uNxe78+ou1R/lCS3oQbEIG3tsH9cn9bvdE8/lWzfPXI/EiYNnZOFYD4gpmzOskCl2V/FJ8ojE2bBmow8+ItOpkucGoXio0BeMUnWpWvnGJWBykYW4uzGIpSaGZt1GF1w2CPYYTc8LlUZXyEP6zWu+0knkDhR9zZfDYHN7FFWURzKr+oQrepUQPLh6Hx2fxA/v+/cmtTAoN92cKDMbT91mj/nt5vX3smseOprKhy/rgwAkyhdg+MQDHHqF4tfobdt4fLwX5SyeRA== 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=W7/Z2TXnUxp+UPz3+Veq/yGW0utIpgaJ3fJqLx4x7kfp+JAPvuFCwn4uRUCOHkESziLxkLl28TGju9fyVJ2Jtss0OSErvXdIhL73OsGtE5SIENTmcmUf39JryY8zqqDnXGvOMYpebPdVdti3e41/Rw1eDfBw/cZ8b2wNz1O++WY= Received: from SE1P216MB2287.KORP216.PROD.OUTLOOK.COM (2603:1096:101:15d::5) by SE1P216MB1242.KORP216.PROD.OUTLOOK.COM (2603:1096:101:16::12) 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 20:58: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 20:58:19 +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: sound: soc: uniphier: Handle regmap_write errors in aio_src_set_param() Thread-Topic: sound: soc: uniphier: Handle regmap_write errors in aio_src_set_param() Thread-Index: AdsQU4oY8jiNqSUtTyyPxLSWA+I9ig== Date: Thu, 26 Sep 2024 20:58:19 +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_|SE1P216MB1242:EE_ x-ms-office365-filtering-correlation-id: 8620dfed-f9da-4812-2249-08dcde6df347 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|376014|1800799024|41320700013|366016|7416014|38070700018; x-microsoft-antispam-message-info: =?ks_c_5601-1987?q?q/UgNg+ekEOm7rmLtUsXLE?= =?ks_c_5601-1987?q?l5YL32VA73zpf3cdVjQAk9F0e6HeJPvGNQpvNBwoS2EuIOQZv5XLZ+rD?= =?ks_c_5601-1987?q?JwPv1km352UAleUze4XOJ1TQC87GoBrW4fPLfyF0EJK23XyH1Z0B0Jw+?= =?ks_c_5601-1987?q?76AKReqVWxyqu3ibV/3/YMkER5Q+CjoGbC4SjpvlXImyww4inhPh5Snh?= =?ks_c_5601-1987?q?QW1/qFSwRyyqAniCD7GpROv21E+DUMln9WbDHFadmLHVZKq59PEGUZKS?= =?ks_c_5601-1987?q?44Z39ppjsZWIMgEYIQ5lN8bFEjMSGsHyvjG3451/ePQWCJWcr3hxw75f?= =?ks_c_5601-1987?q?Rr9CWZZhDdetqPwUzyz7MqurTziKwU2C1BaGVIHIhJ5S89TDb2Bdkrq8?= =?ks_c_5601-1987?q?/ufB97NfKo+8le26gOjRonc2l1/fSEjZLoYUIT+NdJgsrkcmZFjzmdf+?= =?ks_c_5601-1987?q?3Yt05stp4gefArf4R1vafLV6V/dI/sRNk1lLiLfc+1LP0a07dCDni9mk?= =?ks_c_5601-1987?q?7JdO5oqxLAZ+aIsLVCydcUQEzMhNjISbuWkh4BD+byYAKdEEcmNJToEl?= =?ks_c_5601-1987?q?wpjQviUbwdciOvAl85T3YdAjGDsW1mmXFDCYEc4BGyUuIdJPZnIuhaD5?= =?ks_c_5601-1987?q?uWaTsC5yUfWaoVtjKAA5h/pCT6vTPUH/+nVACcyLWKIFl7+kkkLGKdCS?= =?ks_c_5601-1987?q?rHVj7JbV7QlDri10AchgXPXriXB6we28uldC/qde4COhZichkiYRw8Az?= =?ks_c_5601-1987?q?uX8ewdl2rrVoiG+SEc59aSqiUVALFbWlVYMhQuT6m6c/D29vakwvdO0v?= =?ks_c_5601-1987?q?DZiv/YXxxbU+gLS9y/b+Io9+9p9fHaxXE6+idAFwEFVjn6emJQkCd/+O?= =?ks_c_5601-1987?q?2RKokw497u17nxHLrU7Ifa8iaw4Z9wP0bXzGJm5yc3cR8x3gSr7PFb7r?= =?ks_c_5601-1987?q?vF/v6aRpHllewAieMv0Z/kSaW8gqmrfivlhClVQsUCAxVPWVfg4M5ZOh?= =?ks_c_5601-1987?q?vCASm0qlLb2/kacZuVs0bHXucHNjUhBWFnv+WyqjY+I2e1cyV9w5S055?= =?ks_c_5601-1987?q?bmaD9Z19qbun0uFKg34HaI9ZnIAEW3W4hQGy+pSfkCrS58MHXl2b5D0C?= =?ks_c_5601-1987?q?/U8GEXZUA7f4V/XykVNgt7JMx9kValb4V2k1IhtxR9fZAwj8GIpst2wX?= =?ks_c_5601-1987?q?atILqUtjYMu1OFronVaZGFYpvMRQMpFn4elkfqi8kL2X9rPzP7V35Twn?= =?ks_c_5601-1987?q?k9wHHeiQMnL61Z3jLbTgPAOT8EzASPrM9ZsKRaxqDxN8qkNmihUvOLv/?= =?ks_c_5601-1987?q?8tl8vklOMnm54wKROE13LfdpiJbxtdxnuHbehCxOEIadUeSzy/Q66C/P?= =?ks_c_5601-1987?q?iRXwRRuK7CSaQ8PJ9qcYRgVgZH5dfAkUL9CXwcIFh2IaZIBQuTF0Lp1F?= =?ks_c_5601-1987?q?q1xAtoKT+drYASOHiq6h1RXksirITPaSGFywD56j6yhHl5toLcu7U4nU?= =?ks_c_5601-1987?q?RxQ43cMUBikoOAMbxXWJaPm5r+g1fhMPLPak4B+jE+4cHpvSUwvTxTxw?= =?ks_c_5601-1987?q?cI37AyrA=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)(376014)(1800799024)(41320700013)(366016)(7416014)(38070700018);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?ks_c_5601-1987?q?1BSaeexk9E/Qvd1sjC5?= =?ks_c_5601-1987?q?3IE7ik7qmYpFk+2fUgHPd356+Lh2Dj55Oli/Ypm4jNqHDP5Sq15TAFxz?= =?ks_c_5601-1987?q?z4mMFldcCtM5VDvxumwyK57FNtHI5+Xm2wB63Jc2IDlMttF+DVfNp/5S?= =?ks_c_5601-1987?q?/ucgWUQreh8d38BifErnTq8w1eF9Vqz6Cib3EyrHwn8HG7/KreuyCZc0?= =?ks_c_5601-1987?q?MG4zvoiEcL46RMg4UrlFr4VcmZRz8uHwlB4Cmq5UMCjLBim9ZogekrmN?= =?ks_c_5601-1987?q?8j0krkRmBd6CxhIdpdEwkHaiCixAbEJW6dvtF4x+IFdp1TYWemyAqjqI?= =?ks_c_5601-1987?q?teWpu2m/RLn+Buj9Up9Mr58SknFJB3hxZCo5941GOieHfu6FDo0HrGOU?= =?ks_c_5601-1987?q?itm3d6bJzpqHt0RmlyTyfgOF14EA+KnWQo0yQELrROR0EWHDBEA/ABJO?= =?ks_c_5601-1987?q?wHjnNln8CsghzaHhncq79XcW42Db5HqUytvsK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-1987?q?4K6LQhLfcOnI7AQBxkjROzAH5tJfkPW/E9XJbGFE4ORrf8dF3AGwnYKs?= =?ks_c_5601-1987?q?uK527WesLRmwyxy8FGWql5uLsQlyTo6WbZFoJhU84asB4FDHGLTvSAa7?= =?ks_c_5601-1987?q?ScoaN6I1/q5QA+CoU8IcF3ZsoAoA7HbkiX5D4/IIcRGD8o/NQv/MSOZn?= =?ks_c_5601-1987?q?avWdDDkQj2rrb1eW3hVZ5daASB8BjuUHj1MPgKmqjcmqq8o5DuGpvFWM?= =?ks_c_5601-1987?q?xfcAHHObyytJMZpxOKHTVyUrTCOU+sGvwplKU2zolPcXFfTQxczKdESB?= =?ks_c_5601-1987?q?QTjywRaGJEbxfxxnAWKE36HmlotiYaj792dQocjtH0dt40/6KfiGDbsY?= =?ks_c_5601-1987?q?Ksam5b1DIfalp?= Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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: 8620dfed-f9da-4812-2249-08dcde6df347 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Sep 2024 20:58:19.3768 (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: Xxqc9Y6RqAFlcOqUFSL1levAA8q0wppTZxra7wxAPia+LIPjDnUQBBH8zYRTgk8Jj3/BitJnSunjPFiRoscEAA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SE1P216MB1242 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; }