diff mbox

[U-Boot,09/10] net: mvpp2x: remove TX drain from transmit routine

Message ID 1498033898-15650-10-git-send-email-stefanc@malvell.com
State Superseded
Delegated to: Stefan Roese
Headers show

Commit Message

stefanc@malvell.com June 21, 2017, 8:31 a.m. UTC
From: Stefan Chulski <stefanc@marvell.com>

TX drain in transmit procedure could cause issues due
to race between drain procedure and transmition of descriptor
between AGGR TXQ and physical TXQ.
TXQ be cleared before moving to Linux by stop procedure.

Change-Id: I1d52cf087505d35d8a10e0249f78d0177a569658
Signed-off-by: Stefan Chulski <stefanc@marvell.com>
Reviewed-on: http://vgitil04.il.marvell.com:8080/39968
Tested-by: iSoC Platform CI <ykjenk@marvell.com>
Reviewed-by: Nadav Haklai <nadavh@marvell.com>
Reviewed-on: http://vgitil04.il.marvell.com:8080/39955
Reviewed-by: Igal Liberman <igall@marvell.com>
---
 drivers/net/mvpp2.c | 21 ---------------------
 1 file changed, 21 deletions(-)

Comments

Joe Hershberger Aug. 8, 2017, 4:15 p.m. UTC | #1
On Wed, Jun 21, 2017 at 3:31 AM,  <stefanc@malvell.com> wrote:
> From: Stefan Chulski <stefanc@marvell.com>
>
> TX drain in transmit procedure could cause issues due
> to race between drain procedure and transmition of descriptor
> between AGGR TXQ and physical TXQ.
> TXQ be cleared before moving to Linux by stop procedure.

TXQ be cleared -> TXQ will be cleared

>
> Change-Id: I1d52cf087505d35d8a10e0249f78d0177a569658
> Signed-off-by: Stefan Chulski <stefanc@marvell.com>
> Reviewed-on: http://vgitil04.il.marvell.com:8080/39968
> Tested-by: iSoC Platform CI <ykjenk@marvell.com>
> Reviewed-by: Nadav Haklai <nadavh@marvell.com>
> Reviewed-on: http://vgitil04.il.marvell.com:8080/39955
> Reviewed-by: Igal Liberman <igall@marvell.com>

Acked-by: Joe Hershberger <joe.hershberger@ni.com>

> ---
>  drivers/net/mvpp2.c | 21 ---------------------
>  1 file changed, 21 deletions(-)
>
> diff --git a/drivers/net/mvpp2.c b/drivers/net/mvpp2.c
> index 931047e..8168539 100644
> --- a/drivers/net/mvpp2.c
> +++ b/drivers/net/mvpp2.c
> @@ -5261,21 +5261,6 @@ static int mvpp2_recv(struct udevice *dev, int flags, uchar **packetp)
>         return rx_bytes;
>  }
>
> -/* Drain Txq */
> -static void mvpp2_txq_drain(struct mvpp2_port *port, struct mvpp2_tx_queue *txq,
> -                           int enable)
> -{
> -       u32 val;
> -
> -       mvpp2_write(port->priv, MVPP2_TXQ_NUM_REG, txq->id);
> -       val = mvpp2_read(port->priv, MVPP2_TXQ_PREF_BUF_REG);
> -       if (enable)
> -               val |= MVPP2_TXQ_DRAIN_EN_MASK;
> -       else
> -               val &= ~MVPP2_TXQ_DRAIN_EN_MASK;
> -       mvpp2_write(port->priv, MVPP2_TXQ_PREF_BUF_REG, val);
> -}
> -
>  static int mvpp2_send(struct udevice *dev, void *packet, int length)
>  {
>         struct mvpp2_port *port = dev_get_priv(dev);
> @@ -5319,9 +5304,6 @@ static int mvpp2_send(struct udevice *dev, void *packet, int length)
>                 tx_done = mvpp2_txq_pend_desc_num_get(port, txq);
>         } while (tx_done);
>
> -       /* Enable TXQ drain */
> -       mvpp2_txq_drain(port, txq, 1);
> -
>         timeout = 0;
>         do {
>                 if (timeout++ > 10000) {
> @@ -5331,9 +5313,6 @@ static int mvpp2_send(struct udevice *dev, void *packet, int length)
>                 tx_done = mvpp2_txq_sent_desc_proc(port, txq);
>         } while (!tx_done);
>
> -       /* Disable TXQ drain */
> -       mvpp2_txq_drain(port, txq, 0);
> -
>         return 0;
>  }
>
> --
> 1.9.1
>
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> https://lists.denx.de/listinfo/u-boot
diff mbox

Patch

diff --git a/drivers/net/mvpp2.c b/drivers/net/mvpp2.c
index 931047e..8168539 100644
--- a/drivers/net/mvpp2.c
+++ b/drivers/net/mvpp2.c
@@ -5261,21 +5261,6 @@  static int mvpp2_recv(struct udevice *dev, int flags, uchar **packetp)
 	return rx_bytes;
 }
 
-/* Drain Txq */
-static void mvpp2_txq_drain(struct mvpp2_port *port, struct mvpp2_tx_queue *txq,
-			    int enable)
-{
-	u32 val;
-
-	mvpp2_write(port->priv, MVPP2_TXQ_NUM_REG, txq->id);
-	val = mvpp2_read(port->priv, MVPP2_TXQ_PREF_BUF_REG);
-	if (enable)
-		val |= MVPP2_TXQ_DRAIN_EN_MASK;
-	else
-		val &= ~MVPP2_TXQ_DRAIN_EN_MASK;
-	mvpp2_write(port->priv, MVPP2_TXQ_PREF_BUF_REG, val);
-}
-
 static int mvpp2_send(struct udevice *dev, void *packet, int length)
 {
 	struct mvpp2_port *port = dev_get_priv(dev);
@@ -5319,9 +5304,6 @@  static int mvpp2_send(struct udevice *dev, void *packet, int length)
 		tx_done = mvpp2_txq_pend_desc_num_get(port, txq);
 	} while (tx_done);
 
-	/* Enable TXQ drain */
-	mvpp2_txq_drain(port, txq, 1);
-
 	timeout = 0;
 	do {
 		if (timeout++ > 10000) {
@@ -5331,9 +5313,6 @@  static int mvpp2_send(struct udevice *dev, void *packet, int length)
 		tx_done = mvpp2_txq_sent_desc_proc(port, txq);
 	} while (!tx_done);
 
-	/* Disable TXQ drain */
-	mvpp2_txq_drain(port, txq, 0);
-
 	return 0;
 }