git: 6181f2fcf6a4 - stable/12 - mvneta: Acquire the softc lock before clearing the MIB

Mark Johnston markj at FreeBSD.org
Mon Jan 18 17:32:37 UTC 2021


The branch stable/12 has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=6181f2fcf6a40a5e2e4aaf3e62e965059ae0de3f

commit 6181f2fcf6a40a5e2e4aaf3e62e965059ae0de3f
Author:     Mark Johnston <markj at FreeBSD.org>
AuthorDate: 2021-01-09 15:03:46 +0000
Commit:     Mark Johnston <markj at FreeBSD.org>
CommitDate: 2021-01-18 17:00:00 +0000

    mvneta: Acquire the softc lock before clearing the MIB
    
    Reported by:    Andrei Martin <andrei.cos.martin at gmail.com>
    
    (cherry picked from commit 109260d202fb64be6f2efcf243c25090c1f64420)
---
 sys/dev/neta/if_mvneta.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/dev/neta/if_mvneta.c b/sys/dev/neta/if_mvneta.c
index ac15057445ee..20cc36bcce3c 100644
--- a/sys/dev/neta/if_mvneta.c
+++ b/sys/dev/neta/if_mvneta.c
@@ -1167,7 +1167,9 @@ mvneta_initreg(struct ifnet *ifp)
 	MVNETA_WRITE(sc, MVNETA_PXCX, reg);
 
 	/* clear MIB counter registers(clear by read) */
+	mvneta_sc_lock(sc);
 	mvneta_clear_mib(sc);
+	mvneta_sc_unlock(sc);
 
 	/* Set SDC register except IPGINT bits */
 	reg  = MVNETA_SDC_RXBSZ_16_64BITWORDS;


More information about the dev-commits-src-all mailing list