From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796399926; b=tN49PxJR4OwA9g4j8OMh9F6rAL352EeEEDTUW6nFuWTMFy2z3uwcVQl2oA1Zf/Yx7oaw sTO5bqHQxlHbmfD47vT4woQ0C82lXiKxd1Fn6e9d28p0KFY4f3GrilqOC693tClweQDYe gVduT/1gJ+ka2mSADB+Y68W5SXmxYcmUYE1mynNMzcpYU666aXxsjhF0vJov8AGhpSWyv 91Vaqb+WfIR4xGk/fY+t5CM9Z5bafONNq2ESIQNQB7aHXffLhkb7lTWDB0+Y19gCrKvmE tiuCfyz30f8AUJZp9ZUs0BP7S8OQSsCHJOnuTcvzvjdjZEVgjYC4v/3FzlQCZS7/r6Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796399926; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=B00npC94IVlivUoK1Kp3/ZwqNktKwFnoBpt3thtcr/M=; b=m9N9EiWRL1tUXoA4Y6dRAYQhpmP5c5Ed/4UZSgwYgL8VH7CUa8W/eOCt7sh1Axc/gRtI 2p8HlsZkDImKp4Bv18qlWObcEOvk1xlvT0kSiA80ruIro+UpsS2HhJKU+kXu7VmEg9mOg Q3zlS4Nw93MRnUnSLHtyYkd8KuJlo3kPMO2P/wkNwT6/yvbZrPS0JU11Z/cs/vh9+3O1a 0mYpBBS0xCDUc67X6wy/hA1pLMFQsgaF/cs6rmfXQI5x8K+YcFL58R3vuDGWyFh+F4y5V ec5lu2UqgzktSMI/WXt5yn4i4tqXSuC7yPmQ4UaZTRY/zzLR+3zIT5O5jiTq56IjFIA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=n3Nb7ccg; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A77E3606A322; Fri, 4 Dec 2026 15:58:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=n3Nb7ccg Received: by smtp.kernel.org (Postfix) with ESMTPSA id F08A81F000C2; Fri, 4 Dec 2026 15:58:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796399926; bh=B00npC94IVlivUoK1Kp3/ZwqNktKwFnoBpt3thtcr/M=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=n3Nb7ccgKx0jHSD3j0yHndtojdmsEdx7KoX5a3WiYBkibasLSqmJWUilEmdoo1Qkb l2N/5rxq+xRe3//L+sgpJ+Nf/EFY/3QPvjhBJ7J15/TKF5jivevvNWCl20Heupia3l 6c1bnmHCSV0l7hOSEL1CvFF8jtzFf5mYdkM79IttR5XN/tAfQkNsdEsMfUS5LVbocz BhIGt2oMD5YFK5uGApmuMQ5dQvp5iIzWngs5oL5l3mxHwuRW+yD+ubnL7hYQVVCHfI NsoOXj400bPV3is3F9ubXKWNQx2Wov3LfHh2bPv0MtRpcvoXDus6+GDC+Xw/fJUMN+ 9X6l4AnuyyZXA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v4 06/13] mfd: synaptics: add SL2610 system controller support Reply-To: sashiko-reviews@lists.linux.dev To: "Jisheng Zhang" Cc: devicetree@vger.kernel.org, linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org, mfd@lists.linux.dev, robh@kernel.org, conor+dt@kernel.org, lee@kernel.org In-Reply-To: <20261204140732.31223-7-jszhang@kernel.org> References: <20261204140732.31223-1-jszhang@kernel.org> <20261204140732.31223-7-jszhang@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 15:58:45 +0000 X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 5 potential issues to consider: - [Medium] mfd: sl2610-syscon: unchecked NULL from device_get_match_data() in probe - [Low] mfd: sl2610-syscon: single-function AVIO and CPU blocks wrapped in MFD - [Low] mfd: sl2610-syscon: pass enum ID instead of mfd_cell arrays in match data - [Low] mfd: sl2610-syscon: commit subject violates MFD prefix and capitalization - [Low] mfd: sl2610-syscon: mfd_cell arrays in match data and unchecked dereference -- commit 7c12564f7c07b048184bd552b6f9d7507c32b275 Author: Jisheng Zhang mfd: synaptics: add SL2610 system controller support This patch adds an MFD driver for Synaptics SL2610 system controller blocks to register platform devices for their clock, reset and pin controller sub-functions. > mfd: synaptics: add SL2610 system controller support [Severity: Low] MFD commit subjects follow the "mfd: : " format. For this driver, that would be "mfd: sl2610-syscon: Add Synaptics SL2610 system controller support". > diff --git a/drivers/mfd/sl2610-syscon.c b/drivers/mfd/sl2610-syscon.c > new file mode 100644 > index 0000000000000..c6fc2955ac0de > --- /dev/null > +++ b/drivers/mfd/sl2610-syscon.c > @@ -0,0 +1,84 @@ [ ... ] > +struct sl2610_syscon_data { > + const struct mfd_cell *cells; > + unsigned int num_cells; > +}; [Severity: Low] Is this wrapper struct needed? New MFD drivers avoid passing mfd_cell arrays via match-table .data; storing a non-zero enum ID in .data and switching in sl2610_syscon_probe() avoids both these wrappers and the unchecked match-data dereference on non-OF binds. [ ... ] > +static const struct mfd_cell sl2610_avio_cells[] =3D { > + MFD_CELL_NAME("sl2610-avio-clk"), > +}; > + > +static const struct mfd_cell sl2610_cpu_cells[] =3D { > + MFD_CELL_NAME("sl2610-cpu-clk"), > +}; [Severity: Low] Should the AVIO and CPU blocks be handled by this MFD driver at all? Both blocks only instantiate a single clock child, and their DT bindings describe single-function clock controllers rather than multi-function devices. The clock driver can match syna,sl2610-avio-syscon and syna,sl2610-cpu-syscon directly while keeping generic syscon access. The commit message also states that each block implements clock, reset and pin controller devices, which does not hold for AVIO and CPU. [ ... ] > +static int sl2610_syscon_probe(struct platform_device *pdev) > +{ > + const struct sl2610_syscon_data *data =3D device_get_match_data(&pdev->= dev); > + > + return devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO, > + data->cells, data->num_cells, NULL, 0, NULL); > +} [Severity: Medium] Can device_get_match_data() return NULL here and cause a NULL pointer dereference on data->cells? sl2610_syscon_driver does not set suppress_bind_attrs, so binding a non-OF platform device via sysfs driver_override and bind invokes sl2610_syscon_probe() without an OF match. Checking if (!data) and returning -ENODEV prevents the oops. > + > +static const struct of_device_id sl2610_syscon_of_match[] =3D { > + { .compatible =3D "syna,sl2610-soc-syscon", .data =3D &sl2610_soc_data = }, > + { .compatible =3D "syna,sl2610-mcu-syscon", .data =3D &sl2610_mcu_data = }, > + { .compatible =3D "syna,sl2610-avio-syscon", .data =3D &sl2610_avio_dat= a }, > + { .compatible =3D "syna,sl2610-cpu-syscon", .data =3D &sl2610_cpu_data = }, > + { } > +}; [Severity: Low] Should sl2610_syscon_of_match store enum or integer IDs in .data instead of pointers to mfd_cell wrapper structs? MFD convention for new drivers is to put an ID in .data and pick the static const mfd_cell array with a switch in probe. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204140732.3122= 3-1-jszhang@kernel.org?part=3D6