BPF List
 help / color / mirror / Atom feed
From: Gatien CHEVALLIER <gatien.chevallier@foss.st.com>
To: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>,
	Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>
Cc: Richard Cochran <richardcochran@gmail.com>,
	Jesper Dangaard Brouer <hawk@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>, <netdev@vger.kernel.org>,
	<linux-stm32@st-md-mailman.stormreply.com>,
	"John Fastabend" <john.fastabend@gmail.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	Eric Dumazet <edumazet@google.com>,
	Stanislav Fomichev <sdf@fomichev.me>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Jakub Kicinski <kuba@kernel.org>, <bpf@vger.kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	"David S. Miller" <davem@davemloft.net>,
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [Linux-stm32] [PATCH net-next 06/11] net: stmmac: add __stmmac_release() to complement __stmmac_open()
Date: Wed, 10 Sep 2025 16:39:19 +0200	[thread overview]
Message-ID: <30168f27-aec7-4ccd-b66b-c1ffa215293b@foss.st.com> (raw)
In-Reply-To: <E1uw1Va-00000004MCL-2B4O@rmk-PC.armlinux.org.uk>



On 9/9/25 18:47, Russell King (Oracle) wrote:
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Hi Russell,

This is missing a commit message.

> ---
>   .../net/ethernet/stmicro/stmmac/stmmac_main.c | 41 +++++++++++--------
>   1 file changed, 25 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index efce7b37f704..cb058e4c6ea9 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -3965,10 +3965,6 @@ static int __stmmac_open(struct net_device *dev,
>   	if (!priv->tx_lpi_timer)
>   		priv->tx_lpi_timer = eee_timer * 1000;
>   
> -	ret = pm_runtime_resume_and_get(priv->device);
> -	if (ret < 0)
> -		return ret;
> -
>   	if ((!priv->hw->xpcs ||
>   	     xpcs_get_an_mode(priv->hw->xpcs, mode) != DW_AN_C73)) {
>   		ret = stmmac_init_phy(dev);
> @@ -3976,7 +3972,7 @@ static int __stmmac_open(struct net_device *dev,
>   			netdev_err(priv->dev,
>   				   "%s: Cannot attach to PHY (error: %d)\n",
>   				   __func__, ret);
> -			goto init_phy_error;
> +			return ret;
>   		}
>   	}
>   
> @@ -4028,8 +4024,6 @@ static int __stmmac_open(struct net_device *dev,
>   	stmmac_release_ptp(priv);
>   init_error:
>   	phylink_disconnect_phy(priv->phylink);
> -init_phy_error:
> -	pm_runtime_put(priv->device);
>   	return ret;
>   }
>   
> @@ -4043,21 +4037,23 @@ static int stmmac_open(struct net_device *dev)
>   	if (IS_ERR(dma_conf))
>   		return PTR_ERR(dma_conf);
>   
> +	ret = pm_runtime_resume_and_get(priv->device);
> +	if (ret < 0)
> +		goto err;
> +
>   	ret = __stmmac_open(dev, dma_conf);
> -	if (ret)
> +	if (ret) {
> +		pm_runtime_put(priv->device);
> +err:
>   		free_dma_desc_resources(priv, dma_conf);
> +	}
>   
>   	kfree(dma_conf);
> +
>   	return ret;
>   }
>   
> -/**
> - *  stmmac_release - close entry point of the driver
> - *  @dev : device pointer.
> - *  Description:
> - *  This is the stop entry point of the driver.
> - */
> -static int stmmac_release(struct net_device *dev)
> +static void __stmmac_release(struct net_device *dev)
>   {
>   	struct stmmac_priv *priv = netdev_priv(dev);
>   	u32 chan;
> @@ -4097,6 +4093,19 @@ static int stmmac_release(struct net_device *dev)
>   
>   	if (stmmac_fpe_supported(priv))
>   		ethtool_mmsv_stop(&priv->fpe_cfg.mmsv);
> +}
> +
> +/**
> + *  stmmac_release - close entry point of the driver
> + *  @dev : device pointer.
> + *  Description:
> + *  This is the stop entry point of the driver.
> + */
> +static int stmmac_release(struct net_device *dev)
> +{
> +	struct stmmac_priv *priv = netdev_priv(dev);
> +
> +	__stmmac_release(dev);
>   
>   	pm_runtime_put(priv->device);
>   
> @@ -5895,7 +5904,7 @@ static int stmmac_change_mtu(struct net_device *dev, int new_mtu)
>   			return PTR_ERR(dma_conf);
>   		}
>   
> -		stmmac_release(dev);
> +		__stmmac_release(dev);
>   
>   		ret = __stmmac_open(dev, dma_conf);
>   		if (ret) {

  reply	other threads:[~2025-09-10 14:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-09 16:47 [PATCH net-next 00/11] net: stmmac: timestamping/ptp cleanups Russell King (Oracle)
2025-09-09 16:47 ` [PATCH net-next 01/11] net: stmmac: ptp: improve handling of aux_ts_lock lifetime Russell King (Oracle)
2025-09-09 16:47 ` [PATCH net-next 02/11] net: stmmac: disable PTP clock after unregistering PTP Russell King (Oracle)
2025-09-09 16:47 ` [PATCH net-next 03/11] net: stmmac: fix PTP error cleanup in __stmmac_open() Russell King (Oracle)
2025-09-09 16:47 ` [PATCH net-next 04/11] net: stmmac: fix stmmac_xdp_open() clk_ptp_ref error cleanup Russell King (Oracle)
2025-09-09 16:47 ` [PATCH net-next 05/11] net: stmmac: unexport stmmac_init_tstamp_counter() Russell King (Oracle)
2025-09-09 16:47 ` [PATCH net-next 06/11] net: stmmac: add __stmmac_release() to complement __stmmac_open() Russell King (Oracle)
2025-09-10 14:39   ` Gatien CHEVALLIER [this message]
2025-09-09 16:47 ` [PATCH net-next 07/11] net: stmmac: move stmmac_init_ptp() messages into function Russell King (Oracle)
2025-09-09 16:48 ` [PATCH net-next 08/11] net: stmmac: rename stmmac_init_ptp() Russell King (Oracle)
2025-09-10 14:42   ` [Linux-stm32] " Gatien CHEVALLIER
2025-09-10 23:01     ` Russell King (Oracle)
2025-09-09 16:48 ` [PATCH net-next 09/11] net: stmmac: add stmmac_setup_ptp() Russell King (Oracle)
2025-09-09 16:48 ` [PATCH net-next 10/11] net: stmmac: move PTP support check into stmmac_init_timestamping() Russell King (Oracle)
2025-09-09 16:48 ` [PATCH net-next 11/11] net: stmmac: move timestamping/ptp init to stmmac_hw_setup() caller Russell King (Oracle)
2025-09-09 18:46 ` [PATCH net-next 00/11] net: stmmac: timestamping/ptp cleanups Andrew Lunn
2025-09-10 15:10 ` [Linux-stm32] " Gatien CHEVALLIER

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=30168f27-aec7-4ccd-b66b-c1ffa215293b@foss.st.com \
    --to=gatien.chevallier@foss.st.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hawk@kernel.org \
    --cc=hkallweit1@gmail.com \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=sdf@fomichev.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox