Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Venkat Yadlapati" <venkat.yadlapati@yahoo.com>
Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
	robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH 2/2] pinctrl: qcom: Add Molokai TLMM driver
Date: Sun, 15 Nov 2026 20:34:37 +0000	[thread overview]
Message-ID: <sashiko-outbox-215839@kernel.org> (raw)
In-Reply-To: <20261116-molokai-tlmm-v1-2-3ba4840002cb@yahoo.com>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [High] pinctrl: qcom: molokai uses MSM_PIN_FUNCTION() for egpio
- [High] pinctrl: qcom: molokai PINGROUP() omits intr_target_width = 4
--

commit e5d14e99015da685768f438aabdb5849901661b6
Author: Venkat Yadlapati <venkat.yadlapati@yahoo.com>

pinctrl: qcom: Add Molokai TLMM driver

This commit adds the pinctrl, pinmux, pinconf, and gpiolib driver for the
TLMM block on the Qualcomm Molokai (SM8845) SoC.

> diff --git a/drivers/pinctrl/qcom/pinctrl-molokai.c b/drivers/pinctrl/qcom/pinctrl-molokai.c
> new file mode 100644
> index 0000000000000..80763dce895be
> --- /dev/null
> +++ b/drivers/pinctrl/qcom/pinctrl-molokai.c
> @@ -0,0 +1,1679 @@
[ ... ]
> +#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 /* egpio mode */	\
> +		},					\
> +		.nfuncs = 12,				\
> +		.ctl_reg = REG_SIZE * id,		\
> +		.io_reg = 0x4 + REG_SIZE * id,		\
> +		.intr_cfg_reg = 0x8 + REG_SIZE * id,	\
> +		.intr_status_reg = 0xc + REG_SIZE * id,	\
> +		.mux_bit = 2,			\
> +		.pull_bit = 0,			\
> +		.drv_bit = 6,			\
> +		.i2c_pull_bit = 13,		\
> +		.egpio_enable = 12,		\
> +		.egpio_present = 11,		\
> +		.oe_bit = 9,			\
> +		.in_bit = 0,			\
> +		.out_bit = 1,			\
> +		.intr_enable_bit = 0,		\
> +		.intr_status_bit = 0,		\
> +		.intr_wakeup_present_bit = 6,	\
> +		.intr_wakeup_enable_bit = 7,	\
> +		.intr_target_bit = 8,		\
> +		.intr_target_kpss_val = 3,	\
> +		.intr_raw_status_bit = 4,	\
> +		.intr_polarity_bit = 1,		\
> +		.intr_detection_bit = 2,	\
> +		.intr_detection_width = 2,	\
> +	}

[Severity: High]
Should PINGROUP() set .intr_target_width = 4?

Without intr_target_width, msm_gpio_irq_set_type() defaults to a 3-bit mask
(GENMASK(2, 0)).  In this TLMM register layout, TARGET_PROC occupies bits
11:8 and resets to 0xf (NONE), so clearing only bits 10:8 leaves bit 11 set
and writes 0xb instead of 0x3, misrouting all GPIO interrupts handled via
the TLMM summary interrupt path (the same issue fixed in commits
68ab4a6a84b9 ("pinctrl: qcom: nord: fix GPIO interrupt target width") and
1e7b04c12c07 ("pinctrl: qcom: shikra: Fix intr_target_width for summary
interrupt routing")).

[ ... ]

> +static const struct pinfunction molokai_functions[] = {
> +	MSM_GPIO_PIN_FUNCTION(gpio),
[ ... ]
> +	MSM_PIN_FUNCTION(dp_hot),
> +	MSM_PIN_FUNCTION(egpio),
> +	MSM_PIN_FUNCTION(gcc_gp1),

[Severity: High]
Should egpio in molokai_functions[] use MSM_GPIO_PIN_FUNCTION(egpio) instead
of MSM_PIN_FUNCTION(egpio)?

msm_pinmux_ops sets .strict = true and .function_is_gpio =
pinmux_generic_function_is_gpio.  Because MSM_PIN_FUNCTION() does not set
PINFUNCTION_FLAG_GPIO, pin_request() rejects any GPIO request on a pin muxed
to egpio with -EINVAL (as fixed across other Qualcomm TLMM drivers in
commits 480dc1952404 ("pinctrl: qcom: mark the `gpio` and `egpio` pins
function as non-strict functions") and e73fda2dcb0b ("pinctrl: qcom: glymur:
Fix the gpio and egpio pin functions")).

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261116-molokai-tlmm-v1-0-3ba4840002cb@yahoo.com?part=2

      reply	other threads:[~2026-11-15 20:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-15 20:19 [PATCH 0/2] pinctrl: qcom: Add the Molokai TLMM Venkat Yadlapati via B4 Relay
2026-11-15 20:19 ` [PATCH 1/2] dt-bindings: pinctrl: qcom: Add " Venkat Yadlapati via B4 Relay
2026-11-15 20:25   ` sashiko-bot
2026-11-15 20:19 ` [PATCH 2/2] pinctrl: qcom: Add Molokai TLMM driver Venkat Yadlapati via B4 Relay
2026-11-15 20:34   ` 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-215839@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=venkat.yadlapati@yahoo.com \
    /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