Re: linux-next: manual merge of the net-next tree with the net tree

From: Lorenzo Bianconi

Date: Fri Oct 02 2026 - 09:01:49 EST


> Hi all,
>
> Today's linux-next merge of the net-next tree got a conflict in:
>
> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
>
> between commit:
>
> 232d49dd4b40a ("net: stmmac: propagate PTP addend and system time programming errors")
>
> from the net tree and commit:
>
> 8181678a92f01 ("net: stmmac: propagate PTP init failures in __stmmac_open() and stmmac_resume()")
>
> from the net-next tree.
>
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging. You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.

Hi Mark,

I double checked the diff and it seems correct to me. Thanks.

Regards,
Lorenzo

>
> diff --cc drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index 9741f97fa37a2,0c381ae0d0ffa..0000000000000
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@@ -893,38 -862,38 +894,46 @@@ static int stmmac_hwtstamp_get(struct n
> * Will be rerun after resuming from suspend, case in which the timestamping
> * flags updated by stmmac_hwtstamp_set() also need to be restored.
> */
> -static int stmmac_init_tstamp_counter(struct stmmac_priv *priv,
> - u32 systime_flags)
> +static int stmmac_init_tstamp_counter(struct stmmac_priv *priv)
> {
> + u32 default_addend = priv->default_addend;
> struct timespec64 now;
> + int ret;
>
> - if (!priv->plat->clk_ptp_rate) {
> - netdev_err(priv->dev, "Invalid PTP clock rate");
> - return -EINVAL;
> - }
> - stmmac_config_hw_tstamping(priv, priv->ptpaddr, systime_flags);
> - priv->systime_flags = systime_flags;
> --
> - stmmac_update_subsecond_increment(priv);
> + ret = stmmac_update_subsecond_increment(priv, priv->systime_flags);
> + if (ret)
> + return ret;
>
> /* initialize system time */
> ktime_get_real_ts64(&now);
>
> /* lower 32 bits of tv_sec are safe until y2106 */
> - stmmac_init_systime(priv, priv->ptpaddr, (u32)now.tv_sec, now.tv_nsec);
> + ret = stmmac_init_systime(priv, priv->ptpaddr, (u32)now.tv_sec,
> + now.tv_nsec);
> + if (ret)
> + goto error;
>
> return 0;
> +error:
> + /* Restore previous configuration */
> + stmmac_restore_subsecond_increment(priv, default_addend);
> +
> + return ret;
> }
>
> + static int stmmac_init_ptp_clk_freq(struct stmmac_priv *priv)
> + {
> + if (priv->plat->ptp_clk_freq_config)
> + priv->plat->ptp_clk_freq_config(priv);
> +
> + if (!priv->plat->clk_ptp_rate) {
> + netdev_info(priv->dev, "PTP clock rate not configured\n");
> + return -EINVAL;
> + }
> +
> + return 0;
> + }
> +
> /**
> * stmmac_init_timestamping - initialise timestamping
> * @priv: driver private structure
> @@@ -937,22 -912,8 +952,14 @@@ static int stmmac_init_timestamping(str
> bool xmac = dwmac_is_xmac(priv->plat->core_type);
> int ret;
>
> - if (priv->plat->ptp_clk_freq_config)
> - priv->plat->ptp_clk_freq_config(priv);
> -
> - if (!(priv->dma_cap.time_stamp || priv->dma_cap.atime_stamp)) {
> - netdev_info(priv->dev, "PTP not supported by HW\n");
> - return -EOPNOTSUPP;
> - }
> -
> - ret = stmmac_init_tstamp_counter(priv, STMMAC_HWTS_ACTIVE |
> - PTP_TCR_TSCFUPDT);
> + /* Reset hw ts configuration */
> + memset(&priv->tstamp_config, 0, sizeof(priv->tstamp_config));
> + priv->systime_flags = STMMAC_HWTS_ACTIVE | PTP_TCR_TSCFUPDT;
> + priv->tsfupdt_coarse = false;
> + priv->hwts_tx_en = 0;
> + priv->hwts_rx_en = 0;
> +
> + ret = stmmac_init_tstamp_counter(priv);
> if (ret) {
> netdev_warn(priv->dev, "PTP init failed\n");
> return ret;


Attachment: signature.asc
Description: PGP signature