linux-next: manual merge of the net-next tree with the net tree
Subsystems (5)
Mark Brown
maintainerHi 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.
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +0 -0
@@@ -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 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;
Quoted 14 lines
Hi all,
Today's linux-next merge of the net-next tree got a conflict in:
drivers/net/ethernet/stmicro/stmmac/stmmac_main.cbetween 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()andstmmac_resume()")
Quoted 8 lines
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
Quoted 88 lines
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +13
-13@@@ -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(strbool 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;