From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 7E822263F5D; Sat, 12 Sep 2026 14:39:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789223998; cv=none; b=UtNCQcFV1pf66qydI+v4y0ZRGD4JM8CtMCxaj9H+rhq4uFvkBBML3HniwB7KhB10gjFLsMGZOjWd0DKxHYZcQenaGRcjlvnxvvqs318LHSLlL4VF/X2/5wV7oK3r3vgsH79szsNEQUNgdbqu0ts7yJDeirKKqTYS7VFzpiNbw+E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789223998; c=relaxed/simple; bh=9b/LISYql6Bjpbj0XQ4MAzi2u/hNwCWr/tJRipkg9Vk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fGBiDKaY2JtXDz6+tlegY4jWE4Fs0YG9qu9N8Lvqrmqg7IS00lSWkqCx2nL5pj1b3unQVRCMBU7JaDtk0W97T3oS1iz1p/6/sPhY9Iw8U0nk8zdTAphpHyyqDf6kodhqapNU/6rLR48pR2x9LSl8/ukaHJ0iol74YnWxXw9QVW8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ah03Q668; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ah03Q668" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9D94C1F000FF; Sat, 12 Sep 2026 14:39:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789223997; bh=sW/P1Q6a+byU2CM3jHw0fE7yBqFvbPRWv20hRNt98R0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ah03Q668iXkWKYGhw1IBVzfVyTIm67ViDi4M8Iaxa+9Y9Scjnih2uXnz0t8r0NS1E d4LDXaPyQydWc5nAETUXCnCx0lW/TQHeUMmbU75NIQrduEQOmnbaiBo7RNeem3KkTf ywTzhtwv0rLqc/iKr+/s0vSPu7M6W4r/xQ18q53k= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ijae Kim , Myeonghun Pak , Brian Masney , Sasha Levin Subject: [PATCH 6.6 0901/1424] clk: palmas: Manage external-control prepare with devm Date: Sat, 12 Sep 2026 08:55:33 +0200 Message-ID: <20260912065627.504358084@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065607.279695368@linuxfoundation.org> References: <20260912065607.279695368@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Myeonghun Pak [ Upstream commit ccda84fcbf3a972973f772384935928f41817b3a ] palmas_clks_init_configure() prepares the clock when an external control pin is configured. The current driver only drops that prepare reference when external control configuration fails. If provider registration fails after that point, or if the driver is later removed, the prepare reference remains held. Register a device-managed action after clk_prepare() succeeds. This balances the prepare reference on subsequent probe failure and driver removal. Fixes: 942d1d674931 ("clk: Add driver for Palmas clk32kg and clk32kgaudio clocks") Co-developed-by: Ijae Kim Signed-off-by: Ijae Kim Signed-off-by: Myeonghun Pak Reviewed-by: Brian Masney Signed-off-by: Brian Masney Signed-off-by: Sasha Levin --- drivers/clk/clk-palmas.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/clk/clk-palmas.c b/drivers/clk/clk-palmas.c index 5efb10776ae5f..42cfb8718ff0d 100644 --- a/drivers/clk/clk-palmas.c +++ b/drivers/clk/clk-palmas.c @@ -194,6 +194,13 @@ static void palmas_clks_get_clk_data(struct platform_device *pdev, cinfo->ext_control_pin = prop; } +static void palmas_clks_unprepare_ext_control(void *data) +{ + struct palmas_clock_info *cinfo = data; + + clk_unprepare(cinfo->hw.clk); +} + static int palmas_clks_init_configure(struct palmas_clock_info *cinfo) { int ret; @@ -214,13 +221,18 @@ static int palmas_clks_init_configure(struct palmas_clock_info *cinfo) return ret; } + ret = devm_add_action_or_reset(cinfo->dev, + palmas_clks_unprepare_ext_control, + cinfo); + if (ret) + return ret; + ret = palmas_ext_control_req_config(cinfo->palmas, cinfo->clk_desc->sleep_reqstr_id, cinfo->ext_control_pin, true); if (ret < 0) { dev_err(cinfo->dev, "Ext config for %s failed, %d\n", cinfo->clk_desc->clk_name, ret); - clk_unprepare(cinfo->hw.clk); return ret; } } -- 2.53.0