FAILED: patch "[PATCH] i2c: qcom-cci: fix autosuspend cleanup" failed to apply to 6.6-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 6.6-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y
git checkout FETCH_HEAD
git cherry-pick -x f98d4986482151a835b521a734722fe8dc5ca37d
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026090908-parrot-escargot-18fb@gregkh' --subject-prefix 'PATCH 6.6.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From f98d4986482151a835b521a734722fe8dc5ca37d Mon Sep 17 00:00:00 2001
From: Guangshuo Li <[email protected]>
Date: Wed, 12 Aug 2026 17:44:25 +0800
Subject: [PATCH] i2c: qcom-cci: fix autosuspend cleanup
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.
drivers/i2c/busses/i2c-qcom-cci.c +4 -7
@@ -595,9 +595,11 @@ static int cci_probe(struct platform_device *pdev) 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_device *pdev)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_device *pdev)cci_halt (cci, i); } } - -pm_runtime_disable (&pdev->dev); -pm_runtime_set_suspended (&pdev->dev); }static const struct cci_data cci_v1_data = {
Sasha Levin
maintainerPATCH 1/3 i2c: qcom-cci: Do not check return value of cci_init()
From: Vladimir Zapolskiy <[email protected]>
[ Upstream commit 17c5d247e3e4708cac05ff087c8013c0dda383a2 ]
The cci_init() function is not supposed to fail, and it never returns a non-zero, so it'd make sense to convert its signature to void.
Stable-dep-of: f98d49864821 ("i2c: qcom-cci: fix autosuspend cleanup")
--- drivers/i2c/busses/i2c-qcom-cci.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/i2c/busses/i2c-qcom-cci.c +2 -6
@@ -247,7 +247,7 @@ static int cci_reset(struct cci *cci)return 0 ; } -static int cci_init (struct cci *cci) +static void cci_init (struct cci *cci) {u32 val =CCI_IRQ_MASK_0_I2C_M0_RD_DONE | CCI_IRQ_MASK_0_I2C_M0_Q0_REPORT |
@@ -288,8 +288,6 @@ static int cci_init(struct cci *cci) val = hw->scl_stretch_en <<8 | hw->trdhld <<4 | hw->tsp;writel (val, cci->base +CCI_I2C_Mm_MISC_CTL (i)); } - -return 0 ; }static int cci_run_queue (struct cci *cci,u8 master,u8 queue)
@@ -634,9 +632,7 @@ static int cci_probe(struct platform_device *pdev)if (ret <0 ) goto error; - ret =cci_init (cci); -if (ret <0 ) - goto error; +cci_init (cci);pm_runtime_set_autosuspend_delay (dev,MSEC_PER_SEC );pm_runtime_use_autosuspend (dev);
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 2/3 i2c: qcom-cci: Remove overcautious disable_irq() calls
From: Vladimir Zapolskiy <[email protected]>
[ Upstream commit f0285c286bca5a1e018ba25040cef6c7806c31ef ]
In cci_probe() the controller's interrupt is requested using a devres managed API, and in cci_probe() error path and cci_remove() it'd be safe to rely on devres mechanism to free and shutdown the interrupt, thus explicit disable_irq() calls can be removed as unnecessary ones.
Stable-dep-of: f98d49864821 ("i2c: qcom-cci: fix autosuspend cleanup")
--- drivers/i2c/busses/i2c-qcom-cci.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/i2c/busses/i2c-qcom-cci.c +1 -4
@@ -630,7 +630,7 @@ static int cci_probe(struct platform_device *pdev) ret =cci_reset (cci);if (ret <0 ) - goto error; + goto disable_clocks;cci_init (cci);
@@ -662,8 +662,6 @@ static int cci_probe(struct platform_device *pdev)of_node_put (cci->master[i].adap.dev.of_node); } } -error: -disable_irq (cci->irq); disable_clocks:cci_disable_clocks (cci);
@@ -683,7 +681,6 @@ static void cci_remove(struct platform_device *pdev) } } -disable_irq (cci->irq);pm_runtime_disable (&pdev->dev);pm_runtime_set_suspended (&pdev->dev); }
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 3/3 i2c: qcom-cci: fix autosuspend cleanup
In reply to Sasha LevinFrom: Guangshuo Li <[email protected]>
[ 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.
--- drivers/i2c/busses/i2c-qcom-cci.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/i2c/busses/i2c-qcom-cci.c +4 -7
@@ -635,9 +635,11 @@ static int cci_probe(struct platform_device *pdev)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)
@@ -653,8 +655,6 @@ static int cci_probe(struct platform_device *pdev)return 0 ; error_i2c: -pm_runtime_disable (dev); -pm_runtime_dont_use_autosuspend (dev);for (--i ; i >=0 ; i--) {if (cci->master[i].cci) {
@@ -680,9 +680,6 @@ static void cci_remove(struct platform_device *pdev)cci_halt (cci, i); } } - -pm_runtime_disable (&pdev->dev); -pm_runtime_set_suspended (&pdev->dev); }static const struct cci_data cci_v1_data = {
Signature · 1 line
2.53.0