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=1795937145; b=AM81TLedn1PAwz4cBzmSLH59Z/RppLEocqbUvVuRoMLfdLeHh3mPrxAO/JRwqwXR0G45 2Cur5LQ6EDYFyG6dhRblsCz0my3t8y3GbYBOV2TOTV4FOC45olamtYFf0ujdxbqLmKn5d qzbeE4PiRvE+AHeJGIGUYx2gwJ2w+sZaqjrFt1d2pjiuq+vMNw4EsoWht0ztaxOn42IrL py8frfBkVn3huC7+T1vbfVNdLYFVvJcQqaZjQu58/rmHWAy6LqaBUqjOe09phtzt13CR5 2CZk/r4E79mcBXYTkrn40ZkLPGmsmZNd9F/9oxsyubUzKwhUcD2j6ZmKTn4brbKgdlQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795937145; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=NEx2S1nY2tgGWPSQ/FHJhn7j11Knhm0uJHYNrhY3mWo=; b=QH6G3TsGQ09qbWP1aZP7fS7AJjm8R9MFvUmvillazFOMPpHyoTFBgr8o22kBwY8FlkUZ 4bBAciDqoy8agkH7bAcdt8DpZ7Koca4M8oRsPqt5LQ6nc58xRRxUDSg4vWzZLtMDZZP/N 5Xf7FcPg24zz4+CwaHeMtr735cXsY3wVC3YiCwAq4PVMOr67nmafrcS99Q9OG34HiaD2H WuqM7O29KyYapi3qEe92SNQacgjOSzWGrkwDJgDqZ7jcGoDUHWe5cQjgtEndnEhlBu3Se oUF3MBqVK22khhRjmSnq0uxr1OO+tvqa3Z3aSmt+5Z2YC0WDhBOaMESfNp1GQ83IfLQ== 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=UzNJsv+m; 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 630CD606A31C; Sun, 29 Nov 2026 07:25:45 +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=UzNJsv+m Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90AFA1F00896; Sun, 29 Nov 2026 07:25:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795937144; bh=NEx2S1nY2tgGWPSQ/FHJhn7j11Knhm0uJHYNrhY3mWo=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=UzNJsv+miISCUeS7GN4a0K/1Nfp4TYAliR6R5FzNfr4l80l0YOw55/d1bu/qPWSWT AyVSzemzsq5dfkWptGB+GOEkfFcVJU0izq7h5geM1C96vcm2/K6kJKLIHSo3FRld3v UByzmMwJdqLZ9GKJKOscGv18omZhmX5g/EvgfrYOcmnfogbJkUw6i+JlI3YT+2SifH niloSoClfLNr1kSqyTAYur7KxISHX2FKL88q6YKCPoNOEbsKWSrtJL/p365b4lJDlC c6Bz7BL22D4iqXeELA+MXE8HENVxSMRKGCWaHWZbJhGRrzQKq4vXSiC22FhPKf7J+j 7WhIB+XiRtVFw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 2/3] pinctrl: rockchip: program RK3308 I/O domains before SDIO probes Reply-To: sashiko-reviews@lists.linux.dev To: "Abduwaris Nurmemet" Cc: devicetree@vger.kernel.org, linux-gpio@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org In-Reply-To: References: <20261129071403.4890-1-daabu@qq.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sun, 29 Nov 2026 07:25:44 +0000 X-Mailing-List: devicetree@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 3 potential issues to consider: - [Medium] pinctrl: rockchip: duplicate I/O domain setup in rk3308_io_voltage_domains() - [Medium] pinctrl: rockchip: missing VCCIO3 ctrl bit in rk3308_io_voltage_domains() - [Medium] pinctrl: rockchip: RK3308B init skipped on retry in rockchip_pinctrl_probe() -- commit aed3a3e244a9e788db0579166d5c5a680e27a845 Author: Abduwaris Nurmemet pinctrl: rockchip: program RK3308 I/O domains before SDIO probes This commit adds rk3308_io_voltage_domains() to program RK3308_SOC_CON0 for 1.8V I/O domains during rockchip_pinctrl_probe() based on an "io-1v8-domains" bitmask property on the pinctrl node. > diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl= -rockchip.c > index ba47b6f323ccc..c9c888b796ec1 100644 > --- a/drivers/pinctrl/pinctrl-rockchip.c > +++ b/drivers/pinctrl/pinctrl-rockchip.c > @@ -4761,6 +4761,40 @@ static int rk3308_soc_data_init(struct rockchip_pi= nctrl *info) > return 0; > } > =20 > +#define RK3308_SOC_CON0 0x300 > +#define RK3308_SOC_CON0_DOMAINS GENMASK(5, 0) > + > +/* > + * The RK3308 SDIO controller is only reliable at high clock rates when = the > + * I/O domain feeding its pins is configured for 1.8V. That setup has to > + * happen before the SDIO controller probes, so do it here from the pinc= trl > + * driver rather than from the (later probing) io-domain driver. > + * > + * Boards opt in with an "io-1v8-domains" bitmask property on the pinctrl > + * node, where each set bit marks an I/O domain that runs at 1.8V. > + */ > +static void rk3308_io_voltage_domains(struct rockchip_pinctrl *info) > +{ > + struct device *dev =3D info->dev; > + u32 io_volt_select; > + int ret; > + > + if (device_property_read_u32(dev, "io-1v8-domains", &io_volt_select)) > + return; [Severity: Medium] Should this I/O domain configuration be handled by the existing rockchip-iodomain driver in drivers/soc/rockchip/io-domain.c instead of duplicating GRF_SOC_CON0 management in the pinctrl driver? Mainline already supports RK3308 I/O domains via soc_data_rk3308 ("rockchip,rk3308-io-voltage-domain"), which queries each vccio0-supply through vccio5-supply regulator, leaves unspecified domains untouched, and registers regulator voltage-change notifiers. Programming RK3308_SOC_CON0 from a raw bitmask here bypasses the regulator framework and unconditionally forces all six domains in GENMASK(5, 0) to either 1.8V or 3.3V. If the io-domain driver probes after dw_mmc-rockchip, fixing the probe ordering or device dependency in drivers/soc/rockchip/io-domain.c would avoid introducing a second, uncoordinated path for the same register. > + > + if (io_volt_select & ~RK3308_SOC_CON0_DOMAINS) { > + dev_warn(dev, "ignored invalid io-1v8-domains\n"); > + return; > + } > + > + ret =3D regmap_write(info->regmap_base, RK3308_SOC_CON0, > + io_volt_select | (RK3308_SOC_CON0_DOMAINS << 16)); [Severity: Medium] Does programming domain 3 (BIT(3)) in RK3308_SOC_CON0 take effect without also setting RK3308_SOC_CON0_VCCIO3 (BIT(8))? On RK3308, VCCIO3 voltage selection is controlled by an external GPIO unless BIT(8) in RK3308_SOC_CON0 is set, as done in rk3308_iodomain_init(): drivers/soc/rockchip/io-domain.c:rk3308_iodomain_init() { ... val =3D RK3308_SOC_CON0_VCCIO3 | (RK3308_SOC_CON0_VCCIO3 << 16); ret =3D regmap_write(iod->grf, RK3308_SOC_CON0, val); ... } Because rk3308_io_voltage_domains() only writes bits 5:0, setting BIT(3) in io-1v8-domains has no effect on hardware unless the rockchip-iodomain driver also probes. > + if (ret < 0) > + dev_warn(dev, "Couldn't update 1.8V I/O domains\n"); > + else > + dev_info(dev, "1.8V I/O domains assigned 0x%03x\n", io_volt_select); > +} > + > static int rockchip_pinctrl_probe(struct platform_device *pdev) > { > struct rockchip_pinctrl *info; > @@ -4824,6 +4858,9 @@ static int rockchip_pinctrl_probe(struct platform_d= evice *pdev) > /* try to find the optional reference to the ioc1 syscon */ > info->regmap_ioc1 =3D syscon_regmap_lookup_by_phandle_optional(np, "roc= kchip,ioc1"); > =20 > + if (ctrl->type =3D=3D RK3308) > + rk3308_io_voltage_domains(info); > + > if (ctrl->type =3D=3D RK3308) { > ret =3D rk3308_soc_data_init(info); > if (ret) [Severity: Medium] Will rk3308_io_voltage_domains() and rk3308_soc_data_init() be skipped if rockchip_pinctrl_probe() defers or is re-run on an RK3308B? ctrl points to the static rk3308_pin_ctrl structure, and rk3308_soc_data_init() mutates ctrl->type in place to RK3308B when it reads chip_id 0x3308 or 0x3308c. If probe later fails or defers (for example when looking up per-bank rockchip,grf syscons or registering the pinctrl device), the next probe attempt sees ctrl->type =3D=3D RK3308B and skips both blocks. Running rk3308_io_voltage_domains() before rk3308_soc_data_init() also writes RK3308_SOC_CON0 before RK3308_GRF_CHIP_ID has been validated. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/tencent_9AD984A6BE6= 0BE89025645C689A413032507@qq.com?part=3D2