Thread (20 messages) 20 messages, 3 authors, 5h ago

Re: [PATCH v3 08/10] ARM: s3c: crag6410: convert PMIC DVS GPIO to software properties

From: sashiko-bot@kernel.org
Date: 2026-07-12 02:32:58
Also in: linux-devicetree

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Dynamic amendment of mfd_cell array using kmemdup_array violates MFD guidelines.
--
--- Patch [8]: [PATCH v3 08/10] ARM: s3c: crag6410: convert PMIC DVS GPIO to software properties ---
commit 71a506655ae9f68a5ef7d764d51d6d48703e4dcb
Author: Dmitry Torokhov [off-list ref]

ARM: s3c: crag6410: convert PMIC DVS GPIO to software properties

Convert the PMIC DVS GPIO configuration from a legacy lookup table to
software properties. We use the new 'dcdc_swnodes' field in 'struct
wm831x_pdata' to pass the software node to the regulator driver.
quoted hunk ↗ jump to hunk
diff --git a/arch/arm/mach-s3c/mach-crag6410.c b/arch/arm/mach-s3c/mach-crag6410.c
index 757c0f383ff1e..1abf08fdb543c 100644
--- a/arch/arm/mach-s3c/mach-crag6410.c
+++ b/arch/arm/mach-s3c/mach-crag6410.c
[ ... ]
quoted hunk ↗ jump to hunk
@@ -633,6 +644,9 @@ static struct wm831x_pdata crag_pmic_pdata = {
 		&vddint,  /* DCDC2 */
 		&vddmem,  /* DCDC3 */
 	},
+	.dcdc_swnodes = {
+		&crag_dcdc1_swnode,
+	},
[Severity: Medium]
Is it possible that populating the new 'dcdc_swnodes' field relies on the MFD
core dynamically allocating and amending the mfd_cell array at runtime?

Looking at wm831x_add_devices() in drivers/mfd/wm831x-core.c, passing
these software nodes causes the core driver to dynamically copy the cell
array to inject the pointers:

drivers/mfd/wm831x-core.c:wm831x_add_devices() {
    ...
	struct mfd_cell *local_cells __free(kfree) =
		kmemdup_array(cells, num_cells, sizeof(*cells), GFP_KERNEL);
    ...
}

The MFD subsystem guidelines explicitly state: "For mfd_cells, do not create
local copies for dynamic amendments; always use static references." Could this
approach be violating the subsystem's architectural rules against dynamic cell
amendments?
 
 	.ldo = {
 		&vddsys,   /* LDO1 */
-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260711-samsung-kp-v3-0-b2fcaba77aff@gmail.com?part=8
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help