Skip to contentSkip to conversation

net: marvell: fix MVNETA_TX_IN_PRGRS bit number

PATCH In review Maksim 3 participants 3 messages Aug 6, 2021

Subsystems (3)
lore
Share & tools
lore

Maksim

author
#0 lore raw

PATCH 1/1 net: marvell: fix MVNETA_TX_IN_PRGRS bit number

According to Armada XP datasheet bit at 0 position is corresponding for TxInProg indication.

---
 drivers/net/ethernet/marvell/mvneta.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/marvell/mvneta.c +1 -1
index 76a7777c746da..de32e5b49053b 100644
@@ -105,7 +105,7 @@
 #define	MVNETA_VLAN_PRIO_TO_RXQ			 0x2440
 #define      MVNETA_VLAN_PRIO_RXQ_MAP(prio, rxq) ((rxq) << ((prio) * 3))
 #define MVNETA_PORT_STATUS                       0x2444
-#define      MVNETA_TX_IN_PRGRS                  BIT(1)
+#define      MVNETA_TX_IN_PRGRS                  BIT(0)
 #define      MVNETA_TX_FIFO_EMPTY                BIT(8)
 #define MVNETA_RX_MIN_FRAME_SIZE                 0x247c
 /* Only exists on Armada XP and Armada 370 */
Signature · 1 line
2.30.2
#1 lore raw

Hello,

Quoted 13 lines · On Fri, 6 Aug 2021 17:04:37 +0300 Maksim <[email protected]> wrote:

According to Armada XP datasheet bit at 0 position is corresponding for TxInProg indication.

---
 drivers/net/ethernet/marvell/mvneta.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/marvell/mvneta.c +0 -0
index 76a7777c746da..de32e5b49053b 100644

drivers/net/ethernet/marvell/mvneta.c line 111

Quoted 8 lines
drivers/net/ethernet/marvell/mvneta.c +1 -1
@@ -105,7 +105,7 @@
 #define	MVNETA_VLAN_PRIO_TO_RXQ			 0x2440
 #define      MVNETA_VLAN_PRIO_RXQ_MAP(prio, rxq) ((rxq) << ((prio) * 3))
 #define MVNETA_PORT_STATUS                       0x2444
-#define      MVNETA_TX_IN_PRGRS                  BIT(1)
+#define      MVNETA_TX_IN_PRGRS                  BIT(0)
 #define      MVNETA_TX_FIFO_EMPTY                BIT(8)
 #define MVNETA_RX_MIN_FRAME_SIZE                 0x247c
 /* Only exists on Armada XP and Armada 370 */

Indeed, I just checked the datasheet, and it's bit 0 in this register that indicates if transmit is in progress. The only function using this is mvneta_port_down(), which polls until MVNETA_TX_FIFO_EMPTY is set and MVNETA_TX_IN_PRGRS is cleared in this register. Bit 1 in this register is marked as reserved, read-only and read as zero, so I suppose that mvneta_port_down() was basically never waiting for MVNETA_TX_IN_PRGRS to clear.

Have you seen some actual visible issue, or was this just found by code inspection ?

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com