public inbox for linux-phy@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v1] phy: fsl-imx8mq-usb: Fix PCS_TX_SWING_FULL register configuration
@ 2025-12-18 17:49 Stefano Radaelli
  2025-12-18 18:43 ` Fabio Estevam
  0 siblings, 1 reply; 3+ messages in thread
From: Stefano Radaelli @ 2025-12-18 17:49 UTC (permalink / raw)
  To: vkoul, neil.armstrong, shawnguo, s.hauer, kernel, festevam,
	j.zink, linux-kernel
  Cc: xu.yang_2, jun.li, Frank.Li, haibo.chen, linux-phy, imx,
	Stefano Radaelli, Pierluigi Passaro

Clear the PCS_TX_SWING_FULL field mask before setting the new value
in PHY_CTRL5 register. Without clearing the mask first, the OR operation
could leave previously set bits, resulting in incorrect
register configuration.

Fixes: 63c85ad0cd81 ("phy: fsl-imx8mp-usb: add support for phy tuning")
Suggested-by: Pierluigi Passaro <pierluigi.p@variscite.com>
Signed-off-by: Stefano Radaelli <stefano.r@variscite.com>
---
 drivers/phy/freescale/phy-fsl-imx8mq-usb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/phy/freescale/phy-fsl-imx8mq-usb.c b/drivers/phy/freescale/phy-fsl-imx8mq-usb.c
index ad8a55012e42..9458b6e5fcf4 100644
--- a/drivers/phy/freescale/phy-fsl-imx8mq-usb.c
+++ b/drivers/phy/freescale/phy-fsl-imx8mq-usb.c
@@ -504,6 +504,7 @@ static void imx8m_phy_tune(struct imx8mq_usb_phy *imx_phy)
 
 	if (imx_phy->pcs_tx_swing_full != PHY_TUNE_DEFAULT) {
 		value = readl(imx_phy->base + PHY_CTRL5);
+		value &= ~PHY_CTRL5_PCS_TX_SWING_FULL_MASK;
 		value |= FIELD_PREP(PHY_CTRL5_PCS_TX_SWING_FULL_MASK,
 				   imx_phy->pcs_tx_swing_full);
 		writel(value, imx_phy->base + PHY_CTRL5);

base-commit: ea1013c1539270e372fc99854bc6e4d94eaeff66
-- 
2.47.3


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] phy: fsl-imx8mq-usb: Fix PCS_TX_SWING_FULL register configuration
  2025-12-18 17:49 [PATCH v1] phy: fsl-imx8mq-usb: Fix PCS_TX_SWING_FULL register configuration Stefano Radaelli
@ 2025-12-18 18:43 ` Fabio Estevam
  2025-12-18 19:36   ` Stefano Radaelli
  0 siblings, 1 reply; 3+ messages in thread
From: Fabio Estevam @ 2025-12-18 18:43 UTC (permalink / raw)
  To: Stefano Radaelli
  Cc: vkoul, neil.armstrong, shawnguo, s.hauer, kernel, j.zink,
	linux-kernel, xu.yang_2, jun.li, Frank.Li, haibo.chen, linux-phy,
	imx, Stefano Radaelli, Pierluigi Passaro

Hi Stefano,

On Thu, Dec 18, 2025 at 2:50 PM Stefano Radaelli
<stefano.radaelli21@gmail.com> wrote:
>
> Clear the PCS_TX_SWING_FULL field mask before setting the new value
> in PHY_CTRL5 register. Without clearing the mask first, the OR operation
> could leave previously set bits, resulting in incorrect
> register configuration.

The change looks good to me, but the Subject is a bit misleading.

It gives the impression that PCS_TX_SWING_FULL is a register.

What about:

phy: fsl-imx8mq-usb: Clear the PCS_TX_SWING_FULL field before using it

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] phy: fsl-imx8mq-usb: Fix PCS_TX_SWING_FULL register configuration
  2025-12-18 18:43 ` Fabio Estevam
@ 2025-12-18 19:36   ` Stefano Radaelli
  0 siblings, 0 replies; 3+ messages in thread
From: Stefano Radaelli @ 2025-12-18 19:36 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: vkoul, neil.armstrong, shawnguo, s.hauer, kernel, j.zink,
	linux-kernel, xu.yang_2, jun.li, Frank.Li, haibo.chen, linux-phy,
	imx, Stefano Radaelli, Pierluigi Passaro

Hi Fabio,
> 
> The change looks good to me, but the Subject is a bit misleading.
> 
> It gives the impression that PCS_TX_SWING_FULL is a register.
> 
> What about:
> 
> phy: fsl-imx8mq-usb: Clear the PCS_TX_SWING_FULL field before using it

Thank you for the review! You're absolutely right, the subject was
misleading. I'll send a v2 with the improved subject line you suggested.

Best regards,
Stefano

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-12-18 19:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-18 17:49 [PATCH v1] phy: fsl-imx8mq-usb: Fix PCS_TX_SWING_FULL register configuration Stefano Radaelli
2025-12-18 18:43 ` Fabio Estevam
2025-12-18 19:36   ` Stefano Radaelli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox