netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Alexander Lobakin <alexandr.lobakin@intel.com>
Cc: netdev@vger.kernel.org, nbd@nbd.name, john@phrozen.org,
	sean.wang@mediatek.com, Mark-MC.Lee@mediatek.com,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, lorenzo.bianconi@redhat.com,
	sujuan.chen@mediatek.com, linux-mediatek@lists.infradead.org
Subject: Re: [PATCH net-next 1/5] net: ethernet: mtk_wed: return status value in mtk_wdma_rx_reset
Date: Mon, 21 Nov 2022 18:34:01 +0100	[thread overview]
Message-ID: <Y3u2iWXXhpmapOxu@lore-desk> (raw)
In-Reply-To: <20221121165521.396686-1-alexandr.lobakin@intel.com>

[-- Attachment #1: Type: text/plain, Size: 2161 bytes --]

> 
> From: Lorenzo Bianconi <lorenzo@kernel.org>
> Date: Mon, 21 Nov 2022 09:59:21 +0100
> 
> > Move MTK_WDMA_RESET_IDX configuration in mtk_wdma_rx_reset routine.
> > This is a preliminary patch to add Wireless Ethernet Dispatcher reset
> > support.
> > 
> > Co-developed-by: Sujuan Chen <sujuan.chen@mediatek.com>
> > Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
> > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > ---
> >  drivers/net/ethernet/mediatek/mtk_wed.c | 25 ++++++++++++-------------
> >  1 file changed, 12 insertions(+), 13 deletions(-)
> > 
> > diff --git a/drivers/net/ethernet/mediatek/mtk_wed.c b/drivers/net/ethernet/mediatek/mtk_wed.c
> > index 7d8842378c2b..dc898ded2f05 100644
> > --- a/drivers/net/ethernet/mediatek/mtk_wed.c
> > +++ b/drivers/net/ethernet/mediatek/mtk_wed.c
> > @@ -101,17 +101,21 @@ mtk_wdma_read_reset(struct mtk_wed_device *dev)
> >  	return wdma_r32(dev, MTK_WDMA_GLO_CFG);
> >  }
> >  
> > -static void
> > +static int
> >  mtk_wdma_rx_reset(struct mtk_wed_device *dev)
> >  {
> >  	u32 status, mask = MTK_WDMA_GLO_CFG_RX_DMA_BUSY;
> > -	int i;
> > +	int i, ret;
> >  
> >  	wdma_clr(dev, MTK_WDMA_GLO_CFG, MTK_WDMA_GLO_CFG_RX_DMA_EN);
> > -	if (readx_poll_timeout(mtk_wdma_read_reset, dev, status,
> > -			       !(status & mask), 0, 1000))
> > +	ret = readx_poll_timeout(mtk_wdma_read_reset, dev, status,
> > +				 !(status & mask), 0, 10000);
> 
> You didn't mention anywhere this change of the timeout from 1000 to
> 10000, and for example for me it's not clear from the code why you
> did this. Maybe leave a comment in the commitmsg?
> Same in 2/5 for Tx, also 1000 -> 10000.

ops I forgot them, sorry. I actually aligned the these values to the vendor sdk.

Regards,
Lorenzo

> 
> > +	if (ret)
> >  		dev_err(dev->hw->dev, "rx reset failed\n");
> >  
> > +	wdma_w32(dev, MTK_WDMA_RESET_IDX, MTK_WDMA_RESET_IDX_RX);
> > +	wdma_w32(dev, MTK_WDMA_RESET_IDX, 0);
> > +
> >  	for (i = 0; i < ARRAY_SIZE(dev->rx_wdma); i++) {
> >  		if (dev->rx_wdma[i].desc)
> >  			continue;
> 
> [...]
> 
> > -- 
> > 2.38.1
> 
> Thanks,
> Olek

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2022-11-21 17:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-21  8:59 [PATCH net-next 0/5] refactor mtk_wed code to introduce SER support Lorenzo Bianconi
2022-11-21  8:59 ` [PATCH net-next 1/5] net: ethernet: mtk_wed: return status value in mtk_wdma_rx_reset Lorenzo Bianconi
2022-11-21 16:55   ` Alexander Lobakin
2022-11-21 17:34     ` Lorenzo Bianconi [this message]
2022-11-21  8:59 ` [PATCH net-next 2/5] net: ethernet: mtk_wed: move MTK_WDMA_RESET_IDX_TX configuration in mtk_wdma_tx_reset Lorenzo Bianconi
2022-11-21  8:59 ` [PATCH net-next 3/5] net: ethernet: mtk_wed: update mtk_wed_stop Lorenzo Bianconi
2022-11-21  8:59 ` [PATCH net-next 4/5] net: ethernet: mtk_wed: add mtk_wed_rx_reset routine Lorenzo Bianconi
2022-11-21  8:59 ` [PATCH net-next 5/5] net: ethernet: mtk_wed: add reset to tx_ring_setup callback Lorenzo Bianconi
2022-11-21 20:17   ` Jakub Kicinski
2022-11-21 21:18     ` Lorenzo Bianconi
2022-11-22  4:19       ` Jakub Kicinski
2022-11-22  9:41         ` Felix Fietkau
2022-11-22 19:13           ` Jakub Kicinski

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=Y3u2iWXXhpmapOxu@lore-desk \
    --to=lorenzo@kernel.org \
    --cc=Mark-MC.Lee@mediatek.com \
    --cc=alexandr.lobakin@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=john@phrozen.org \
    --cc=kuba@kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=nbd@nbd.name \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sean.wang@mediatek.com \
    --cc=sujuan.chen@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).