Linux LED subsystem development
 help / color / mirror / Atom feed
From: Lee Jones <lee@kernel.org>
To: sashiko-reviews@lists.linux.dev
Cc: Jiale Yao <yaojiale02@163.com>, linux-leds@vger.kernel.org
Subject: Re: [PATCH 1/2] leds: tps6131x: queue torch refresh work on freezable workqueue
Date: Wed, 28 Oct 2026 14:37:21 +0000	[thread overview]
Message-ID: <20261028143721.GA3605912@google.com> (raw)
In-Reply-To: <sashiko-outbox-174141@kernel.org>

On Fri, 16 Oct 2026, sashiko-bot@kernel.org wrote:

> Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
> - [Medium] leds: tps6131x: torch unintentionally turns back on upon system resume

This needs an answer.

> - [Low] leds: Commit message description is not capitalized
> --
> 
> commit f183582cffa51c16f099031455716678dcb8eab8
> Author: Jiale Yao <yaojiale02@163.com>
> 
> leds: tps6131x: queue torch refresh work on freezable workqueue
> 
> This commit changes the torch refresh watchdog work to use the
> system_freezable_wq instead of the non-freezable system workqueue. This
> prevents the work from running and attempting I2C register writes after
> the I2C adapter has been suspended.
> 
> > leds: tps6131x: queue torch refresh work on freezable workqueue
> 
> [Severity: Low]
> This isn't a bug, but the description after the subsystem prefix should
> be capitalized. Should "queue" be changed to "Queue" to align with the
> subsystem conventions?
> 
> > diff --git a/drivers/leds/flash/leds-tps6131x.c b/drivers/leds/flash/leds-tps6131x.c
> > index 5c9a5af5af05c..841a6538e75e1 100644
> > --- a/drivers/leds/flash/leds-tps6131x.c
> > +++ b/drivers/leds/flash/leds-tps6131x.c
> [ ... ]
> > @@ -307,8 +308,9 @@ static void tps6131x_torch_refresh_handler(struct work_struct *work)
> >  		return;
> >  	}
> >  
> > -	schedule_delayed_work(&tps6131x->torch_refresh_work,
> > -			      TPS6131X_TORCH_REFRESH_INTERVAL_JIFFIES);
> > +	queue_delayed_work(system_freezable_wq,
> > +			   &tps6131x->torch_refresh_work,
> > +			   TPS6131X_TORCH_REFRESH_INTERVAL_JIFFIES);
> >  }
> 
> [Severity: Medium]
> Does this unintentionally cause the torch to turn back on upon system resume?
> 
> Because the driver does not set the LED_CORE_SUSPENDRESUME flag, the LED is
> not cleanly turned off and its workqueue canceled during suspend. Instead,
> during suspend, the hardware watchdog will automatically shut off the LED
> after 13 seconds.
> 
> When using the previous non-freezable system workqueue, the handler would
> execute during suspend, fail to perform I2C transfers because the adapter
> is suspended, and return without rescheduling itself. This cleanly broke the
> refresh loop.
> 
> Now that the workqueue is freezable, won't it simply pause during suspend
> and thaw upon resume? When it thaws, tps6131x_torch_refresh_handler() will
> execute and force the torch back on via I2C, which seems like an unintended
> behavioral regression.
> 
> -- 
> Sashiko AI review · https://sashiko.dev/#/patchset/20261016100435.2581303-1-yaojiale02@163.com?part=1

-- 
Lee Jones

  reply	other threads:[~2026-10-28 14:37 UTC|newest]

Thread overview: 8+ 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-16 10:17   ` sashiko-bot
2026-10-28 14:37     ` Lee Jones [this message]
2026-10-17  7:16   ` jiale yao
2026-10-16 10:04 ` [PATCH 2/2] leds: cr0014114: queue recount " Jiale Yao
2026-10-16 10:15   ` sashiko-bot
2026-10-17  7:18   ` 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=20261028143721.GA3605912@google.com \
    --to=lee@kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=yaojiale02@163.com \
    /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