Linux GPIO subsystem development
 help / color / mirror / Atom feed
From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: vjardin@free.fr
Cc: Dong Aisheng <aisheng.dong@nxp.com>,
	 Fabio Estevam <festevam@gmail.com>, Frank Li <Frank.Li@nxp.com>,
	Jacky Bai <ping.bai@nxp.com>,
	 Pengutronix Kernel Team <kernel@pengutronix.de>,
	NXP S32 Linux Team <s32@nxp.com>,
	 Linus Walleij <linusw@kernel.org>, Rob Herring <robh@kernel.org>,
	 Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	 "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>,
	Shawn Guo <shawnguo@kernel.org>,
	 Sascha Hauer <s.hauer@pengutronix.de>,
	linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
	 linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	 linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev,
	Ioana Ciornei <ioana.ciornei@nxp.com>
Subject: Re: [PATCH v4 3/5] soc: fsl: guts: add the RCW override of any RCWSR
Date: Sat, 14 Nov 2026 23:47:13 +0200	[thread overview]
Message-ID: <avi9N8P34X5uel7a@skbuf> (raw)
In-Reply-To: <20261114-for-upstream-lx2160a-rcw-pinmux-v1-v4-3-eefcea066a55@free.fr>

Hi Vincent,

On Fri, Nov 13, 2026 at 05:39:05PM +0100, Vincent Jardin wrote:
> Hi Christophe, or Vladimir,
> 
> Le 08/11/26 11:06, Vincent Jardin via B4 Relay a écrit :
> > From: Vincent Jardin <vjardin@free.fr>
> > 
> > fsl_guts_rcw_rmw() only serves the SerDes lane modes. Export it for
> > other fields of the RCW:
> >  - fsl_guts_rcw_read() reads a status register
> >  - fsl_guts_rcw_override() changes fields of one under rcwcr_lock and
> >    waits for the status register to follow
> >  - fsl_guts_rcw_override_supported() tells whether the DCSR view of DCFG,
> >    which holds the override registers, is mapped
> 
> May I ask for your advise on this topic ?
> 
> I am looking for the review of this serie, then I'll adapt it
> for u-boot along with the integration of Linux.
> 
> thank you,
>   Vincent

Sorry for the late review. Responding here to your question on v3:
https://lore.kernel.org/lkml/avc9KbxQ4dxlibGQ@L30177.local/

I cannot agree with your API proposal. It exports to the rest of the
kernel a blanket API for RCW override of any RCWSR1-RCWSR31 register,
*including* the SerDes fields for which the fsl_guts module already
exposes an API. So with your proposal, what can be done with
fsl_guts_lane_set_mode() can also be (un)done with fsl_guts_rcw_override().
The possibilities of abusing this API design are endless, and I don't
want to have to deal with them when I can avoid them.

At a minimum, I would recommend renaming the API as fsl_guts_pmux_override(),
and make guts enforce which register fields it permits overriding via
this API. Example:

static const struct fsl_soc_pmux_mask lx2160a_pmux[] = {
	{ 12, GENMASK(29, 0) }, /* IIC2..SDHC1_DIR */
	{ 13, GENMASK(29, 0) }, /* SDHC2_DAT74..EVT43 */
	{ 14, GENMASK(10, 0) }, /* EVT20..IIC1 */
	{ 27, GENMASK(7, 0) },  /* EC1, EC2, USB_EXT, GTX_CLK, SDHC1_DS <- your series is missing these */
	{}
};

  parent reply	other threads:[~2026-11-14 21:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-14  9:12 [PATCH v4 0/5] lx2160a: change the pad muxes through the RCW override Vincent Jardin via B4 Relay
2026-11-14  9:12 ` [PATCH v4 1/5] dt-bindings: pinctrl: add the NXP LX2160A RCW pad mux Vincent Jardin via B4 Relay
2026-11-14  9:12 ` [PATCH v4 2/5] dt-bindings: soc: fsl: layerscape-dcfg: add the LX2160A pad-mux child Vincent Jardin via B4 Relay
2026-11-14  9:12 ` [PATCH v4 3/5] soc: fsl: guts: add the RCW override of any RCWSR Vincent Jardin via B4 Relay
2026-11-14  9:57   ` Christophe Leroy (CS GROUP)
2026-11-14 10:06     ` Vincent Jardin
2026-11-14 21:47   ` Vladimir Oltean [this message]
2026-11-14  9:12 ` [PATCH v4 4/5] pinctrl: freescale: add the LX2160A RCW pad-mux driver Vincent Jardin via B4 Relay
2026-11-14  9:12 ` [PATCH v4 5/5] arm64: dts: lx2160a: describe the pad muxes as the DCFG RCW override Vincent Jardin via B4 Relay

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=avi9N8P34X5uel7a@skbuf \
    --to=vladimir.oltean@nxp.com \
    --cc=Frank.Li@nxp.com \
    --cc=aisheng.dong@nxp.com \
    --cc=chleroy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=imx@lists.linux.dev \
    --cc=ioana.ciornei@nxp.com \
    --cc=kernel@pengutronix.de \
    --cc=krzk+dt@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=ping.bai@nxp.com \
    --cc=robh@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=s32@nxp.com \
    --cc=shawnguo@kernel.org \
    --cc=vjardin@free.fr \
    /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