Re: [PATCH v6 4/5] pinctrl: freescale: add the Layerscape RCW pad-mux driver

From: Vladimir Oltean

Date: Mon Nov 16 2026 - 16:15:36 EST


On Sun, Nov 15, 2026 at 02:27:34PM +0100, Vincent Jardin via B4 Relay wrote:
> +static const struct rcw_pmux_func lx2160a_sdhc2_data74_funcs[] = {
> + RCW_PMUX_FUNC("sdhc", 0), RCW_PMUX_FUNC("gpio", 1),
> + RCW_PMUX_FUNC("i2c", 2), RCW_PMUX_FUNC("flexspi", 6),
> +};

The "i2c" and "gpio" functions of lx2160a_sdhc2_data74_funcs[] here
hides some real unpleasantness. These 4 pins either get all assigned to
I2C7_SCL, I2C7_SDA, I2C8_SCL, I2C8_SDA, or they get all assigned to GPIO.
But they cannot be assigned in pairs of two (or individually, i.o.w. not
in the granularity we need), which makes independent I2C bus recovery
practically impossible (i2c6 as I2C while i2c7 is as GPIO).

The way the code is currently written, the pin_request() call will fail here:

if ((!gpio_range || ops->strict) && !gpio_ok &&
desc->mux_usecount && strcmp(desc->mux_owner, owner)) {
dev_err(pctldev->dev,
"pin %s already requested by %s; cannot claim for %s\n",
desc->name, desc->mux_owner, owner);
goto out;
}

And even if it weren't for this core pinctrl rejection, there's still
the functional problem associated with I2C bus recovery independent of
another I2C controller, with whom you share a pinctrl group. Even
assuming that these two controllers are hacked to acquire a shared mutex
to serialize bus recovery operations of A with transfers of B, it's
still not enough, because B may be an I2C slave, and in that case, the
bus recovery of A will cause B to miss events.

Due to the fundamental issue of this limitation, I don't think it makes
sense to have the pinctrl states described in fsl-lx216x.dtsi for i2c6
and i2c7. Perhaps you could remove them in another change (either as a
follow-up, or another patch in v7 if you need to resend).