mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "jiale yao" <19888972804@163.com>
To: "Lee Jones" <lee@kernel.org>, "Pavel Machek" <pavel@kernel.org>,
	linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re:[PATCH 2/2] leds: cr0014114: queue recount work on freezable workqueue
Date: Sat, 17 Oct 2026 15:18:00 +0800 (CST)	[thread overview]
Message-ID: <547da4c9.1783.1a148b98683.Coremail.19888972804@163.com> (raw)
In-Reply-To: <20261016100435.2581303-3-yaojiale02@163.com>

At 2026-10-16 18:04:35, "Jiale Yao" <yaojiale02@163.com> 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@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

      reply	other threads:[~2026-10-17  7:18 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 ` [PATCH 2/2] leds: cr0014114: queue recount " Jiale Yao
2026-10-17  7:18   ` jiale yao [this message]

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=547da4c9.1783.1a148b98683.Coremail.19888972804@163.com \
    --to=19888972804@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®