| Message ID | 20261026144751.1392715-1-hsyysy@163.com (mailing list archive) |
|---|---|
| State | New |
| Headers |
Return-Path: <linux-sunxi+bounces-26901-sunxi=pue.re@lists.linux.dev> X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 80F721C1FD6 for <noreply@patchwork.local>; Mon, 26 Oct 2026 15:48:58 +0100 (CET) Authentication-Results: mxe881; dkim=pass header.d=163.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-26901-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-26901-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id B70D02744B for <noreply@patchwork.local>; Mon, 26 Oct 2026 14:48:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.remote-ip=127.0.0.1 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=fail; t=1793026124; b=smsMmVH8vo5trkqVGmiEiFcpjfUUuNexG4tbeAX968DdpZtWjvizT5ZkMYg/dcSWwdmQ bkUVsF+QVtpYKzQ2Lj1G+0cgXB45Vtx+R186WAS/f6VmeaV4cEBvqNEoTNqeSKs5dEVIj Xwy9tPQ5FU+Boh8b67b1bBSXZ3wMXZw90/2Zc0VtAwfMLiFxzW4SHPbJSGeg15TJunxGk WYZFtSjMrFwq+VRNn4/ePj15WgF1ukeCuAzKB8zORphuqGGU2rO49qdxYzz1NcbgS75I6 EPWXNCVZPrJ3iJFqcUJCcNaTMBoUHqw9X/wMvzfjn7Qkde8KS+rE7/6YCt2N7StzMBg== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793026124; h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:From:To: Cc:Subject:Date:Message-ID:X-Mailer:X-Mailing-List:List-Id:List-Post: List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence: MIME-Version:Content-Transfer-Encoding:X-CM-TRANSID: X-Coremail-Antispam:X-CM-SenderInfo; bh=YvL7WO9Qw1q6ibNOgJWDcAWvN4SLSOgyAvGF80Zshr4=; b=FnGDq7cMPd1gegWkMs3DqYzavK7qaItRfF1EL0Ui0LBoDMekFoTVCwAkWFpzEjyFTDWp hkqNW8ABy5+nRBCx08jRYSHAGcTAz+kFqj/ZDCYEUW9Myds8PFM6KxE/CFKUaz3YDPE9z mwm7jmRIkw6YZkKvmF0jOLQJMjjE2YtO6qUdRQV1mkQLUVo8IO5iER7Y+giSH7GIR1P/1 kwfrbzwmmi489yXUsdxrDFRW/TyApQGNZMyduQL158ZiI+Pvz66RTSyY1OI+L12AZcgs0 VKMMLsYiJnVBEYbHM1eaaqKOuusECVQeN0vMidlztllkUJ+SRRs8WZ7huuq0wXX3EzA== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=163.com header.i=@163.com header.a=rsa-sha256 header.s=s110527 header.b=jUES+ATa; dmarc=pass header.from=163.com; spf=pass smtp.mailfrom=163.com; arc=fail smtp.remote-ip=127.0.0.1 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4FBC8606A31A; Mon, 26 Oct 2026 14:48:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=163.com header.i=@163.com header.a=rsa-sha256 header.s=s110527 header.b=jUES+ATa X-Original-To: linux-sunxi@lists.linux.dev Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=220.197.31.2 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793026124; b=YQ6r4T4aYsXtErxosGbYhITJ6opBMXeZWuoVSEVaBIrtPdAyYyIqAcZQUstYmPca5db9 jUdD0KQpjrZQZYHuHpXqj/fJ8iIgTes+6WLhm/G5q8stCo5ANk4woUnv+MQH/gtGE8UIj BREAOsWPq+oKjoeDz1r85qiJGJGSag+WoCriLNp1AsrJ4t3/swxFohej2u/oCwRyqAJWh hMhTpFzt29iY6aTI9EqNs+8W2iTdXuZ4p74EXFSHZzEtifyzyovk7IXJy1jjdvE9spDLs 45EBh26iE07okfBdnIro19RxLtd3mIS8Yeh06a83+NRexsTDQYOwrFf9wXujTzukwAA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793026124; h=DMARC-Filter:DKIM-Signature:Received:From:To:Cc:Subject:Date: Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding: X-CM-TRANSID:X-Coremail-Antispam:X-Originating-IP:X-CM-SenderInfo; bh=YvL7WO9Qw1q6ibNOgJWDcAWvN4SLSOgyAvGF80Zshr4=; b=10wkC05s01nhHNgdZ8Dy1DfwsOHA4ynrfp4EYUxA9t1iuVOMg1QxcwTaQ4qPBEQMKLD6 NfU+XmQ0p+uETvLLxpucZT9DiJG2jqIRPZ6+Mcead3uGH8v4hFcVgsf/wSdQTfgHL1W76 XSYN+ll8doJtj8pS9RfE/UPwaC33G6d6ko1B2u7MOYWNEL1syN2MIy7FnssCCzUWD5804 fvp5YZqwCnUtGrL5M+tADH8HYpP9QqHjwAzaKzqM8rQoAj3CcigdxrwFq9NjaIqNh3PkE Ovh1eEJDihLB4l2IVFlov8jLNtcr+fEGCarKpv4RAeFeMz+H2bpZvgOkFhfleKinTvQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass header.d=163.com header.i=@163.com header.a=rsa-sha256 header.s=s110527 header.b=jUES+ATa; arc=none smtp.remote-ip=220.197.31.2 Received: from m16.mail.163.com (m16.mail.163.com [220.197.31.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96EE9606A32D for <linux-sunxi@lists.linux.dev>; Mon, 26 Oct 2026 14:48:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 96EE9606A32D Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=Yv L7WO9Qw1q6ibNOgJWDcAWvN4SLSOgyAvGF80Zshr4=; b=jUES+ATay1UNY6Zu+4 877kKgw2yEEO1AaQJzGqdbxkzFiFt7ddfiQfdLBN87IxnIu9Yx73HAWjjBAyPTGM S4/TfyoaZfCA96ynYMu8n8cG5xvBE0LdPNl8esffgPx54Y0bgQMvdkziRKKEr/BM 3FGoHnjBJmDZvR7IcvUFDJGtE= Received: from SYPC (unknown []) by gzsmtp2 (Coremail) with SMTP id PSgvCgA36gkvaN9qPCpOCA--.62724S2; Mon, 26 Oct 2026 22:48:16 +0800 (CST) From: hsyysy@163.com To: Linus Walleij <linusw@kernel.org> Cc: Chen-Yu Tsai <wens@kernel.org>, Jernej Skrabec <jernej.skrabec@gmail.com>, Samuel Holland <samuel@sholland.org>, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Yang Siyuan <hsyysy@163.com> Subject: [PATCH] pinctrl: sunxi: skip unused per-bank supply on controllers without IO bias Date: Mon, 26 Oct 2026 22:47:51 +0800 Message-ID: <20261026144751.1392715-1-hsyysy@163.com> X-Mailer: git-send-email 2.56.0 X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: <linux-sunxi.lists.linux.dev> List-Post: <mailto:linux-sunxi@lists.linux.dev> List-Help: <mailto:linux-sunxi+help@lists.linux.dev> List-Subscribe: <mailto:linux-sunxi+subscribe@lists.linux.dev> List-Unsubscribe: <mailto:linux-sunxi+unsubscribe@lists.linux.dev> List-Owner: <mailto:linux-sunxi+owner@lists.linux.dev> Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: PSgvCgA36gkvaN9qPCpOCA--.62724S2 X-Coremail-Antispam: 1Uf129KBjvJXoWxJr17Kr1xAw1kZF1ktr1fWFg_yoW8ur4rpF sxXFyayr18XF4aqwsrC34ayFy3Gan7G34fCF48KryrXFsxCan8ury2kryrKF4kGrZ5Xr4Y qrZ8ZasFgFn8XaDanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pi2NtOUUUUU= X-CM-SenderInfo: 5kv152r16rljoofrz/xtbC7hC47GrfaDABZAAA3i X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= |
| Series |
pinctrl: sunxi: skip unused per-bank supply on controllers without IO bias
|
|
Commit Message
Yang Siyuan
Oct. 26, 2026, 2:47 p.m. UTC
From: Yang Siyuan <hsyysy@163.com> sunxi_pmx_request() always requests the "vcc-pX" regulator of the pin's bank, but that supply is only consumed by sunxi_pinctrl_set_io_bias_cfg(). Controllers without io_bias_cfg_variant never use it, so the request only makes the regulator core warn: sun50i-h616-r-pinctrl 7022000.pinctrl: supply vcc-pl not found, using dummy regulator The H616 R_PIO is such a controller, and its PL0/PL1 pins drive the R_I2C bus, so every H616 board hits the warning during boot. Return early when the controller cannot configure the IO bias voltage, and teach the free path that no supply was requested for that bank. Signed-off-by: Yang Siyuan <hsyysy@163.com> --- drivers/pinctrl/sunxi/pinctrl-sunxi.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) base-commit: 091b06388b117fefdcb63336ac09956a4914b961
Comments
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] pinctrl: sunxi: sunxi_pmx_request() skips enabling per-bank power supplies -- commit 9182c2f5356e50617749f1a17d156851c7683cd0 Author: Yang Siyuan <hsyysy@163.com> pinctrl: sunxi: skip unused per-bank supply on controllers without IO bias This commit skips requesting the per-bank "vcc-pX" regulator in sunxi_pmx_request() and freeing it in sunxi_pmx_free() when pctl->desc->io_bias_cfg_variant is not set, in order to silence missing supply warnings on controllers without IO bias configuration such as the H616 R_PIO. > diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c > index 31cd142ce0f79..4b877ec1e1836 100644 > --- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c > +++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c > @@ -924,6 +924,15 @@ static int sunxi_pmx_request(struct pinctrl_dev *pctldev, unsigned offset) > return 0; > } > > + /* > + * The per-bank supply is only used to configure the IO bias voltage. > + * Controllers without bias configuration (e.g. the H616 R_PIO) have no > + * supply to request, and asking for one only makes the regulator core > + * warn about the missing regulator for every bank in use. > + */ > + if (!pctl->desc->io_bias_cfg_variant) > + return 0; > + > snprintf(supply, sizeof(supply), "vcc-p%c", 'a' + bank); > reg = regulator_get(pctl->dev, supply); > if (IS_ERR(reg)) [Severity: High] Does returning early in sunxi_pmx_request() when !pctl->desc->io_bias_cfg_variant break per-bank power supply enabling on SoCs without software-configurable IO bias registers? In sunxi_pmx_request(), the per-bank "vcc-pX" supply is not only passed to sunxi_pinctrl_set_io_bias_cfg(), but is also enabled via regulator_enable() to power the physical pin bank while its pins are requested (originally added in commit 9a2a566adb00 ("pinctrl: sunxi: Deal with per-bank regulators") before IO bias configuration support in commit 402bfb3c1352): drivers/pinctrl/sunxi/pinctrl-sunxi.c:sunxi_pmx_request() { ... snprintf(supply, sizeof(supply), "vcc-p%c", 'a' + bank); reg = regulator_get(pctl->dev, supply); if (IS_ERR(reg)) return dev_err_probe(pctl->dev, PTR_ERR(reg), "Couldn't get bank P%c regulator\n", 'A' + bank); ret = regulator_enable(reg); if (ret) { dev_err(pctl->dev, "Couldn't enable bank P%c regulator\n", 'A' + bank); goto out; } sunxi_pinctrl_set_io_bias_cfg(pctl, offset, reg); ... } Most Allwinner pinctrl descriptors leave io_bias_cfg_variant as 0 (BIAS_VOLTAGE_NONE), including sun4i_a10_pinctrl_data in drivers/pinctrl/sunxi/pinctrl-sun4i-a10.c (used for A10, A20, R40, V40), a64_pinctrl_data in drivers/pinctrl/sunxi/pinctrl-sun50i-a64.c, and sun8i_v3s_pinctrl_data in drivers/pinctrl/sunxi/pinctrl-sun8i-v3s.c: drivers/pinctrl/sunxi/pinctrl-sun50i-a64.c: static const struct sunxi_pinctrl_desc a64_pinctrl_data = { .pins = a64_pins, .npins = ARRAY_SIZE(a64_pins), .irq_banks = 3, }; However, boards using those SoCs wire physical per-bank VCC-Px rails to switchable, non-always-on PMIC regulators via vcc-pX-supply in Device Tree, such as arch/arm/boot/dts/allwinner/sun8i-r40-bananapi-m2-ultra.dts: &pio { pinctrl-names = "default"; pinctrl-0 = <&clk_out_a_pin>; vcc-pa-supply = <®_aldo2>; vcc-pc-supply = <®_dcdc1>; vcc-pd-supply = <®_dcdc1>; vcc-pe-supply = <®_eldo1>; vcc-pf-supply = <®_dcdc1>; vcc-pg-supply = <®_dldo1>; }; ®_aldo2 { regulator-min-microvolt = <2500000>; regulator-max-microvolt = <2500000>; regulator-name = "vcc-pa"; }; Similar non-always-on per-bank supplies are used on A64 boards (such as sun50i-a64-pinephone.dtsi, sun50i-a64-pinebook.dts, sun50i-a64-olinuxino.dts, and sun50i-a64-teres-i.dts for vcc-pd-supply, vcc-pe-supply, and vcc-pg-supply), A20 boards (sun7i-a20-olinuxino-lime2.dts), and S3 boards (sun8i-s3-pinecube.dts). If sunxi_pmx_request() skips regulator_get() and regulator_enable() when !pctl->desc->io_bias_cfg_variant, won't these per-bank regulators remain unenabled (or be disabled as unused at late_initcall by regulator_init_complete()), cutting power to active pin banks and attached peripherals?
diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c index 70099052d..a5222cfbd 100644 --- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c +++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c @@ -924,6 +924,15 @@ static int sunxi_pmx_request(struct pinctrl_dev *pctldev, unsigned offset) return 0; } + /* + * The per-bank supply is only used to configure the IO bias voltage. + * Controllers without bias configuration (e.g. the H616 R_PIO) have no + * supply to request, and asking for one only makes the regulator core + * warn about the missing regulator for every bank in use. + */ + if (!pctl->desc->io_bias_cfg_variant) + return 0; + snprintf(supply, sizeof(supply), "vcc-p%c", 'a' + bank); reg = regulator_get(pctl->dev, supply); if (IS_ERR(reg)) @@ -959,6 +968,10 @@ static int sunxi_pmx_free(struct pinctrl_dev *pctldev, unsigned offset) PINS_PER_BANK; struct sunxi_pinctrl_regulator *s_reg = &pctl->regulators[bank_offset]; + /* No supply was requested for this bank (no IO bias configuration). */ + if (!s_reg->regulator) + return 0; + if (!refcount_dec_and_test(&s_reg->refcount)) return 0;