linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
To: Lorenzo Bianconi <lorenzo@kernel.org>
Cc: Felix Fietkau <nbd@nbd.name>, Sean Wang <sean.wang@mediatek.com>,
	Mark Lee <Mark-MC.Lee@mediatek.com>,
	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>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, netdev@vger.kernel.org
Subject: Re: [PATCH net-next] net: airoha: Fix error patch in airoha_probe()
Date: Mon, 16 Dec 2024 08:15:42 +0100	[thread overview]
Message-ID: <Z1/Tng80hii4dBQU@mev-dev.igk.intel.com> (raw)
In-Reply-To: <20241215-airoha_probe-error-path-fix-v1-1-dd299122d343@kernel.org>

On Sun, Dec 15, 2024 at 06:36:35PM +0100, Lorenzo Bianconi wrote:
> Do not run napi_disable if airoha_hw_init() fails since Tx/Rx napi
> has not been started yet. In order to fix the issue, introduce
> airoha_qdma_disable_napi routine and remove napi_disable in
> airoha_hw_cleanup().
> 
> Fixes: 23020f049327 ("net: airoha: Introduce ethernet support for EN7581 SoC")
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> ---
>  drivers/net/ethernet/mediatek/airoha_eth.c | 33 ++++++++++++++++++++++--------
>  1 file changed, 25 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/net/ethernet/mediatek/airoha_eth.c b/drivers/net/ethernet/mediatek/airoha_eth.c
> index 6c683a12d5aa52dd9d966df123509075a989c0b3..5bbf5fee2802135ff6083233d0bda78f2ba5606a 100644
> --- a/drivers/net/ethernet/mediatek/airoha_eth.c
> +++ b/drivers/net/ethernet/mediatek/airoha_eth.c
> @@ -2138,17 +2138,14 @@ static void airoha_hw_cleanup(struct airoha_qdma *qdma)
>  		if (!qdma->q_rx[i].ndesc)
>  			continue;
>  
> -		napi_disable(&qdma->q_rx[i].napi);
>  		netif_napi_del(&qdma->q_rx[i].napi);
>  		airoha_qdma_cleanup_rx_queue(&qdma->q_rx[i]);
>  		if (qdma->q_rx[i].page_pool)
>  			page_pool_destroy(qdma->q_rx[i].page_pool);
>  	}
>  
> -	for (i = 0; i < ARRAY_SIZE(qdma->q_tx_irq); i++) {
> -		napi_disable(&qdma->q_tx_irq[i].napi);
> +	for (i = 0; i < ARRAY_SIZE(qdma->q_tx_irq); i++)
>  		netif_napi_del(&qdma->q_tx_irq[i].napi);
> -	}
>  
>  	for (i = 0; i < ARRAY_SIZE(qdma->q_tx); i++) {
>  		if (!qdma->q_tx[i].ndesc)
> @@ -2173,6 +2170,21 @@ static void airoha_qdma_start_napi(struct airoha_qdma *qdma)
>  	}
>  }
>  
> +static void airoha_qdma_disable_napi(struct airoha_qdma *qdma)
Nit: similar function for enabling napi is named airoha_qdma_start_napi()
maybe stop here or enable there to be consistent.

Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>

Thanks

> +{
> +	int i;
> +
> +	for (i = 0; i < ARRAY_SIZE(qdma->q_tx_irq); i++)
> +		napi_disable(&qdma->q_tx_irq[i].napi);
> +
> +	for (i = 0; i < ARRAY_SIZE(qdma->q_rx); i++) {
> +		if (!qdma->q_rx[i].ndesc)
> +			continue;
> +
> +		napi_disable(&qdma->q_rx[i].napi);
> +	}
> +}
> +

[...]


  reply	other threads:[~2024-12-16  7:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-15 17:36 [PATCH net-next] net: airoha: Fix error patch in airoha_probe() Lorenzo Bianconi
2024-12-16  7:15 ` Michal Swiatkowski [this message]
2024-12-16  8:54   ` Lorenzo Bianconi

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=Z1/Tng80hii4dBQU@mev-dev.igk.intel.com \
    --to=michal.swiatkowski@linux.intel.com \
    --cc=Mark-MC.Lee@mediatek.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=lorenzo@kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=nbd@nbd.name \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sean.wang@mediatek.com \
    /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).