From: sashiko-bot@kernel.org
To: "Eduard Bostina" <egbostina@gmail.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org,
mfd@lists.linux.dev, lee@kernel.org
Subject: Re: [PATCH v3] dt-bindings: mfd: Convert TI TWL6040 to DT schema
Date: Mon, 17 Aug 2026 10:13:05 +0000 [thread overview]
Message-ID: <20260817101306.4A4D91F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260817100207.2970303-1-egbostina@gmail.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
New issues:
- [Low] The 'clock-names' property uses an 'enum' for array items without enforcing uniqueness or order, allowing invalid configurations to pass schema validation.
Pre-existing issues:
- [High] The MFD driver mutates globally shared `static` resource arrays during `probe()`, creating a concurrency data race.
--
--- Patch [1]: [PATCH v3] dt-bindings: mfd: Convert TI TWL6040 to DT schema ---
commit 217f75902b2af0561cd52b8ef59fbfb6ab482cc0
Author: Eduard Bostina <egbostina@gmail.com>
dt-bindings: mfd: Convert TI TWL6040 to DT schema
Convert the Texas Instruments TWL6040 audio codecs family bindings to DT
schema.
Link to v2: https://lore.kernel.org/all/20260816092847.2522994-1-egbostina@gmail.com/
Link to v1: https://lore.kernel.org/all/20260815083451.2147129-1-egbostina@gmail.com/
> diff --git a/Documentation/devicetree/bindings/mfd/ti,twl6040.yaml b/Documentation/devicetree/bindings/mfd/ti,twl6040.yaml
> new file mode 100644
> index 0000000000000..0d4e620d25a51
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mfd/ti,twl6040.yaml
> @@ -0,0 +1,151 @@
[ ... ]
> + clocks:
> + minItems: 1
> + maxItems: 2
> +
> + clock-names:
> + minItems: 1
> + maxItems: 2
> + items:
> + enum:
> + - clk32k
> + - mclk
[Severity: Low]
Does this clock-names definition allow duplicate items or arbitrary ordering?
Using enum for array items without enforcing uniqueness or order might allow
invalid configurations like ["clk32k", "clk32k"] to pass schema validation.
[Severity: High]
This isn't a bug introduced by this patch, but looking at twl6040_probe()
in drivers/mfd/twl6040.c, it modifies a globally shared static array:
drivers/mfd/twl6040.c:twl6040_probe() {
...
twl6040_codec_rsrc[0].start = irq;
twl6040_codec_rsrc[0].end = irq;
cell->resources = twl6040_codec_rsrc;
cell->num_resources = ARRAY_SIZE(twl6040_codec_rsrc);
...
}
Does this mutate a globally shared static resource array during probe?
If multiple instances of the TWL6040 device probe concurrently on different
I2C buses, could they simultaneously modify the start and end fields of the
global twl6040_codec_rsrc array, creating a concurrency data race?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260817100207.2970303-1-egbostina@gmail.com?part=1
prev parent reply other threads:[~2026-08-17 10:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-17 10:02 [PATCH v3] dt-bindings: mfd: Convert TI TWL6040 to DT schema Eduard Bostina
2026-08-17 10:13 ` sashiko-bot [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=20260817101306.4A4D91F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=egbostina@gmail.com \
--cc=lee@kernel.org \
--cc=mfd@lists.linux.dev \
--cc=robh@kernel.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.