Skip to contentSkip to conversation

FAILED: patch "[PATCH] backlight: lm3630a: Cancel delayed work before destroying" failed to apply to 5.15-stable tree

PATCH New [email protected] 2 participants 3 messages Nov 3

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 5.15-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-5.15.y
git checkout FETCH_HEAD
git cherry-pick -x 2cf184caab8b406fdd9db126ee40d62418237456
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026110358-afar-payable-c2d6@gregkh' --subject-prefix 'PATCH 5.15.y' 'HEAD^..'

Possible dependencies:

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 2cf184caab8b406fdd9db126ee40d62418237456 Mon Sep 17 00:00:00 2001
From: Myeonghun Pak <[email protected]>
Date: Fri, 2 Oct 2026 23:04:39 -0400
Subject: [PATCH] backlight: lm3630a: Cancel delayed work before destroying
workqueue

The interrupt handler queues delayed work to read the interrupt status. After free_irq() stops the producer, this work can still be waiting on its timer. destroy_workqueue() cannot drain delayed work that has not yet been queued by its timer, so the timer can outlive both the workqueue and the devm-allocated chip containing the work.

Cancel the delayed work synchronously after freeing the IRQ and before destroying the workqueue. This also waits for any running status read to finish before the chip's resources are released.

This issue was identified during our ongoing static-analysis research while reviewing kernel code.

Fixes 0c2a665a648e ("backlight: add Backlight driver for lm3630 chip")
Assisted-by LLM
drivers/video/backlight/lm3630a_bl.c +1 -0
index 8f49e59ce374..8ef8163c7fef 100644
@@ -591,6 +591,7 @@ static void lm3630a_remove(struct i2c_client *client)
 
 	if (pchip->irq) {
 		free_irq(pchip->irq, pchip);
+		cancel_delayed_work_sync(&pchip->work);
 		destroy_workqueue(pchip->irqthread);
 	}
 }
maintainer
#1 lore raw

PATCH 1/2 backlight: lm3630a_bl: Remove redundant 'flush_workqueue()' calls

From: Xu Wang <[email protected]>

[ Upstream commit adc122011125682932ef279d717153670feedde4 ]

'destroy_workqueue()' already drains the queue before destroying it, so there is no need to flush it explicitly.

Remove the redundant 'flush_workqueue()' calls.

Stable-dep-of: 2cf184caab8b ("backlight: lm3630a: Cancel delayed work before destroying workqueue")

---
 drivers/video/backlight/lm3630a_bl.c | 1 -
 1 file changed, 1 deletion(-)
drivers/video/backlight/lm3630a_bl.c +0 -1
index a15102bf21365..0886bbce25e54 100644
@@ -589,7 +589,6 @@ static int lm3630a_remove(struct i2c_client *client)
 
 	if (pchip->irq) {
 		free_irq(pchip->irq, pchip);
-		flush_workqueue(pchip->irqthread);
 		destroy_workqueue(pchip->irqthread);
 	}
 	return 0;
Signature · 1 line
2.53.0
maintainer
#2 lore raw

PATCH 2/2 backlight: lm3630a: Cancel delayed work before destroying workqueue

From: Myeonghun Pak <[email protected]>

[ Upstream commit 2cf184caab8b406fdd9db126ee40d62418237456 ]

The interrupt handler queues delayed work to read the interrupt status. After free_irq() stops the producer, this work can still be waiting on its timer. destroy_workqueue() cannot drain delayed work that has not yet been queued by its timer, so the timer can outlive both the workqueue and the devm-allocated chip containing the work.

Cancel the delayed work synchronously after freeing the IRQ and before destroying the workqueue. This also waits for any running status read to finish before the chip's resources are released.

This issue was identified during our ongoing static-analysis research while reviewing kernel code.

---
 drivers/video/backlight/lm3630a_bl.c | 1 +
 1 file changed, 1 insertion(+)
drivers/video/backlight/lm3630a_bl.c +1 -0
index 0886bbce25e54..118a91321b603 100644
@@ -589,6 +589,7 @@ static int lm3630a_remove(struct i2c_client *client)
 
 	if (pchip->irq) {
 		free_irq(pchip->irq, pchip);
+		cancel_delayed_work_sync(&pchip->work);
 		destroy_workqueue(pchip->irqthread);
 	}
 	return 0;
Signature · 1 line
2.53.0