All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Paul Sajna" <sajattack@postmarketos.org>
Cc: linux-leds@vger.kernel.org, devicetree@vger.kernel.org,
	robh@kernel.org, conor+dt@kernel.org, lee@kernel.org
Subject: Re: [PATCH v4 4/4] leds: aw2013: Move assignment of chip->num_leds
Date: Sun, 08 Nov 2026 22:00:10 +0000	[thread overview]
Message-ID: <sashiko-outbox-204102@kernel.org> (raw)
In-Reply-To: <20261108-aw2013-aw20xx-rename-v4-4-826529beeb52@postmarketos.org>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] leds: aw2013: commit message rationale does not match driver
  locking or code
--

commit 1ce6b90ecf6b0a7b5d8097b414e8e137a3fe0609
Author: Paul Sajna <sajattack@postmarketos.org>

> leds: aw2013: Move assignment of chip->num_leds
>
> devm_led_classdev_register_ext() executes default triggers
> synchronously, which call aw20xx_brightness_set().
> aw20xx_chip_in_use() silently returns false, skipping chip enablement and
> causing unbalanced regulator disables while probe is still running.
>
> Increment chip->num_leds inside the loop, so that each call gets the
> correct value for it's default trigger.
>
> Signed-off-by: Paul Sajna <sajattack@postmarketos.org>

[Severity: Medium]
Does this commit message match the locking and execution flow in
leds-aw2013?

aw2013_probe_dt() sets brightness_set_blocking to aw2013_brightness_set()
and leaves brightness_set NULL, so default triggers activated during
devm_led_classdev_register_ext() queue set_brightness_work instead of
calling aw2013_brightness_set() synchronously.

Furthermore, aw2013_probe() holds chip->mutex across aw2013_probe_dt(), and
aw2013_brightness_set() locks chip->mutex before calling
aw2013_chip_in_use().  Any queued work therefore waits until
aw2013_probe_dt() has finished and chip->num_leds is already set.

Also, aw2013_chip_disable() returns early when !chip->enabled, preventing
an unbalanced regulator_bulk_disable() if aw2013_chip_enable() was skipped,
and the driver functions are named aw2013_brightness_set() and
aw2013_chip_in_use() rather than aw20xx_*.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261108-aw2013-aw20xx-rename-v4-0-826529beeb52@postmarketos.org?part=4

  reply	other threads:[~2026-11-08 22:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-08 21:49 [PATCH v4 0/4] leds: aw2013: Add AW2027 support Paul Sajna
2026-11-08 21:49 ` [PATCH v4 1/4] dt-bindings: leds: aw2013: Add awinic,aw2027 compatible Paul Sajna
2026-11-08 21:51   ` sashiko-bot
2026-11-08 21:49 ` [PATCH v4 2/4] leds: aw2013: Add AW2027 support Paul Sajna
2026-11-08 21:51   ` Paul Sajna
2026-11-08 21:55   ` sashiko-bot
2026-11-08 21:49 ` [PATCH v4 3/4] leds: aw2013: Use dev_err_probe Paul Sajna
2026-11-08 21:52   ` sashiko-bot
2026-11-08 21:49 ` [PATCH v4 4/4] leds: aw2013: Move assignment of chip->num_leds Paul Sajna
2026-11-08 22:00   ` sashiko-bot [this message]
2026-11-08 22:06     ` Paul Sajna
2026-11-08 22:08 ` [PATCH v4 0/4] leds: aw2013: Add AW2027 support Paul Sajna

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=sashiko-outbox-204102@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sajattack@postmarketos.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.