From: "Artur Andrzejczak" <andrzejczak.artur@gmail.com>
To: "Dumitru Ceclan" <dumitru.ceclan@analog.com>,
"Tomi Valkeinen" <tomi.valkeinen+renesas@ideasonboard.com>,
"Mauro Carvalho Chehab" <mchehab@kernel.org>,
"Sakari Ailus" <sakari.ailus@linux.intel.com>,
"Laurent Pinchart" <laurent.pinchart@ideasonboard.com>,
"Julien Massot" <julien.massot@collabora.com>,
"Rob Herring" <robh@kernel.org>,
"Niklas Söderlund" <niklas.soderlund@ragnatech.se>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
Cc: mitrutzceclan@gmail.com, linux-media@vger.kernel.org,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
linux-staging@lists.linux.dev, linux-gpio@vger.kernel.org,
"Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>,
"Martin Hecht" <Martin.Hecht@avnet.eu>,
"Andrian Suciu" <Adrian.Suciu@analog.com>,
"Cosmin Tanislav" <demonsingur@gmail.com>
Subject: Re: [PATCH v15 16/22] media: i2c: maxim-serdes: add MAX96717 driver
Date: Wed, 19 Aug 2026 16:21:14 +0200 [thread overview]
Message-ID: <DKSZJMQ4KJ2W.1HB8IJEZ9WDFX@gmail.com> (raw)
In-Reply-To: <20260807-gmsl2-3_serdes-v15-16-7212e9e5156a@analog.com>
I only went through the clock, pinctrl and CSI-2 lane code, not the
whole patch.
On Fri Aug 7, 2026 at 3:02 PM CEST, Dumitru Ceclan wrote:
> [...]
> + { "maxim,jitter-compensation", MAX96717_PINCTRL_JITTER_COMPENSATION_EN, 0 },
The automated review already raised this: maxim,jitter-compensation is a
boolean in the binding, so the property is present but zero length.
Reading a zero-length property as a u32 gives -EOVERFLOW.
pinconf-generic treats only -EINVAL as absent and substitutes the
default above on any other error, so 0 lands.
max96717_conf_pin_config_set_one() then takes the arg ? en_val : ~en_val
branch with arg == 0 and clears the bit. That means the property for
enabling jitter compensation never sets this bit, and nothing else in
the driver sets it either. Giving it a value does not help, since
maxim,jitter-compensation = <1> is rejected by the schema.
pinctrl-k210.c uses 1 for its boolean params. Should the default value
here be 1 as well?
> [...]
> + /* Configure a lane count. */
> + ret = regmap_update_bits(priv->regmap, MAX96717_MIPI_RX1,
> + MAX96717_MIPI_RX1_CTRL_NUM_LANES,
> + FIELD_PREP(MAX96717_MIPI_RX1_CTRL_NUM_LANES,
> + num_data_lanes - 1));
max96717_init_phy() calculates num_data_lanes - 1 without
checking for zero. The binding requires data-lanes, so this needs a
non-conforming DT, but the driver removed in patch 21 still rejected it
with "Invalid data lanes must be 1 to 4". Here num_data_lanes remains 0
and the write sets 0b11, so the count becomes four, silently.
max_ser_find_phys_config() compares num_data_lanes against the single
{ 4 } entry in max96717_phys_configs, so zero passes there too. The
automated review asked about the upper bound on this line, this is the
lower one. Shall the range check come back?
> [...]
> + val = FIELD_PREP(MAX96717_REF_VTG0_REFGEN_PREDEF_FREQ,
> + predef_freq->val);
> +
> + if (predef_freq->is_alt)
> + val |= MAX96717_REF_VTG0_REFGEN_PREDEF_FREQ_ALT;
> + if (!predef_freq->is_rclk)
> + val |= MAX96717_REF_VTG0_REFGEN_EN;
> +
> + val |= MAX96717_REF_VTG0_REFGEN_RST;
> +
> + ret = regmap_write(priv->regmap, MAX96717_REF_VTG0, val);
max96717_clk_set_rate() sets REFGEN_PREDEF_FREQ and its ALT bit, but not
the predefined frequency enable bit. The REF_VTG0 defines stop at
PREDEF_FREQ. Bit 6 is not part of the composed value, and this is a full
regmap_write(), so the write clears it. The driver removed in patch 21
sets REFGEN_PREDEF_EN (BIT(6)) in its own write of that register, with
the same encodings for the six rates the two tables share. Currently,
that bit is left 0 on every rate that goes through REFGEN, including the
24 MHz default programmed at probe. The datasheet has REFGEN_PREDEF_EN
reset to 1, and describes REF_VTG4/5 as the feedback divider fraction
used when predefined mode is disabled, which this driver never writes.
Was that on purpose, or should it be set here too?
> [...]
> +static int max96717_register_clkout(struct max96717_priv *priv)
> +{
> + struct device *dev = &priv->client->dev;
> + struct clk_init_data init = { .ops = &max96717_clk_ops };
> + int ret;
> +
> + ret = max96717_mux_set_rclkout(priv, MAX96717_RCLK_MFP);
> + if (ret)
> + return ret;
max96717_register_clkout() routes RCLKOUT to mfp4 and sets that pin to
the fastest slew rate. It runs after max96717_gpiochip_probe(), which
calls pinctrl_enable(), so at that time the pin setup from the max96717
node itself has already been applied. The binding in patch 03 allows
function = "rclkout" on mfp2, so a config that asks for the RCLK there
gets it, but loses it a few lines later: max96717_mux_set_rclkout()
clears RCLK_ALT for any group other than mfp2. A slew rate set on mfp4
is overwritten the same way. Should this leave alone a mux state that
pinctrl has already selected?
Moreover, the driver names seven slew fields for eleven pins. The
binding allows slew-rate on every pin, but max96717_get_pin_config_reg()
returns -EINVAL for it on mfp5, mfp6, mfp9 and mfp10, so a slew-rate
that passes the schema on one of those four makes pinctrl_select_state()
fail. Another device pointing its pinctrl-0 at such a node fails to
probe, since pinctrl_bind_pins() returns -EINVAL. On the max96717 node
itself it does not: pinctrl_claim_hogs() logs the error and returns 0.
Either way pinctrl_commit_state() stops at the failing setting, so the
pin configs after it are never applied. Table 13 in the datasheet lists
no pin slew for mfp5, mfp6, mfp9 and mfp10, so the driver looks right
here. Should the binding restrict slew-rate to the seven pins that have
the field?
Kind Regards,
Artur Andrzejczak
next prev parent reply other threads:[~2026-08-19 14:28 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-07 13:02 [PATCH v15 00/22] media: i2c: add Maxim GMSL2/3 serializer and deserializer drivers Dumitru Ceclan via B4 Relay
2026-08-07 13:02 ` [PATCH v15 01/22] media: mc: Add INTERNAL pad flag Dumitru Ceclan via B4 Relay
2026-08-07 13:02 ` [PATCH v15 02/22] dt-bindings: media: i2c: max96717: add support for I2C ATR Dumitru Ceclan via B4 Relay
2026-08-07 13:02 ` [PATCH v15 03/22] dt-bindings: media: i2c: max96717: add support for pinctrl/pinconf Dumitru Ceclan via B4 Relay
2026-08-07 13:02 ` [PATCH v15 04/22] dt-bindings: media: i2c: max96717: add support for MAX9295A Dumitru Ceclan via B4 Relay
2026-08-07 13:02 ` [PATCH v15 05/22] dt-bindings: media: i2c: max96717: add support for MAX96793 Dumitru Ceclan via B4 Relay
2026-08-07 13:02 ` [PATCH v15 06/22] dt-bindings: media: i2c: max96712: use pattern properties for ports Dumitru Ceclan via B4 Relay
2026-08-07 13:02 ` [PATCH v15 07/22] dt-bindings: media: i2c: max96712: add support for I2C ATR Dumitru Ceclan via B4 Relay
2026-08-07 13:02 ` [PATCH v15 08/22] dt-bindings: media: i2c: max96712: add support for POC supplies Dumitru Ceclan via B4 Relay
2026-08-07 13:02 ` [PATCH v15 09/22] dt-bindings: media: i2c: max96712: add support for MAX96724F/R Dumitru Ceclan via B4 Relay
2026-08-07 13:02 ` [PATCH v15 10/22] dt-bindings: media: i2c: max96712: add control-channel-port property Dumitru Ceclan via B4 Relay
2026-08-07 13:02 ` [PATCH v15 11/22] dt-bindings: media: i2c: max96714: add support for MAX96714R Dumitru Ceclan via B4 Relay
2026-08-07 13:02 ` [PATCH v15 12/22] dt-bindings: media: i2c: add MAX9296A, MAX96716A, MAX96792A Dumitru Ceclan via B4 Relay
2026-08-07 13:02 ` [PATCH v15 13/22] media: i2c: add Maxim GMSL2/3 serializer and deserializer framework Dumitru Ceclan via B4 Relay
2026-08-07 13:02 ` [PATCH v15 14/22] media: i2c: add Maxim GMSL2/3 serializer framework Dumitru Ceclan via B4 Relay
2026-08-17 21:37 ` Artur Andrzejczak
2026-08-07 13:02 ` [PATCH v15 15/22] media: i2c: add Maxim GMSL2/3 deserializer framework Dumitru Ceclan via B4 Relay
2026-08-17 21:39 ` Artur Andrzejczak
2026-08-07 13:02 ` [PATCH v15 16/22] media: i2c: maxim-serdes: add MAX96717 driver Dumitru Ceclan via B4 Relay
2026-08-19 14:21 ` Artur Andrzejczak [this message]
2026-08-07 13:02 ` [PATCH v15 17/22] media: i2c: maxim-serdes: add MAX96724 driver Dumitru Ceclan via B4 Relay
2026-08-17 21:39 ` Artur Andrzejczak
2026-08-07 13:02 ` [PATCH v15 18/22] media: i2c: maxim-serdes: add MAX9296A driver Dumitru Ceclan via B4 Relay
2026-08-17 21:40 ` Artur Andrzejczak
2026-08-07 13:02 ` [PATCH v15 19/22] arm64: defconfig: disable deprecated MAX96712 driver Dumitru Ceclan via B4 Relay
2026-08-07 13:02 ` [PATCH v15 20/22] staging: media: remove " Dumitru Ceclan via B4 Relay
2026-08-07 13:02 ` [PATCH v15 21/22] media: i2c: remove MAX96717 driver Dumitru Ceclan via B4 Relay
2026-08-07 13:02 ` [PATCH v15 22/22] media: i2c: remove MAX96714 driver Dumitru Ceclan via B4 Relay
2026-08-17 21:41 ` [PATCH v15 00/22] media: i2c: add Maxim GMSL2/3 serializer and deserializer drivers Artur Andrzejczak
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=DKSZJMQ4KJ2W.1HB8IJEZ9WDFX@gmail.com \
--to=andrzejczak.artur@gmail.com \
--cc=Adrian.Suciu@analog.com \
--cc=Martin.Hecht@avnet.eu \
--cc=demonsingur@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=dumitru.ceclan@analog.com \
--cc=gregkh@linuxfoundation.org \
--cc=julien.massot@collabora.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=mchehab@kernel.org \
--cc=mitrutzceclan@gmail.com \
--cc=niklas.soderlund+renesas@ragnatech.se \
--cc=niklas.soderlund@ragnatech.se \
--cc=robh@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=tomi.valkeinen+renesas@ideasonboard.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