From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Vincent Guittot <vincent.guittot@linaro.org>
Cc: vkoul@kernel.org, neil.armstrong@linaro.org, krzk+dt@kernel.org,
conor+dt@kernel.org, ciprianmarian.costea@oss.nxp.com,
s32@nxp.com, p.zabel@pengutronix.de, ghennadi.procopciuc@nxp.com,
bogdan-gabriel.roman@nxp.com, Ionut.Vicovan@nxp.com,
alexandru-catalin.ionita@nxp.com, linux-phy@lists.infradead.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org,
Frank.li@nxp.com
Subject: Re: [PATCH 2/4] phy: s32g: Add serdes subsystem phy
Date: Thu, 29 Jan 2026 11:17:37 +0000 [thread overview]
Message-ID: <aXtB0QcVOkE_hhny@shell.armlinux.org.uk> (raw)
In-Reply-To: <20260126092159.815968-3-vincent.guittot@linaro.org>
On Mon, Jan 26, 2026 at 10:21:57AM +0100, Vincent Guittot wrote:
> +/*
> + * Until now, there is no generic way to describe and set PCIe clock mode.
> + * PCIe controller uses the default CRNS = 0 mode.
> + */
> +enum pcie_phy_mode {
> + CRNS = 0, /* Common Reference Clock, No Spread Spectrum */
> + CRSS = 1, /* Common Reference Clock, Spread Spectrum */
> + SRNS = 2, /* Separate Reference Clock, No Spread Spectrum */
> + SRIS = 3 /* Separate Reference Clock, Spread Spectrum */
> +};
So this is a PCIe thing. If it's part of the driver's API, then it
should be common and not driver-private.
> +static inline bool is_pcie_phy_mode_valid(int mode)
> +{
> + switch (mode) {
> + case CRNS:
> + case CRSS:
> + case SRNS:
> + case SRIS:
> + return true;
> + default:
> + return false;
> + }
> +}
This checks that the submode is one of the PCIe private modes that this
driver wants to see.
> +
> +static int s32g_serdes_phy_set_mode_ext(struct phy *p,
> + enum phy_mode mode, int submode)
> +{
> + struct s32g_serdes *serdes = phy_get_drvdata(p);
> +
> + if (mode == PHY_MODE_PCIE)
> + return -EINVAL;
> +
> + if (!is_pcie_phy_mode_valid(submode))
> + return -EINVAL;
This checks for the PCIe submode, but notice the test immediately
above. PCIE mode is being rejected. So, this driver supports
everything else but PCIe.
That doesn't seem right.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
WARNING: multiple messages have this Message-ID (diff)
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Vincent Guittot <vincent.guittot@linaro.org>
Cc: vkoul@kernel.org, neil.armstrong@linaro.org, krzk+dt@kernel.org,
conor+dt@kernel.org, ciprianmarian.costea@oss.nxp.com,
s32@nxp.com, p.zabel@pengutronix.de, ghennadi.procopciuc@nxp.com,
bogdan-gabriel.roman@nxp.com, Ionut.Vicovan@nxp.com,
alexandru-catalin.ionita@nxp.com, linux-phy@lists.infradead.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org,
Frank.li@nxp.com
Subject: Re: [PATCH 2/4] phy: s32g: Add serdes subsystem phy
Date: Thu, 29 Jan 2026 11:17:37 +0000 [thread overview]
Message-ID: <aXtB0QcVOkE_hhny@shell.armlinux.org.uk> (raw)
In-Reply-To: <20260126092159.815968-3-vincent.guittot@linaro.org>
On Mon, Jan 26, 2026 at 10:21:57AM +0100, Vincent Guittot wrote:
> +/*
> + * Until now, there is no generic way to describe and set PCIe clock mode.
> + * PCIe controller uses the default CRNS = 0 mode.
> + */
> +enum pcie_phy_mode {
> + CRNS = 0, /* Common Reference Clock, No Spread Spectrum */
> + CRSS = 1, /* Common Reference Clock, Spread Spectrum */
> + SRNS = 2, /* Separate Reference Clock, No Spread Spectrum */
> + SRIS = 3 /* Separate Reference Clock, Spread Spectrum */
> +};
So this is a PCIe thing. If it's part of the driver's API, then it
should be common and not driver-private.
> +static inline bool is_pcie_phy_mode_valid(int mode)
> +{
> + switch (mode) {
> + case CRNS:
> + case CRSS:
> + case SRNS:
> + case SRIS:
> + return true;
> + default:
> + return false;
> + }
> +}
This checks that the submode is one of the PCIe private modes that this
driver wants to see.
> +
> +static int s32g_serdes_phy_set_mode_ext(struct phy *p,
> + enum phy_mode mode, int submode)
> +{
> + struct s32g_serdes *serdes = phy_get_drvdata(p);
> +
> + if (mode == PHY_MODE_PCIE)
> + return -EINVAL;
> +
> + if (!is_pcie_phy_mode_valid(submode))
> + return -EINVAL;
This checks for the PCIe submode, but notice the test immediately
above. PCIE mode is being rejected. So, this driver supports
everything else but PCIe.
That doesn't seem right.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
next prev parent reply other threads:[~2026-01-29 11:18 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-26 9:21 [PATCH 0/4] Serdes: s32g: Add support for serdes subsystem Vincent Guittot
2026-01-26 9:21 ` Vincent Guittot
2026-01-26 9:21 ` [PATCH 1/4] dt-bindings: serdes: s32g: Add NXP " Vincent Guittot
2026-01-26 9:21 ` Vincent Guittot
2026-01-29 12:50 ` Russell King (Oracle)
2026-01-29 12:50 ` Russell King (Oracle)
2026-01-29 13:05 ` Vincent Guittot
2026-01-29 13:05 ` Vincent Guittot
2026-01-26 9:21 ` [PATCH 2/4] phy: s32g: Add serdes subsystem phy Vincent Guittot
2026-01-26 9:21 ` Vincent Guittot
2026-01-26 13:11 ` Philipp Zabel
2026-01-26 13:11 ` Philipp Zabel
2026-01-27 10:07 ` Vincent Guittot
2026-01-27 10:07 ` Vincent Guittot
2026-01-29 9:54 ` Simon Horman
2026-01-29 9:54 ` Simon Horman
2026-01-29 13:01 ` Vincent Guittot
2026-01-29 13:01 ` Vincent Guittot
2026-01-29 13:23 ` Russell King (Oracle)
2026-01-29 13:23 ` Russell King (Oracle)
2026-01-29 13:36 ` Vincent Guittot
2026-01-29 13:36 ` Vincent Guittot
2026-01-29 13:51 ` Russell King (Oracle)
2026-01-29 13:51 ` Russell King (Oracle)
2026-01-29 14:30 ` Vinod Koul
2026-01-29 14:30 ` Vinod Koul
2026-01-29 14:36 ` Russell King (Oracle)
2026-01-29 14:36 ` Russell King (Oracle)
2026-01-30 14:50 ` Russell King (Oracle)
2026-01-30 14:50 ` Russell King (Oracle)
2026-01-29 11:17 ` Russell King (Oracle) [this message]
2026-01-29 11:17 ` Russell King (Oracle)
2026-01-29 13:02 ` Vincent Guittot
2026-01-29 13:02 ` Vincent Guittot
2026-01-26 9:21 ` [PATCH 3/4] phy: s32g: Add serdes xpcs subsystem Vincent Guittot
2026-01-26 9:21 ` Vincent Guittot
2026-01-29 11:59 ` Simon Horman
2026-01-29 11:59 ` Simon Horman
2026-01-29 13:24 ` Vincent Guittot
2026-01-29 13:24 ` Vincent Guittot
2026-01-29 16:20 ` Simon Horman
2026-01-29 16:20 ` Simon Horman
2026-01-29 12:30 ` Russell King (Oracle)
2026-01-29 12:30 ` Russell King (Oracle)
2026-01-29 13:45 ` Vincent Guittot
2026-01-29 13:45 ` Vincent Guittot
2026-01-26 9:21 ` [PATCH 4/4] MAINTAINERS: Add MAINTAINER for NXP S32G Serdes driver Vincent Guittot
2026-01-26 9:21 ` Vincent Guittot
2026-01-29 12:07 ` Simon Horman
2026-01-29 12:07 ` Simon Horman
2026-01-29 13:25 ` Vincent Guittot
2026-01-29 13:25 ` Vincent Guittot
2026-01-29 12:36 ` [PATCH 0/4] Serdes: s32g: Add support for serdes subsystem Russell King (Oracle)
2026-01-29 12:36 ` Russell King (Oracle)
2026-01-29 13:26 ` Vincent Guittot
2026-01-29 13:26 ` Vincent Guittot
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=aXtB0QcVOkE_hhny@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=Frank.li@nxp.com \
--cc=Ionut.Vicovan@nxp.com \
--cc=alexandru-catalin.ionita@nxp.com \
--cc=bogdan-gabriel.roman@nxp.com \
--cc=ciprianmarian.costea@oss.nxp.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=ghennadi.procopciuc@nxp.com \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=neil.armstrong@linaro.org \
--cc=netdev@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=s32@nxp.com \
--cc=vincent.guittot@linaro.org \
--cc=vkoul@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.