[VOL-4479] openonu panic in periodic-voltha-multi-uni-multiple-olts-test-bbsim-2.8 +
Onu adapter reconcilement may stuck on VLAN processing, especially in TT traffic scenarios

Signed-off-by: mpagenko <michael.pagenkopf@adtran.com>
Change-Id: I806f97c85e09bc2c741e40569a67ab3ce21300ab
diff --git a/internal/pkg/onuadaptercore/onu_device_entry.go b/internal/pkg/onuadaptercore/onu_device_entry.go
index cd2799f..64929d5 100644
--- a/internal/pkg/onuadaptercore/onu_device_entry.go
+++ b/internal/pkg/onuadaptercore/onu_device_entry.go
@@ -307,8 +307,6 @@
 	//  within the FSM event procedures
 	omciMessageReceived              chan bool    //seperate channel needed by DownloadFsm
 	omciRebootMessageReceivedChannel chan Message // channel needed by Reboot request
-
-	mutexTcontMap sync.RWMutex
 }
 
 //newOnuDeviceEntry returns a new instance of a OnuDeviceEntry
@@ -947,8 +945,8 @@
 	logger.Debugw(ctx, "allocate-free-tcont", log.Fields{"device-id": oo.deviceID, "allocID": allocID,
 		"allocated-instances": oo.sOnuPersistentData.PersTcontMap})
 
-	oo.mutexTcontMap.Lock()
-	defer oo.mutexTcontMap.Unlock()
+	oo.mutexPersOnuConfig.Lock()
+	defer oo.mutexPersOnuConfig.Unlock()
 	if entityID, ok := oo.sOnuPersistentData.PersTcontMap[allocID]; ok {
 		//tcont already allocated before, return the used instance-id
 		return entityID, true, nil
@@ -972,12 +970,11 @@
 		}
 	}
 	return 0, false, fmt.Errorf(fmt.Sprintf("no-free-tcont-left-for-device-%s", oo.deviceID))
-
 }
 
 func (oo *OnuDeviceEntry) freeTcont(ctx context.Context, allocID uint16) {
 	logger.Debugw(ctx, "free-tcont", log.Fields{"device-id": oo.deviceID, "alloc": allocID})
-	oo.mutexTcontMap.Lock()
-	defer oo.mutexTcontMap.Unlock()
+	oo.mutexPersOnuConfig.Lock()
+	defer oo.mutexPersOnuConfig.Unlock()
 	delete(oo.sOnuPersistentData.PersTcontMap, allocID)
 }