Re: [PATCH v9 9/9] arm64: dts: mediatek: Add MediaTek MT6392 PMIC dtsi

[email protected]
Newsgroups org.kernel.vger.linux-input,dev.linux.lists.mfd,org.kernel.vger.linux-devicetree
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Incorrect fallback compatible string 'mediatek,mt6323' on the PMIC node breaks older kernels.
--

--- Patch [9]: [PATCH v9 9/9] arm64: dts: mediatek: Add MediaTek MT6392 PMIC dtsi ---
commit 8aa00d786a3380122f097a78ee0ea676d704615c
Author: Val Packett <[email protected]>

arm64: dts: mediatek: Add MediaTek MT6392 PMIC dtsi

This patch adds the device tree include file for the MT6392 PMIC, which
provides support for regulators, keys, pinctrl, and RTC. It also includes
this new file in the shared device tree for Pumpkin boards.

> diff --git a/arch/arm64/boot/dts/mediatek/mt6392.dtsi b/arch/arm64/boot/dts/mediatek/mt6392.dtsi
> new file mode 100644
> index 0000000000000..69d63c153d9e5
> --- /dev/null
> +++ b/arch/arm64/boot/dts/mediatek/mt6392.dtsi
> @@ -0,0 +1,145 @@
[ ... ]
> +&pwrap {
> +	pmic: pmic {
> +		compatible = "mediatek,mt6392", "mediatek,mt6323";

[Severity: High]
Does providing the "mediatek,mt6323" fallback compatible string break older
kernels booting with this device tree?

The MFD core in older kernels will match the "mediatek,mt6323" string and
attempt to spawn the MT6323 sub-devices. However, the child nodes in this
device tree are not compatible with the MT6323 drivers, causing the regulators
to fail probing.

> +		interrupt-controller;
> +		#interrupt-cells = <2>;
[ ... ]
> +		mt6392regulators: regulators {
> +			compatible = "mediatek,mt6392-regulator";
> +
> +			/* Fixed supply defined in the data sheet */
> +			avddldo-supply = <&mt6392_vsys_reg>;
> +
> +			mt6392_vcore_reg: vcore {

[Severity: High]
Since the top-level PMIC node claims compatibility with MT6323, wouldn't the
MT6323 regulator driver expect this child node to have the
"mediatek,mt6323-regulator" compatible string and specific sub-node names
like "buck_vcore" and "buck_vproc"?

Because this node uses "mediatek,mt6392-regulator" and names like "vcore" and
"vproc", the MT6323 MFD driver fails to associate the regulators with the
device tree. If the MT6323 drivers cannot parse this structure, should the
fallback compatible string be removed from the PMIC node to avoid tricking
older kernels?

> +				regulator-allowed-modes = <MT6392_REGULATOR_MODE_NORMAL
> +							   MT6392_BUCK_MODE_FORCE_PWM>;
> +			};
> +			mt6392_vproc_reg: vproc {

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=9
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.