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 1E1653750D6; Sat, 12 Sep 2026 09:38:14 +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=1789205896; cv=none; b=HZkTu7nqX6pMq1fIGLN0ThSxArspUPR0sLAPlB3NbjrHrjIdkPzEiAFcY8BG46SlAq8o6g7pB6k61auuMJjnhqtjhmBJZsFANiAn9bnnJ22MuBfrOpx8QfvqwTiSMAPf8byQ1raltBwYkJP/VvxFpCV1M77lV39zmS8O473hNlM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789205896; c=relaxed/simple; bh=bh+2AQdiglpma9tUZj65ujr06+uYr1pW+QYnihssQuM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eTfC34dOy9cOZrNArCpGvLbREhi6iqSctowJ9N1yQOAb+F8E9g/COr2wQ1MyyrV4O9+HX4JoeakCwC5jCM88867wSBhp2awYcJtgpKE7Es6QFjRIaI89PiP/NLXK6JBseXacK/rB6SKqSn3eezm5QSOtH8yG+LwSDQfeI3YRGVA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=A4fzZkSz; 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="A4fzZkSz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8525C1F000FF; Sat, 12 Sep 2026 09:38:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789205894; bh=BT2MowRkUfFdSndi9us/oj3t7RAbAqajiDnPQk2ghO8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=A4fzZkSzxSOOhRCcDz7RTg2bSk6JFTt/MkUpUGaW1opj+8goKLUmf3luTWLADQV6d 5cKLib4JvJ0atyMakTq3A6ou/QOHu42ex9A8Dyl+utWyFRHIagF58yhz+NWf7PI5xk dXgW+3PaPdD00iHrZcKsn6haZCuJSIkYmPhnfbG4= 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 , Sasha Levin Subject: [PATCH 6.18 0052/1518] i2c: qcom-cci: fix autosuspend cleanup Date: Sat, 12 Sep 2026 08:37:01 +0200 Message-ID: <20260912065624.620868298@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065623.398859879@linuxfoundation.org> References: <20260912065623.398859879@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 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Guangshuo Li [ Upstream commit f98d4986482151a835b521a734722fe8dc5ca37d ] 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: Sasha Levin 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 @@ -599,9 +599,11 @@ static int cci_probe(struct platform_dev cci_init(cci); 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) @@ -617,8 +619,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) { @@ -644,9 +644,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 = {