[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240906124109.s4p7lgrycfgr62vp@skbuf>
Date: Fri, 6 Sep 2024 15:41:09 +0300
From: Vladimir Oltean <olteanv@...il.com>
To: Furong Xu <0x1207@...il.com>
Cc: Serge Semin <fancer.lancer@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Jose Abreu <joabreu@...opsys.com>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Joao Pinto <jpinto@...opsys.com>, netdev@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
rmk+kernel@...linux.org.uk, linux@...linux.org.uk, xfr@...look.com,
Vladimir Oltean <vladimir.oltean@....com>
Subject: Re: [PATCH net-next v9 3/7] net: stmmac: refactor FPE verification
process
On Fri, Sep 06, 2024 at 12:55:58PM +0800, Furong Xu wrote:
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -969,17 +969,30 @@ static void stmmac_mac_config(struct phylink_config *config, unsigned int mode,
> static void stmmac_fpe_link_state_handle(struct stmmac_priv *priv, bool is_up)
> {
> struct stmmac_fpe_cfg *fpe_cfg = &priv->fpe_cfg;
> - enum stmmac_fpe_state *lo_state = &fpe_cfg->lo_fpe_state;
> - enum stmmac_fpe_state *lp_state = &fpe_cfg->lp_fpe_state;
> - bool *hs_enable = &fpe_cfg->hs_enable;
> + unsigned long flags;
>
> - if (is_up && *hs_enable) {
> - stmmac_fpe_send_mpacket(priv, priv->ioaddr, fpe_cfg,
> - MPACKET_VERIFY);
> + timer_shutdown_sync(&fpe_cfg->verify_timer);
> }
>
> static void stmmac_mac_link_down(struct phylink_config *config,
> @@ -4091,10 +4068,10 @@ static int stmmac_release(struct net_device *dev)
>
> stmmac_release_ptp(priv);
>
> - pm_runtime_put(priv->device);
> -
> if (priv->dma_cap.fpesel)
> - stmmac_fpe_stop_wq(priv);
> + timer_shutdown_sync(&priv->fpe_cfg.verify_timer);
> +
> + pm_runtime_put(priv->device);
>
> return 0;
> }
> @@ -7372,53 +7334,88 @@ int stmmac_reinit_ringparam(struct net_device *dev, u32 rx_size, u32 tx_size)
> +static void stmmac_fpe_verify_timer_arm(struct stmmac_fpe_cfg *fpe_cfg)
> +{
> + if (fpe_cfg->pmac_enabled && fpe_cfg->tx_enabled &&
> + fpe_cfg->verify_enabled &&
> + fpe_cfg->status != ETHTOOL_MM_VERIFY_STATUS_FAILED &&
> + fpe_cfg->status != ETHTOOL_MM_VERIFY_STATUS_SUCCEEDED) {
> + timer_setup(&fpe_cfg->verify_timer, stmmac_fpe_verify_timer, 0);
> + mod_timer(&fpe_cfg->verify_timer, jiffies);
> + }
> +}
> @@ -7875,15 +7874,8 @@ int stmmac_suspend(struct device *dev)
> }
> rtnl_unlock();
>
> - if (priv->dma_cap.fpesel) {
> - /* Disable FPE */
> - stmmac_fpe_configure(priv, priv->ioaddr,
> - &priv->fpe_cfg,
> - priv->plat->tx_queues_to_use,
> - priv->plat->rx_queues_to_use, false);
> -
> - stmmac_fpe_stop_wq(priv);
> - }
> + if (priv->dma_cap.fpesel)
> + timer_shutdown_sync(&priv->fpe_cfg.verify_timer);
>
> priv->speed = SPEED_UNKNOWN;
> return 0;
Calling timer_setup() after timer_shutdown_sync() is a bit unconventional,
but I don't see why it shouldn't work.
Reviewed-by: Vladimir Oltean <olteanv@...il.com>
Powered by blists - more mailing lists