From: Jiale Yao <yaojiale02@163.com>
To: Lee Jones <lee@kernel.org>, Pavel Machek <pavel@kernel.org>,
linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Jiale Yao <yaojiale02@163.com>
Subject: [PATCH 2/2] leds: cr0014114: queue recount work on freezable workqueue
Date: Fri, 16 Oct 2026 18:04:35 +0800 [thread overview]
Message-ID: <20261016100435.2581303-3-yaojiale02@163.com> (raw)
In-Reply-To: <20261016100435.2581303-1-yaojiale02@163.com>
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.
Signed-off-by: Jiale Yao <yaojiale02@163.com>
---
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
next prev parent reply other threads:[~2026-10-16 10:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-16 10:04 [PATCH 0/2] leds: freeze delayed hardware access during suspend Jiale Yao
2026-10-16 10:04 ` [PATCH 1/2] leds: tps6131x: queue torch refresh work on freezable workqueue Jiale Yao
2026-10-17 7:16 ` jiale yao
2026-10-16 10:04 ` Jiale Yao [this message]
2026-10-17 7:18 ` Re:[PATCH 2/2] leds: cr0014114: queue recount " jiale yao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261016100435.2581303-3-yaojiale02@163.com \
--to=yaojiale02@163.com \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=pavel@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®