netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Huacai Chen <chenhuacai@kernel.org>
To: Tiezhu Yang <yangtiezhu@loongson.cn>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S . Miller" <davem@davemloft.net>,
	 Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	 netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 2/2] net: stmmac: Check stmmac_hw_setup() in stmmac_resume()
Date: Wed, 23 Jul 2025 15:57:05 +0800	[thread overview]
Message-ID: <CAAhV-H6seOazKUDwpqEwokv2-dYJX8sa03p=2ye8C-d=Bj8-wA@mail.gmail.com> (raw)
In-Reply-To: <20250722062716.29590-3-yangtiezhu@loongson.cn>

On Tue, Jul 22, 2025 at 2:27 PM Tiezhu Yang <yangtiezhu@loongson.cn> wrote:
>
> stmmac_hw_setup() may return 0 on success and an appropriate negative
> integer as defined in errno.h file on failure, just check it and then
> return early if failed in stmmac_resume().
>
> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Reviewed-by: Huacai Chen <chenhuacai@loongson.cn>
> ---
>  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index b948df1bff9a..2bfacab71ab9 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -7975,7 +7975,14 @@ int stmmac_resume(struct device *dev)
>         stmmac_free_tx_skbufs(priv);
>         stmmac_clear_descriptors(priv, &priv->dma_conf);
>
> -       stmmac_hw_setup(ndev, false);
> +       ret = stmmac_hw_setup(ndev, false);
> +       if (ret < 0) {
> +               netdev_err(priv->dev, "%s: Hw setup failed\n", __func__);
> +               mutex_unlock(&priv->lock);
> +               rtnl_unlock();
> +               return ret;
> +       }
> +
>         stmmac_init_coalesce(priv);
>         phylink_rx_clk_stop_block(priv->phylink);
>         stmmac_set_rx_mode(ndev);
> --
> 2.42.0
>
>

      parent reply	other threads:[~2025-07-23  7:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-22  6:27 [PATCH net-next 0/2] Refine stmmac code Tiezhu Yang
2025-07-22  6:27 ` [PATCH net-next 1/2] net: stmmac: Return early if invalid in loongson_dwmac_fix_reset() Tiezhu Yang
2025-07-22 12:48   ` Maxime Chevallier
2025-07-22 13:10     ` Tiezhu Yang
2025-07-23  9:42       ` Tiezhu Yang
2025-07-22  6:27 ` [PATCH net-next 2/2] net: stmmac: Check stmmac_hw_setup() in stmmac_resume() Tiezhu Yang
2025-07-22 12:44   ` Maxime Chevallier
2025-07-23  7:57   ` Huacai Chen [this message]

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='CAAhV-H6seOazKUDwpqEwokv2-dYJX8sa03p=2ye8C-d=Bj8-wA@mail.gmail.com' \
    --to=chenhuacai@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=yangtiezhu@loongson.cn \
    /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;
as well as URLs for NNTP newsgroup(s).