[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z1_q3tnwtRBq-fQE@lore-desk>
Date: Mon, 16 Dec 2024 09:54:54 +0100
From: Lorenzo Bianconi <lorenzo@...nel.org>
To: Michal Swiatkowski <michal.swiatkowski@...ux.intel.com>
Cc: Felix Fietkau <nbd@....name>, Sean Wang <sean.wang@...iatek.com>,
Mark Lee <Mark-MC.Lee@...iatek.com>,
Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org, netdev@...r.kernel.org
Subject: Re: [PATCH net-next] net: airoha: Fix error patch in airoha_probe()
> 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@...nel.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@...ux.intel.com>
>
> Thanks
ack, I will fix it in v2.
Regards,
Lorenzo
>
> > +{
> > + 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);
> > + }
> > +}
> > +
>
> [...]
Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)
Powered by blists - more mailing lists