Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: SignKirigami <prcups@krgm.moe>
Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
	robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v3 2/2] pinctrl: qcom: Add Netrani TLMM support
Date: Thu, 26 Nov 2026 16:35:24 +0000	[thread overview]
Message-ID: <sashiko-outbox-235923@kernel.org> (raw)
In-Reply-To: <20261127-netrani-tlmm-v3-v3-2-3bf3f0bbe5df@krgm.moe>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] pinctrl: qcom: netrani: unadjusted 0x100000 wrapper offset in
  pingroups
- [Medium] pinctrl: qcom: netrani: unconsolidated per-lane pinmux
  function definitions
--

commit d9ae167fc0b9ebbc2ea8d3381996a68bd5e63e3d
Author: SignKirigami <prcups@krgm.moe>

pinctrl: qcom: Add Netrani TLMM support

This commit adds the Qualcomm Netrani TLMM pin controller driver, defining
pin groups, mux functions, and the PDC wake interrupt map.

> diff --git a/drivers/pinctrl/qcom/pinctrl-netrani.c b/drivers/pinctrl/qcom/pinctrl-netrani.c
> new file mode 100644
> index 0000000000000..75ecef4c8ad79
> --- /dev/null
> +++ b/drivers/pinctrl/qcom/pinctrl-netrani.c
> @@ -0,0 +1,2093 @@
[ ... ]
> +#include "pinctrl-msm.h"
> +
> +#define REG_BASE 0x100000
> +#define REG_SIZE 0x1000
> +
> +#define PINGROUP(id, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11)	\
> +	{					        \
> +		.grp = PINCTRL_PINGROUP("gpio" #id,     \
> +			gpio##id##_pins,                \
> +			ARRAY_SIZE(gpio##id##_pins)),   \
> +		.funcs = (int[]){			\
> +			msm_mux_gpio, /* gpio mode */	\
> +			msm_mux_##f1,			\
> +			msm_mux_##f2,			\
> +			msm_mux_##f3,			\
> +			msm_mux_##f4,			\
> +			msm_mux_##f5,			\
> +			msm_mux_##f6,			\
> +			msm_mux_##f7,			\
> +			msm_mux_##f8,			\
> +			msm_mux_##f9,			\
> +			msm_mux_##f10,			\
> +			msm_mux_##f11			\
> +		},				        \
> +		.nfuncs = 12,				\
> +		.ctl_reg = REG_BASE + REG_SIZE * id,			\
> +		.io_reg = REG_BASE + 0x4 + REG_SIZE * id,		\
> +		.intr_cfg_reg = REG_BASE + 0x8 + REG_SIZE * id,		\
> +		.intr_status_reg = REG_BASE + 0xc + REG_SIZE * id,	\

[Severity: Medium]
Should REG_BASE be 0x0 and the UFS_RESET / SDC_QDSD_PINGROUP offsets in
netrani_groups[] drop the 0x100000 wrapper offset (using 0x9c000, 0x91004,
0x91000, and 0x94000 instead of 0x19c000, 0x191004, 0x191000, and 0x194000)?

Upstream Qualcomm TLMM drivers use offsets relative to the OS-accessible TLMM
register window (0x0f100000 on sibling SM4450) rather than the 1 MB wrapper
base.  Including the 0x100000 offset shifts all GPIO, SDC, and UFS register
accesses by +0x100000 when paired with a standard pinctrl@f100000 Device Tree
node, and breaks drivers/pinctrl/qcom/tlmm-test.c which computes GPIO
addresses as tlmm_suite.base + tlmm_test_gpio * 0x1000 assuming GPIO 0 starts
at offset 0x0.

[ ... ]

> +static const char * const qup0_se3_l0_groups[] = {
> +	"gpio37",
> +};
> +
> +static const char * const qup0_se3_l1_groups[] = {
> +	"gpio36",
> +};
> +
> +static const char * const qup0_se3_l2_groups[] = {
> +	"gpio22",
> +};
> +
> +static const char * const qup0_se3_l3_groups[] = {
> +	"gpio23",
> +};

[Severity: Medium]
Should per-lane and per-signal mux functions such as qup0_se0_l0..l3 through
qup1_se5_l0..l3, phase_flag_status0..31, qdss_gpio_tracedata0..15,
cci_i2c_scl0..3, cci_i2c_sda0..3, atest_char_status0..3,
atest_usb0_testdataout00..03, cmu_rng_entropy0..3, tmess_prng_rosc0..3,
prng_rosc_test0..3, and qspi0..3 be consolidated into per-function groups
(e.g., qup0_se0..qup0_se5, qup1_se0..qup1_se5, phase_flag, qdss_gpio,
cci_i2c, atest_char, atest_usb0, cmu_rng, tmess_prng, prng_rosc, and
qspi_data)?

Every QUP SE in netrani_groups[] has at most one lane on any given pin, and
exposing separate single-pin functions prevents Device Tree nodes from
configuring multi-pin peripheral states under a single function name.  For
example, the companion binding example in
Documentation/devicetree/bindings/pinctrl/qcom,netrani-tlmm.yaml assigns
qup0_se3_l2 to gpio23 and qup0_se3_l3 to gpio22, which fails pinmux mapping
with -EINVAL at runtime because qup0_se3_l2_groups only contains gpio22 and
qup0_se3_l3_groups only contains gpio23.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261127-netrani-tlmm-v3-v3-0-3bf3f0bbe5df@krgm.moe?part=2

      reply	other threads:[~2026-11-26 16:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26 16:19 [PATCH v3 0/2] pinctrl: qcom: Add Netrani TLMM support SignKirigami
2026-11-26 16:19 ` [PATCH v3 1/2] dt-bindings: pinctrl: Add Qualcomm Netrani TLMM SignKirigami
2026-11-26 16:34   ` sashiko-bot
2026-11-26 16:19 ` [PATCH v3 2/2] pinctrl: qcom: Add Netrani TLMM support SignKirigami
2026-11-26 16:35   ` sashiko-bot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-235923@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=prcups@krgm.moe \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox