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 CB7824F55A5; Wed, 9 Sep 2026 13:53:38 +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=1788962019; cv=none; b=RAk2u8e53HRTqWSkdk+xVCy7SI8duzQYU/L0mDFcgZgz5tsw1PVEhI66qftehFyexfK/6zPvXR+XEGw7SLAV/R8SIKG1dkk/p1WpbrkSBt/597HSElPgGOzB3UvNjXpa/MiPKACX2iCl9sif8TVBbsJ63Nf7+KhPELFYPTjYZq4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788962019; c=relaxed/simple; bh=LfbGzd8tdU+UHl1xANQwm7nHKBswgPSlDgz0L6OAVRg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gPsU2W10FmsVdNCKEL/9dCxpSiRQaIhq9j+dk5MfzcUPlwjRP5ZOboVRe0i4nZWWX2XsofdeY/3Vhp7ePUqQneiq8p6WVZzCsWpYZUybXAWiV8dZsKdU2EMe/n5iXRus2fMPnK4Hya2VogTmAwuL9hBTgwIxB7I1ZSf8CxI1894= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=lrcLhmAF; 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="lrcLhmAF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EDFED1F00A3A; Wed, 9 Sep 2026 13:53:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1788962018; bh=Mpn3bWLtSsu83R08/k+T24Uc71yafR46XH13x19n92U=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=lrcLhmAFO1qIL4wv6azlrrCGnMbwW4EkvET5P7NWCqB0JQCKAEgk0O9aZRfqBh8A4 MbEZGCdUyAsJT7diC+Lf/L84CoReI9FUwjnzg78tjgpI+ErcahnvrqKRobQxqQwhrH KASvi6JXOJ/BGNx74hrD5lYmVh8seUaapcvlZ+5Y= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Guangshuo Li , Vladimir Zapolskiy , Loic Poulain , Andi Shyti Subject: [PATCH 7.2 145/556] i2c: qcom-cci: fix autosuspend cleanup Date: Wed, 9 Sep 2026 15:37:05 +0200 Message-ID: <20260909134235.547203129@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260909134230.441546314@linuxfoundation.org> References: <20260909134230.441546314@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.2-stable review patch. If anyone has any objections, please let me know. ------------------ From: Guangshuo Li commit f98d4986482151a835b521a734722fe8dc5ca37d upstream. cci_probe() calls pm_runtime_use_autosuspend(), but the remove path does not call the matching pm_runtime_dont_use_autosuspend() before disabling runtime PM. If the autosuspend delay is set to a negative value while autosuspend is enabled, the runtime PM core increments usage_count to prevent runtime suspend. Without undoing the autosuspend setting during teardown, this reference is not dropped and usage_count remains unbalanced. Use devm_pm_runtime_set_active_enabled() to manage the runtime PM state. Its managed cleanup disables autosuspend and runtime PM and restores the suspended state on probe failure and driver removal. Remove the now redundant manual runtime PM cleanup. This issue was found by manual code inspection. Fixes: e517526195de ("i2c: Add Qualcomm CCI I2C driver") Signed-off-by: Guangshuo Li Cc: # v5.8+ Reviewed-by: Vladimir Zapolskiy Reviewed-by: Loic Poulain Signed-off-by: Andi Shyti Link: https://patch.msgid.link/20260812094425.3515179-1-lgs201920130244@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/i2c/busses/i2c-qcom-cci.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) --- a/drivers/i2c/busses/i2c-qcom-cci.c +++ b/drivers/i2c/busses/i2c-qcom-cci.c @@ -595,9 +595,11 @@ static int cci_probe(struct platform_dev goto disable_clocks; pm_runtime_set_autosuspend_delay(dev, MSEC_PER_SEC); + ret = devm_pm_runtime_set_active_enabled(dev); + if (ret) + goto disable_clocks; + pm_runtime_use_autosuspend(dev); - pm_runtime_set_active(dev); - pm_runtime_enable(dev); for (i = 0; i < cci->data->num_masters; i++) { if (!cci->master[i].cci) @@ -613,8 +615,6 @@ static int cci_probe(struct platform_dev return 0; error_i2c: - pm_runtime_disable(dev); - pm_runtime_dont_use_autosuspend(dev); for (--i ; i >= 0; i--) { if (cci->master[i].cci) { @@ -640,9 +640,6 @@ static void cci_remove(struct platform_d cci_halt(cci, i); } } - - pm_runtime_disable(&pdev->dev); - pm_runtime_set_suspended(&pdev->dev); } static const struct cci_data cci_v1_data = {