Re:[PATCH 2/2] leds: cr0014114: queue recount work on freezable workqueue

From: jiale yao

Date: Sat Oct 17 2026 - 03:18:32 EST


At 2026-10-16 18:04:35, "Jiale Yao" <yaojiale02@xxxxxxx> wrote:
>The firmware workaround periodically recounts the LED state by issuing
>SPI transfers. Its delayed work runs on the non-freezable system
>workqueue and can therefore access the controller after it has been
>suspended.
>
>Queue the recount work on system_freezable_wq so hardware access is
>deferred until devices have resumed.
>

Fixes: 9e50d5fb0d18 ("leds: add LED driver for CR0014114 board")

>Signed-off-by: Jiale Yao <yaojiale02@xxxxxxx>
>---
> drivers/leds/leds-cr0014114.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/leds/leds-cr0014114.c b/drivers/leds/leds-cr0014114.c
>index 3f6931ae0bcc..afe3730e1222 100644
>--- a/drivers/leds/leds-cr0014114.c
>+++ b/drivers/leds/leds-cr0014114.c
>@@ -155,7 +155,8 @@ static void cr0014114_recount_work(struct work_struct *work)
> if (ret)
> dev_warn(priv->dev, "sync of LEDs failed %d\n", ret);
>
>- schedule_delayed_work(&priv->work, CR_RECOUNT_DELAY);
>+ queue_delayed_work(system_freezable_wq, &priv->work,
>+ CR_RECOUNT_DELAY);
> }
>
> static int cr0014114_set_sync(struct led_classdev *ldev,
>@@ -256,7 +257,8 @@ static int cr0014114_probe(struct spi_device *spi)
> return ret;
>
> /* setup recount work to workaround buggy firmware */
>- schedule_delayed_work(&priv->work, CR_RECOUNT_DELAY);
>+ queue_delayed_work(system_freezable_wq, &priv->work,
>+ CR_RECOUNT_DELAY);
>
> spi_set_drvdata(spi, priv);
>
>--
>2.34.1