* [PATCH] phy: fsl-lynx-28g: propagate PCVT enable errors
@ 2026-07-22 3:36 kr494167
2026-07-22 8:00 ` Vladimir Oltean
2026-07-22 13:37 ` Andrew Lunn
0 siblings, 2 replies; 3+ messages in thread
From: kr494167 @ 2026-07-22 3:36 UTC (permalink / raw)
To: ioana.ciornei, vladimir.oltean, vkoul
Cc: neil.armstrong, davem, netdev, linux-phy, linux-kernel, surendra
From: surendra <kr494167@gmail.com>
lynx_28g_set_mode() currently ignores failures from
lynx_28g_lane_enable_pcvt(). It then updates the lane mode and reports
success even though the protocol converter may remain disabled.
Propagate the error and leave the previous lane mode intact so the caller
can handle the failed reconfiguration.
Fixes: 8f73b37cf3fb ("phy: add support for the Layerscape SerDes 28G")
Signed-off-by: surendra <kr494167@gmail.com>
---
drivers/phy/freescale/phy-fsl-lynx-28g.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/phy/freescale/phy-fsl-lynx-28g.c b/drivers/phy/freescale/phy-fsl-lynx-28g.c
index 38afcd081a2a..1fe406adc83c 100644
--- a/drivers/phy/freescale/phy-fsl-lynx-28g.c
+++ b/drivers/phy/freescale/phy-fsl-lynx-28g.c
@@ -1003,7 +1003,9 @@ static int lynx_28g_set_mode(struct phy *phy, enum phy_mode mode, int submode)
lynx_28g_lane_change_proto_conf(lane, lane_mode);
lynx_28g_lane_remap_pll(lane, lane_mode);
- WARN_ON(lynx_28g_lane_enable_pcvt(lane, lane_mode));
+ err = lynx_28g_lane_enable_pcvt(lane, lane_mode);
+ if (err)
+ goto out;
lane->mode = lane_mode;
--
2.55.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] phy: fsl-lynx-28g: propagate PCVT enable errors
2026-07-22 3:36 [PATCH] phy: fsl-lynx-28g: propagate PCVT enable errors kr494167
@ 2026-07-22 8:00 ` Vladimir Oltean
2026-07-22 13:37 ` Andrew Lunn
1 sibling, 0 replies; 3+ messages in thread
From: Vladimir Oltean @ 2026-07-22 8:00 UTC (permalink / raw)
To: kr494167
Cc: ioana.ciornei, vkoul, neil.armstrong, davem, netdev, linux-phy,
linux-kernel
Hi Surendra,
On Wed, Jul 22, 2026 at 09:06:19AM +0530, kr494167@gmail.com wrote:
> From: surendra <kr494167@gmail.com>
>
> lynx_28g_set_mode() currently ignores failures from
> lynx_28g_lane_enable_pcvt(). It then updates the lane mode and reports
> success even though the protocol converter may remain disabled.
>
> Propagate the error and leave the previous lane mode intact so the caller
> can handle the failed reconfiguration.
>
> Fixes: 8f73b37cf3fb ("phy: add support for the Layerscape SerDes 28G")
> Signed-off-by: surendra <kr494167@gmail.com>
> ---
> drivers/phy/freescale/phy-fsl-lynx-28g.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/phy/freescale/phy-fsl-lynx-28g.c b/drivers/phy/freescale/phy-fsl-lynx-28g.c
> index 38afcd081a2a..1fe406adc83c 100644
> --- a/drivers/phy/freescale/phy-fsl-lynx-28g.c
> +++ b/drivers/phy/freescale/phy-fsl-lynx-28g.c
> @@ -1003,7 +1003,9 @@ static int lynx_28g_set_mode(struct phy *phy, enum phy_mode mode, int submode)
>
> lynx_28g_lane_change_proto_conf(lane, lane_mode);
> lynx_28g_lane_remap_pll(lane, lane_mode);
> - WARN_ON(lynx_28g_lane_enable_pcvt(lane, lane_mode));
> + err = lynx_28g_lane_enable_pcvt(lane, lane_mode);
> + if (err)
> + goto out;
>
> lane->mode = lane_mode;
>
> --
> 2.55.0
>
Did you draw any conclusions from the feedback you received on the
lynx-10g patch and decided that it doesn't apply to lynx-28g?
https://lore.kernel.org/linux-phy/20260720101906.80584-1-kr494167@gmail.com/
Hint: it does.
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] phy: fsl-lynx-28g: propagate PCVT enable errors
2026-07-22 3:36 [PATCH] phy: fsl-lynx-28g: propagate PCVT enable errors kr494167
2026-07-22 8:00 ` Vladimir Oltean
@ 2026-07-22 13:37 ` Andrew Lunn
1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2026-07-22 13:37 UTC (permalink / raw)
To: kr494167
Cc: ioana.ciornei, vladimir.oltean, vkoul, neil.armstrong, davem,
netdev, linux-phy, linux-kernel
On Wed, Jul 22, 2026 at 09:06:19AM +0530, kr494167@gmail.com wrote:
> From: surendra <kr494167@gmail.com>
>
> lynx_28g_set_mode() currently ignores failures from
> lynx_28g_lane_enable_pcvt(). It then updates the lane mode and reports
> success even though the protocol converter may remain disabled.
>
> Propagate the error and leave the previous lane mode intact so the caller
> can handle the failed reconfiguration.
>
> Fixes: 8f73b37cf3fb ("phy: add support for the Layerscape SerDes 28G")
> Signed-off-by: surendra <kr494167@gmail.com>
> ---
> drivers/phy/freescale/phy-fsl-lynx-28g.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/phy/freescale/phy-fsl-lynx-28g.c b/drivers/phy/freescale/phy-fsl-lynx-28g.c
> index 38afcd081a2a..1fe406adc83c 100644
> --- a/drivers/phy/freescale/phy-fsl-lynx-28g.c
> +++ b/drivers/phy/freescale/phy-fsl-lynx-28g.c
> @@ -1003,7 +1003,9 @@ static int lynx_28g_set_mode(struct phy *phy, enum phy_mode mode, int submode)
>
> lynx_28g_lane_change_proto_conf(lane, lane_mode);
> lynx_28g_lane_remap_pll(lane, lane_mode);
> - WARN_ON(lynx_28g_lane_enable_pcvt(lane, lane_mode));
A WARN_ON() produces a very noticeable splat, which will aid
debugging. Just returning the error code makes is easy to miss what
causes the issue. Maybe the WARN_ON() should be kept? At least, i
would add justification to the commit message for removing it.
Andrew
---
pw-bot: cr
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-07-22 13:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-22 3:36 [PATCH] phy: fsl-lynx-28g: propagate PCVT enable errors kr494167
2026-07-22 8:00 ` Vladimir Oltean
2026-07-22 13:37 ` Andrew Lunn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox