]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
net: mvpp2: fix bad MVPP2_TXQ_SCHED_TOKEN_CNTR_REG queue value
authorAntoine Tenart <antoine.tenart@bootlin.com>
Wed, 29 May 2019 13:59:48 +0000 (15:59 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 13 Aug 2019 12:11:36 +0000 (14:11 +0200)
BugLink: https://bugs.launchpad.net/bugs/1837518
[ Upstream commit 21808437214637952b61beaba6034d97880fbeb3 ]

MVPP2_TXQ_SCHED_TOKEN_CNTR_REG() expects the logical queue id but
the current code is passing the global tx queue offset, so it ends
up writing to unknown registers (between 0x8280 and 0x82fc, which
seemed to be unused by the hardware). This fixes the issue by using
the logical queue id instead.

Fixes: 3f518509dedc ("ethernet: Add new driver for Marvell Armada 375 network unit")
Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c

index 70031e2b22944b94ba2232f8d1694e739d046712..f063ba69eb17b1ffa1ffcf69b00b971db1f70218 100644 (file)
@@ -1412,7 +1412,7 @@ static inline void mvpp2_xlg_max_rx_size_set(struct mvpp2_port *port)
 /* Set defaults to the MVPP2 port */
 static void mvpp2_defaults_set(struct mvpp2_port *port)
 {
-       int tx_port_num, val, queue, ptxq, lrxq;
+       int tx_port_num, val, queue, lrxq;
 
        if (port->priv->hw_version == MVPP21) {
                /* Update TX FIFO MIN Threshold */
@@ -1433,11 +1433,9 @@ static void mvpp2_defaults_set(struct mvpp2_port *port)
        mvpp2_write(port->priv, MVPP2_TXP_SCHED_FIXED_PRIO_REG, 0);
 
        /* Close bandwidth for all queues */
-       for (queue = 0; queue < MVPP2_MAX_TXQ; queue++) {
-               ptxq = mvpp2_txq_phys(port->id, queue);
+       for (queue = 0; queue < MVPP2_MAX_TXQ; queue++)
                mvpp2_write(port->priv,
-                           MVPP2_TXQ_SCHED_TOKEN_CNTR_REG(ptxq), 0);
-       }
+                           MVPP2_TXQ_SCHED_TOKEN_CNTR_REG(queue), 0);
 
        /* Set refill period to 1 usec, refill tokens
         * and bucket size to maximum
@@ -2293,7 +2291,7 @@ static void mvpp2_txq_deinit(struct mvpp2_port *port,
        txq->descs_dma         = 0;
 
        /* Set minimum bandwidth for disabled TXQs */
-       mvpp2_write(port->priv, MVPP2_TXQ_SCHED_TOKEN_CNTR_REG(txq->id), 0);
+       mvpp2_write(port->priv, MVPP2_TXQ_SCHED_TOKEN_CNTR_REG(txq->log_id), 0);
 
        /* Set Tx descriptors queue starting address and size */
        thread = mvpp2_cpu_to_thread(port->priv, get_cpu());