[PATCH v2 phy-next 2/2] phy: ti: add PHY driver for TI DS125DF111 Dual-Channel Retimer
Ioana Ciornei
ioana.ciornei at nxp.com
Fri May 15 07:36:45 PDT 2026
On Fri, May 15, 2026 at 11:22:52AM +0000, sashiko-bot at kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [High] Missing delay or polling after setting a self-clearing hardware reset bit.
> --
>
> commit 59a5ca7411308a81c146d660b8c04e0be8fe8fbb
> Author: Ioana Ciornei <ioana.ciornei at nxp.com>
>
> phy: ti: add PHY driver for TI DS125DF111 Dual-Channel Retimer
>
> This commit adds a generic PHY driver for the TI DS125DF111 Multi-Protocol
> Dual-Channel Retimer. It supports 10G and 1G link speeds, modeling each of
> the two channels as a separate PHY device.
>
> > diff --git a/drivers/phy/ti/phy-ds125df111.c b/drivers/phy/ti/phy-ds125df111.c
> > new file mode 100644
> > --- /dev/null
> > +++ b/drivers/phy/ti/phy-ds125df111.c
>
> [ ... ]
>
> > +static int ds125df111_configure(struct phy *phy,
> > + const struct ds125df111_config *cfg)
> > +{
>
> [ ... ]
>
> > + /* Reset Channel Registers */
> > + err = i2c_smbus_read_byte_data(i2c, DS125DF111_CH_CTRL);
> > + if (err < 0) {
> > + dev_err(dev, "Error resetting channel configuration\n");
> > + goto out;
> > + }
> > + val = (u8)err;
> > + val |= DS125DF111_CH_CTRL_RESET;
> > + err = i2c_smbus_write_byte_data(i2c, DS125DF111_CH_CTRL, val);
> > + if (err < 0) {
> > + dev_err(dev, "Error resetting channel configuration\n");
> > + goto out;
> > + }
> > +
> > + /* Program the VCO group frequencies */
> > + for (i = 0; i < DS125DF111_NUM_VCO_GROUP_REG; i++) {
> > + err = i2c_smbus_write_byte_data(i2c,
> > + DS125DF111_VCO_GROUP_BASE + i,
> > + cfg->vco_group[i]);
>
> Is a delay or polling loop needed after triggering the channel reset?
>
> The DS125DF111_CH_CTRL_RESET bit is defined as self-clearing, but the code
> immediately proceeds to program the VCO group frequencies without checking if
> the reset has finished.
>
> Since hardware resets usually take a non-zero amount of time, writing to the
> registers right away could result in the device NACKing the transactions or
> silently dropping the new configuration.
>
The datasheet does not specify a maximum timeout for channel reset. I
will try to use read_poll_timeout() to wait for the DS125DF111_CH_CTRL
bit to be cleared.
More information about the linux-phy
mailing list