From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=220.130.44.152 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796175367; b=nSEaUXz2LuwwaFNwzGrV/HpcNA+pWuwlqb7C0R7xKtaVeF7WGMmsA0nYW3nFzz/Zfo2x FhLwrAFWAwiJPMSwN/2nwDFo3SwLgm26lui/JBccbyhUTe5atOlGdxk3uKDELAbE0p8NL FMNT87vJRRBW+QJxaJTazRgaeP6iy+PRlEp4oZC2JHDXdmVsrYFXQfCUErAIsmXlrr4IR pp9o9s4S0aAR8urrYkhpEAQbD6x68/3zWt0WYhWH5qqUlPpgNREfbMhIOy7yUqhRmMXe1 43d992NqiLM2MHPt4zErg85uR4DWH+aBWowGBnQFn8z2V5qcieAGg439rDAV6LJqtRQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796175367; h=DMARC-Filter:X-MailGates:DKIM-Signature:Received:Received:Received: Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; bh=ZEEMshD+PyhI+qUSG7mQI/BoKcVNpeFmGa8DutnH1sc=; b=XL0dcL4VCezmdNFjb6emfBCkUjPjPYADcTTzZgMLalcFWyNBY0DBu6qDTChl8fXAq3A/ +v5bLgCnjDHPk1FxasLTc/hDqYK2LgxIIW+qljO06jTVbsfavdQk3HXiDSHtLeg0+jaTb GqGV5twU5fH7KQvIqKFyzwYKQsYGaHv9GXNXdtkxJZ4BK9Ag0mWHNzV0CWDgMnPVLbEsR zmXuxQYEVI07tI9cBx30qPwYGdS8pP2cgG8Pefm85Tyu4taqouWE/xNDrvFOFEp/gwgbg SyoYprqe1+FK4gSSTUL92WPRGVlR2NP5J+2VCscz7NYyrn8M8rKgaGn8P7639Qj7w7g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=richtek.com; spf=pass smtp.mailfrom=richtek.com; dkim=pass header.d=richtek.com header.i=@richtek.com header.a=rsa-sha256 header.s=richtek header.b=LReWK+UL; arc=none smtp.remote-ip=220.130.44.152 Received: from mg.richtek.com (mg.richtek.com [220.130.44.152]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 62FA0606A31A; Wed, 2 Dec 2026 01:36:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 62FA0606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=richtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=richtek.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=richtek.com header.i=@richtek.com header.a=rsa-sha256 header.s=richtek header.b=LReWK+UL X-MailGates: (SIP:2,PASS,NONE)(compute_score:DELIVER,40,3) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=richtek.com; s=richtek; t=1796175362; bh=ZEEMshD+PyhI+qUSG7mQI/BoKcVNpeFmGa8DutnH1sc=; l=1972; h=Date:From:To:Subject:Message-ID:MIME-Version; b=LReWK+ULRH0vuVl+4B/3WmM8faLmK/KdsCDCqoF6xBFm8gevoRGqj7tbwmR5rLwLn YAKxlZ3+stFviIS7vjI612aCk0aTLU4BHXc0rxZfCtuXdT4y86XG6zp8dnfQiekPAH 3ysyfOYNbWk8E9rppYebrPybx12ev9hvrCiouw49B1PboejmQBevyZ2hVNHeonRLvC VfmPOW7PPpLyAt2LItdWlwIJ2kSVJhJY/noT6uv8qHKfGJlbadPHfyJnpSP3HGfEpc hKXNFuhqxVZHkXm79szqCJmS3fBIXI1vE4exd3qp4QWwBn6HTjXxeWkrn23BdTKwMP zTRHu4uQm/d4Q== Received: from 192.168.10.47 by mg.richtek.com with MailGates ESMTPS Server V6.0(2325276:0:AUTH_RELAY) (envelope-from ) (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256/256); Wed, 02 Dec 2026 09:31:57 +0800 (CST) Received: from ex6.rt.l (192.168.10.47) by ex6.rt.l (192.168.10.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.53; Wed, 2 Dec 2026 09:31:57 +0800 Received: from git-send.richtek.com (192.168.10.154) by ex6.rt.l (192.168.10.45) with Microsoft SMTP Server id 15.2.2562.53 via Frontend Transport; Wed, 2 Dec 2026 09:31:57 +0800 Date: Wed, 2 Dec 2026 09:31:57 +0800 From: ChiYuan Huang To: CC: David Rhodes , Richard Fitzgerald , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Charles Keepax , Zhang Yi , Oder Chiou , Srinivas Kandagatla , , , Subject: Re: [PATCH 5/6] ASoC: codecs: rtq9128: Drop runtime PM reference on probe errors Message-ID: References: <20261201-s2p-asoc-rpm-v1-0-477189293ad4@mbzuai.ac.ae> <20261201-s2p-asoc-rpm-v1-5-477189293ad4@mbzuai.ac.ae> X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20261201-s2p-asoc-rpm-v1-5-477189293ad4@mbzuai.ac.ae> On Tue, Dec 01, 2026 at 11:07:04PM +0400, Arina Kharlamova via B4 Relay wrote: > From: Arina Kharlamova > > rtq9128_component_probe() takes a runtime PM reference with > pm_runtime_resume_and_get() and then writes the init table and, for > RTQ9154, the AUTO ULQM register. If one of these > snd_soc_component_write() calls fails, the function returns without > calling pm_runtime_put(). The usage count stays raised and the device > cannot runtime suspend. > > Leave through a common exit that drops the reference on these error > paths as well. > > Fixes: 736064c64cf3 ("ASoC: codecs: Add Richtek rtq9128 audio amplifier support") > Fixes: 6be9ea62afed ("ASoC: codecs: rtq9128: Add compatible changes for rtq9154") > Signed-off-by: Arina Kharlamova Reviewed-by: ChiYuan Huang ChiYuan > --- > sound/soc/codecs/rtq9128.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/sound/soc/codecs/rtq9128.c b/sound/soc/codecs/rtq9128.c > index a6d4a81ff181..8635ccba39a5 100644 > --- a/sound/soc/codecs/rtq9128.c > +++ b/sound/soc/codecs/rtq9128.c > @@ -484,7 +484,7 @@ static int rtq9128_component_probe(struct snd_soc_component *comp) > for (i = 0, curr = table; i < table_size; i++, curr++) { > ret = snd_soc_component_write(comp, curr->reg, curr->val); > if (ret < 0) > - return ret; > + goto out_put; > } > > > @@ -492,13 +492,14 @@ static int rtq9128_component_probe(struct snd_soc_component *comp) > /* Enable RTQ9154 Specific AUTO ULQM feature */ > ret = snd_soc_component_write(comp, RTQ9154_REG_AUTOULQM, RTQ9154_AUTOULQM_VAL); > if (ret < 0) > - return ret; > + goto out_put; > } > > +out_put: > pm_runtime_mark_last_busy(comp->dev); > pm_runtime_put(comp->dev); > > - return 0; > + return ret; > } > > static const struct snd_soc_component_driver rtq9128_comp_driver = { > > -- > Git-157) > >