* [PATCH] misc: bh1770glc: queue proximity work on freezable workqueue
@ 2026-10-16 10:10 Jiale Yao
2026-10-17 7:24 ` jiale yao
0 siblings, 1 reply; 2+ messages in thread
From: Jiale Yao @ 2026-10-16 10:10 UTC (permalink / raw)
To: Arnd Bergmann, Greg Kroah-Hartman, linux-kernel; +Cc: Jiale Yao
The proximity fallback work reads sensor registers after a delay. System
suspend powers the sensor down without cancelling that work, while
schedule_delayed_work() leaves it runnable on the non-freezable system
workqueue.
Queue the fallback work on system_freezable_wq so it cannot access the
powered-down sensor or its suspended I2C adapter.
Signed-off-by: Jiale Yao <yaojiale02@163.com>
---
drivers/misc/bh1770glc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/misc/bh1770glc.c b/drivers/misc/bh1770glc.c
index 98fc5970b2bb..3411947d9283 100644
--- a/drivers/misc/bh1770glc.c
+++ b/drivers/misc/bh1770glc.c
@@ -620,8 +620,8 @@ static irqreturn_t bh1770_irq(int irq, void *data)
* next expected interrupt time.
*/
cancel_delayed_work_sync(&chip->prox_work);
- schedule_delayed_work(&chip->prox_work,
- msecs_to_jiffies(rate + 50));
+ queue_delayed_work(system_freezable_wq, &chip->prox_work,
+ msecs_to_jiffies(rate + 50));
}
return IRQ_HANDLED;
}
--
2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re:[PATCH] misc: bh1770glc: queue proximity work on freezable workqueue
2026-10-16 10:10 [PATCH] misc: bh1770glc: queue proximity work on freezable workqueue Jiale Yao
@ 2026-10-17 7:24 ` jiale yao
0 siblings, 0 replies; 2+ messages in thread
From: jiale yao @ 2026-10-17 7:24 UTC (permalink / raw)
To: Arnd Bergmann, Greg Kroah-Hartman, linux-kernel
At 2026-10-16 18:10:33, "Jiale Yao" <yaojiale02@163.com> wrote:
>The proximity fallback work reads sensor registers after a delay. System
>suspend powers the sensor down without cancelling that work, while
>schedule_delayed_work() leaves it runnable on the non-freezable system
>workqueue.
>
>Queue the fallback work on system_freezable_wq so it cannot access the
>powered-down sensor or its suspended I2C adapter.
>
Fixes: 190420ab34ab ("drivers/misc: driver for bh1770glc / sfh7770 ALS and proximity sensor")
>Signed-off-by: Jiale Yao <yaojiale02@163.com>
>---
> drivers/misc/bh1770glc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/misc/bh1770glc.c b/drivers/misc/bh1770glc.c
>index 98fc5970b2bb..3411947d9283 100644
>--- a/drivers/misc/bh1770glc.c
>+++ b/drivers/misc/bh1770glc.c
>@@ -620,8 +620,8 @@ static irqreturn_t bh1770_irq(int irq, void *data)
> * next expected interrupt time.
> */
> cancel_delayed_work_sync(&chip->prox_work);
>- schedule_delayed_work(&chip->prox_work,
>- msecs_to_jiffies(rate + 50));
>+ queue_delayed_work(system_freezable_wq, &chip->prox_work,
>+ msecs_to_jiffies(rate + 50));
> }
> return IRQ_HANDLED;
> }
>--
>2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-17 7:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-16 10:10 [PATCH] misc: bh1770glc: queue proximity work on freezable workqueue Jiale Yao
2026-10-17 7:24 ` jiale yao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®