diff --git a/VERSION b/VERSION
index bb32cc1..b8a9d37 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.11-dev126
+0.1.11-dev128
diff --git a/internal/pkg/onuadaptercore/device_handler.go b/internal/pkg/onuadaptercore/device_handler.go
index 4643e91..93dbb6c 100644
--- a/internal/pkg/onuadaptercore/device_handler.go
+++ b/internal/pkg/onuadaptercore/device_handler.go
@@ -127,6 +127,7 @@
 	stopHeartbeatCheck chan bool
 	activePorts        sync.Map
 	uniEntityMap       map[uint32]*OnuUniPort
+	reconciling        bool
 }
 
 //NewDeviceHandler creates a new device handler
@@ -150,6 +151,7 @@
 	dh.activePorts = sync.Map{}
 	//TODO initialize the support classes.
 	dh.uniEntityMap = make(map[uint32]*OnuUniPort)
+	dh.reconciling = false
 
 	// Device related state machine
 	dh.pDeviceStateFsm = fsm.NewFSM(
@@ -192,9 +194,9 @@
 // ##########################################################################################
 // DeviceHandler methods that implement the adapters interface requests ##### begin #########
 
-//AdoptDevice adopts the OLT device
-func (dh *DeviceHandler) AdoptDevice(ctx context.Context, device *voltha.Device) {
-	logger.Debugw("Adopt_device", log.Fields{"device-id": device.Id, "Address": device.GetHostAndPort()})
+//AdoptOrReconcileDevice adopts the OLT device
+func (dh *DeviceHandler) AdoptOrReconcileDevice(ctx context.Context, device *voltha.Device) {
+	logger.Debugw("Adopt_or_reconcile_device", log.Fields{"device-id": device.Id, "Address": device.GetHostAndPort()})
 
 	logger.Debugw("Device FSM: ", log.Fields{"state": string(dh.pDeviceStateFsm.Current())})
 	if dh.pDeviceStateFsm.Is(devStNull) {
@@ -203,7 +205,7 @@
 		}
 		logger.Debugw("Device FSM: ", log.Fields{"state": string(dh.pDeviceStateFsm.Current())})
 	} else {
-		logger.Debug("AdoptDevice: Agent/device init already done")
+		logger.Debugw("AdoptOrReconcileDevice: Agent/device init already done", log.Fields{"device-id": device.Id})
 	}
 
 }
@@ -426,12 +428,14 @@
 		}
 
 		if err := dh.coreProxy.DeviceReasonUpdate(context.TODO(), dh.deviceID, "omci-admin-lock"); err != nil {
+			//TODO with VOL-3045/VOL-3046: return the error and stop further processing
 			logger.Errorw("error-updating-reason-state", log.Fields{"device-id": dh.deviceID, "error": err})
 		}
 		dh.deviceReason = "omci-admin-lock"
 		//200604: ConnState improved to 'unreachable' (was not set in python-code), OperState 'unknown' seems to be best choice
 		if err := dh.coreProxy.DeviceStateUpdate(context.TODO(), dh.deviceID, voltha.ConnectStatus_UNREACHABLE,
 			voltha.OperStatus_UNKNOWN); err != nil {
+			//TODO with VOL-3045/VOL-3046: return the error and stop further processing
 			logger.Errorw("error-updating-device-state", log.Fields{"device-id": dh.deviceID, "error": err})
 		}
 	}
@@ -446,11 +450,13 @@
 	// TODO!!! ConnectStatus and OperStatus to be set here could be more accurate, for now just ...(like python code)
 	if err := dh.coreProxy.DeviceStateUpdate(context.TODO(), dh.deviceID, voltha.ConnectStatus_REACHABLE,
 		voltha.OperStatus_ACTIVE); err != nil {
+		//TODO with VOL-3045/VOL-3046: return the error and stop further processing
 		logger.Errorw("error-updating-device-state", log.Fields{"device-id": dh.deviceID, "error": err})
 	}
 
 	// TODO!!! DeviceReason to be set here could be more accurate, for now just ...(like python code)
 	if err := dh.coreProxy.DeviceReasonUpdate(context.TODO(), dh.deviceID, "initial-mib-downloaded"); err != nil {
+		//TODO with VOL-3045/VOL-3046: return the error and stop further processing
 		logger.Errorw("error-updating-reason-state", log.Fields{"device-id": dh.deviceID, "error": err})
 	}
 	dh.deviceReason = "initial-mib-downloaded"
@@ -466,13 +472,51 @@
 	}
 }
 
-func (dh *DeviceHandler) ReconcileDevice(device *voltha.Device) error {
-	logger.Debugw("reconcile-device", log.Fields{"device-id": device.Id, "SerialNumber": device.SerialNumber})
+func (dh *DeviceHandler) ReconcileDeviceOnuInd() {
+	logger.Debugw("reconciling - simulate onu indication", log.Fields{"device-id": dh.deviceID})
+
 	if err := dh.pOnuTP.restoreFromOnuTpPathKvStore(context.TODO()); err != nil {
-		return err
+		logger.Errorw("reconciling - restoring OnuTp-data failed - abort", log.Fields{"err": err, "device-id": dh.deviceID})
+		dh.reconciling = false
+		return
 	}
-	// TODO: further actions - init PON, metrics, reload DB ...
-	return nil
+	var onu_indication oop.OnuIndication
+	onu_indication.IntfId = dh.pOnuTP.sOnuPersistentData.PersIntfID
+	onu_indication.OnuId = dh.pOnuTP.sOnuPersistentData.PersOnuID
+	onu_indication.OperState = dh.pOnuTP.sOnuPersistentData.PersOperState
+	onu_indication.AdminState = dh.pOnuTP.sOnuPersistentData.PersAdminState
+	dh.create_interface(&onu_indication)
+}
+
+func (dh *DeviceHandler) ReconcileDeviceTechProf() {
+	logger.Debugw("reconciling - trigger tech profile config", log.Fields{"device-id": dh.deviceID})
+
+	dh.pOnuTP.lockTpProcMutex()
+	// lock hangs as long as below decoupled or other related TechProfile processing is active
+	for _, uniData := range dh.pOnuTP.sOnuPersistentData.PersUniTpPath {
+		//In order to allow concurrent calls to other dh instances we do not wait for execution here
+		//but doing so we can not indicate problems to the caller (who does what with that then?)
+		//by now we just assume straightforward successful execution
+		//TODO!!! Generally: In this scheme it would be good to have some means to indicate
+		//  possible problems to the caller later autonomously
+
+		// deadline context to ensure completion of background routines waited for
+		//20200721: 10s proved to be less in 8*8 ONU test on local vbox machine with debug, might be further adapted
+		deadline := time.Now().Add(30 * time.Second) //allowed run time to finish before execution
+		dctx, cancel := context.WithDeadline(context.Background(), deadline)
+
+		dh.pOnuTP.resetProcessingErrorIndication()
+		var wg sync.WaitGroup
+		wg.Add(1) // for the 1 go routines to finish
+		// attention: deadline completion check and wg.Done is to be done in both routines
+		go dh.pOnuTP.configureUniTp(dctx, uniData.PersUniId, uniData.PersTpPath, &wg)
+		//the wait.. function is responsible for tpProcMutex.Unlock()
+		dh.pOnuTP.waitForTpCompletion(cancel, &wg) //wait for background process to finish and collect their result
+		return
+	}
+	dh.pOnuTP.unlockTpProcMutex()
+	//TODO: reset of reconciling-flag has always to be done in the last ReconcileDevice*() function
+	dh.reconciling = false
 }
 
 func (dh *DeviceHandler) DeleteDevice(device *voltha.Device) error {
@@ -493,10 +537,12 @@
 	dh.pOnuOmciDevice.Reboot(context.TODO())
 	if err := dh.coreProxy.DeviceStateUpdate(context.TODO(), dh.deviceID, voltha.ConnectStatus_UNREACHABLE,
 		voltha.OperStatus_DISCOVERED); err != nil {
+		//TODO with VOL-3045/VOL-3046: return the error and stop further processing
 		logger.Errorw("error-updating-device-state", log.Fields{"device-id": dh.deviceID, "error": err})
 		return err
 	}
 	if err := dh.coreProxy.DeviceReasonUpdate(context.TODO(), dh.deviceID, "rebooting-onu"); err != nil {
+		//TODO with VOL-3045/VOL-3046: return the error and stop further processing
 		logger.Errorw("error-updating-reason-state", log.Fields{"device-id": dh.deviceID, "error": err})
 		return err
 	}
@@ -504,54 +550,6 @@
 	return nil
 }
 
-//GetOfpPortInfo returns the Voltha PortCapabilty with the logical port
-//func (dh *DeviceHandler) GetOfpPortInfo(device *voltha.Device,
-//	portNo int64) (*ic.PortCapability, error) {
-//	logger.Debugw("GetOfpPortInfo start", log.Fields{"deviceID": device.Id, "portNo": portNo})
-
-//function body as per OLTAdapter handler code
-// adapted with values from py dapter code
-//	if pUniPort, exist := dh.uniEntityMap[uint32(portNo)]; exist {
-//		var macOctets [6]uint8
-//		macOctets[5] = 0x08
-//		macOctets[4] = uint8(dh.ponPortNumber >> 8)
-//		macOctets[3] = uint8(dh.ponPortNumber)
-//		macOctets[2] = uint8(portNo >> 16)
-//		macOctets[1] = uint8(portNo >> 8)
-//		macOctets[0] = uint8(portNo)
-//		hwAddr := genMacFromOctets(macOctets)
-//		capacity := uint32(of.OfpPortFeatures_OFPPF_1GB_FD | of.OfpPortFeatures_OFPPF_FIBER)
-//		name := device.SerialNumber + "-" + strconv.FormatUint(uint64(pUniPort.macBpNo), 10)
-//		ofUniPortState := of.OfpPortState_OFPPS_LINK_DOWN
-//		if pUniPort.operState == vc.OperStatus_ACTIVE {
-//			ofUniPortState = of.OfpPortState_OFPPS_LIVE
-//		}
-//		logger.Debugw("setting LogicalPort", log.Fields{"with-name": name,
-//			"withUniPort": pUniPort.name, "withMacBase": hwAddr, "OperState": ofUniPortState})
-
-//		return &ic.PortCapability{
-//			Port: &voltha.LogicalPort{
-//				OfpPort: &of.OfpPort{
-//					Name: name,
-//					//HwAddr:     macAddressToUint32Array(dh.device.MacAddress),
-//					HwAddr:     macAddressToUint32Array(hwAddr),
-//					Config:     0,
-//					State:      uint32(ofUniPortState),
-//					Curr:       capacity,
-//					Advertised: capacity,
-//					Peer:       capacity,
-//					CurrSpeed:  uint32(of.OfpPortFeatures_OFPPF_1GB_FD),
-//					MaxSpeed:   uint32(of.OfpPortFeatures_OFPPF_1GB_FD),
-//				},
-//				DeviceId:     device.Id,
-//				DevicePortNo: uint32(portNo),
-//			},
-//		}, nil
-//	}
-//	logger.Warnw("No UniPort found - abort", log.Fields{"for PortNo": uint32(portNo)})
-//	return nil, errors.New("UniPort not found")
-//}
-
 //  DeviceHandler methods that implement the adapters interface requests## end #########
 // #####################################################################################
 
@@ -576,7 +574,13 @@
 	dh.deviceReason = "activating-onu"
 
 	dh.logicalDeviceID = dh.deviceID // really needed - what for ??? //TODO!!!
-	dh.coreProxy.DeviceUpdate(context.TODO(), dh.device)
+
+	if !dh.reconciling {
+		dh.coreProxy.DeviceUpdate(context.TODO(), dh.device)
+	} else {
+		logger.Debugw("reconciling - don't notify core about DeviceUpdate",
+			log.Fields{"device-id": dh.deviceID})
+	}
 
 	dh.parentId = dh.device.ParentId
 	dh.ponPortNumber = dh.device.ParentPortNo
@@ -597,24 +601,28 @@
 				   oper_status=self._pon.get_port().oper_status,
 				   )
 	*/
-	logger.Debug("adding-pon-port")
-	var ponPortNo uint32 = 1
-	if dh.ponPortNumber != 0 {
-		ponPortNo = dh.ponPortNumber
-	}
+	if !dh.reconciling {
+		logger.Debugw("adding-pon-port", log.Fields{"deviceID": dh.deviceID, "ponPortNo": dh.ponPortNumber})
+		var ponPortNo uint32 = 1
+		if dh.ponPortNumber != 0 {
+			ponPortNo = dh.ponPortNumber
+		}
 
-	pPonPort := &voltha.Port{
-		PortNo:     ponPortNo,
-		Label:      fmt.Sprintf("pon-%d", ponPortNo),
-		Type:       voltha.Port_PON_ONU,
-		OperStatus: voltha.OperStatus_ACTIVE,
-		Peers: []*voltha.Port_PeerPort{{DeviceId: dh.parentId, // Peer device  is OLT
-			PortNo: ponPortNo}}, // Peer port is parent's port number
-	}
-	if err = dh.coreProxy.PortCreated(context.TODO(), dh.deviceID, pPonPort); err != nil {
-		logger.Fatalf("Device FSM: PortCreated-failed-%s", err)
-		e.Cancel(err)
-		return
+		pPonPort := &voltha.Port{
+			PortNo:     ponPortNo,
+			Label:      fmt.Sprintf("pon-%d", ponPortNo),
+			Type:       voltha.Port_PON_ONU,
+			OperStatus: voltha.OperStatus_ACTIVE,
+			Peers: []*voltha.Port_PeerPort{{DeviceId: dh.parentId, // Peer device  is OLT
+				PortNo: ponPortNo}}, // Peer port is parent's port number
+		}
+		if err = dh.coreProxy.PortCreated(context.TODO(), dh.deviceID, pPonPort); err != nil {
+			logger.Fatalf("Device FSM: PortCreated-failed-%s", err)
+			e.Cancel(err)
+			return
+		}
+	} else {
+		logger.Debugw("reconciling - pon-port already added", log.Fields{"device-id": dh.deviceID})
 	}
 	logger.Debug("doStateInit-done")
 }
@@ -635,6 +643,10 @@
 		return
 	}
 
+	if dh.reconciling {
+		go dh.ReconcileDeviceOnuInd()
+		// reconcilement will be continued after mib download is done
+	}
 	/*
 			############################################################################
 			# Setup Alarm handler
@@ -854,9 +866,15 @@
 
 	dh.pOnuIndication = onuind // let's revise if storing the pointer is sufficient...
 
-	if err := dh.coreProxy.DeviceStateUpdate(context.TODO(), dh.deviceID,
-		voltha.ConnectStatus_REACHABLE, voltha.OperStatus_ACTIVATING); err != nil {
-		logger.Errorw("error-updating-device-state", log.Fields{"device-id": dh.deviceID, "error": err})
+	if !dh.reconciling {
+		if err := dh.coreProxy.DeviceStateUpdate(context.TODO(), dh.deviceID,
+			voltha.ConnectStatus_REACHABLE, voltha.OperStatus_ACTIVATING); err != nil {
+			//TODO with VOL-3045/VOL-3046: return the error and stop further processing
+			logger.Errorw("error-updating-device-state", log.Fields{"device-id": dh.deviceID, "error": err})
+		}
+	} else {
+		logger.Debugw("reconciling - don't notify core about DeviceStateUpdate to ACTIVATING",
+			log.Fields{"device-id": dh.deviceID})
 	}
 	// It does not look to me as if makes sense to work with the real core device here, (not the stored clone)?
 	// in this code the GetDevice would just make a check if the DeviceID's Device still exists in core
@@ -879,8 +897,14 @@
 		logger.Errorw("No valid OnuDevice -aborting", log.Fields{"device-id": dh.deviceID})
 		return errors.New("No valid OnuDevice")
 	}
-	if err := dh.coreProxy.DeviceReasonUpdate(context.TODO(), dh.deviceID, "starting-openomci"); err != nil {
-		logger.Errorw("error-DeviceReasonUpdate to starting-openomci", log.Fields{"device-id": dh.deviceID, "error": err})
+	if !dh.reconciling {
+		if err := dh.coreProxy.DeviceReasonUpdate(context.TODO(), dh.deviceID, "starting-openomci"); err != nil {
+			//TODO with VOL-3045/VOL-3046: return the error and stop further processing
+			logger.Errorw("error-DeviceReasonUpdate to starting-openomci", log.Fields{"device-id": dh.deviceID, "error": err})
+		}
+	} else {
+		logger.Debugw("reconciling - don't notify core about DeviceReasonUpdate to starting-openomci",
+			log.Fields{"device-id": dh.deviceID})
 	}
 	dh.deviceReason = "starting-openomci"
 
@@ -1080,6 +1104,7 @@
 		dh.disableUniPortStateUpdate()
 
 		if err := dh.coreProxy.DeviceReasonUpdate(context.TODO(), dh.deviceID, "stopping-openomci"); err != nil {
+			//TODO with VOL-3045/VOL-3046: return the error and stop further processing
 			logger.Errorw("error-DeviceReasonUpdate to 'stopping-openomci'",
 				log.Fields{"device-id": dh.deviceID, "error": err})
 			// abort: system behavior is just unstable ...
@@ -1089,6 +1114,7 @@
 
 		if err := dh.coreProxy.DeviceStateUpdate(context.TODO(), dh.deviceID,
 			voltha.ConnectStatus_UNREACHABLE, voltha.OperStatus_DISCOVERED); err != nil {
+			//TODO with VOL-3045/VOL-3046: return the error and stop further processing
 			logger.Errorw("error-updating-device-state unreachable-discovered",
 				log.Fields{"device-id": dh.deviceID, "error": err})
 			// abort: system behavior is just unstable ...
@@ -1106,12 +1132,18 @@
 	case MibDatabaseSync:
 		{
 			logger.Debugw("MibInSync event received", log.Fields{"device-id": dh.deviceID})
-			//initiate DevStateUpdate
-			if err := dh.coreProxy.DeviceReasonUpdate(context.TODO(), dh.deviceID, "discovery-mibsync-complete"); err != nil {
-				logger.Errorw("error-DeviceReasonUpdate to 'mibsync-complete'", log.Fields{
-					"device-id": dh.deviceID, "error": err})
+			if !dh.reconciling {
+				//initiate DevStateUpdate
+				if err := dh.coreProxy.DeviceReasonUpdate(context.TODO(), dh.deviceID, "discovery-mibsync-complete"); err != nil {
+					//TODO with VOL-3045/VOL-3046: return the error and stop further processing
+					logger.Errorw("error-DeviceReasonUpdate to 'mibsync-complete'", log.Fields{
+						"device-id": dh.deviceID, "error": err})
+				} else {
+					logger.Infow("dev reason updated to 'MibSync complete'", log.Fields{"deviceID": dh.deviceID})
+				}
 			} else {
-				logger.Infow("dev reason updated to 'MibSync complete'", log.Fields{"device-id": dh.deviceID})
+				logger.Debugw("reconciling - don't notify core about DeviceReasonUpdate to mibsync-complete",
+					log.Fields{"device-id": dh.deviceID})
 			}
 			//set internal state anyway - as it was done
 			dh.deviceReason = "discovery-mibsync-complete"
@@ -1191,18 +1223,29 @@
 		{
 			logger.Debugw("MibDownloadDone event received", log.Fields{"device-id": dh.deviceID})
 			//initiate DevStateUpdate
-			if err := dh.coreProxy.DeviceStateUpdate(context.TODO(), dh.deviceID,
-				voltha.ConnectStatus_REACHABLE, voltha.OperStatus_ACTIVE); err != nil {
-				logger.Errorw("error-updating-device-state", log.Fields{"device-id": dh.deviceID, "error": err})
+			if !dh.reconciling {
+				if err := dh.coreProxy.DeviceStateUpdate(context.TODO(), dh.deviceID,
+					voltha.ConnectStatus_REACHABLE, voltha.OperStatus_ACTIVE); err != nil {
+					//TODO with VOL-3045/VOL-3046: return the error and stop further processing
+					logger.Errorw("error-updating-device-state", log.Fields{"device-id": dh.deviceID, "error": err})
+				} else {
+					logger.Debugw("dev state updated to 'Oper.Active'", log.Fields{"device-id": dh.deviceID})
+				}
 			} else {
-				logger.Debugw("dev state updated to 'Oper.Active'", log.Fields{"device-id": dh.deviceID})
+				logger.Debugw("reconciling - don't notify core about DeviceStateUpdate to ACTIVE",
+					log.Fields{"device-id": dh.deviceID})
 			}
-
-			if err := dh.coreProxy.DeviceReasonUpdate(context.TODO(), dh.deviceID, "initial-mib-downloaded"); err != nil {
-				logger.Errorw("error-DeviceReasonUpdate to 'initial-mib-downloaded'",
-					log.Fields{"device-id": dh.deviceID, "error": err})
+			if !dh.reconciling {
+				if err := dh.coreProxy.DeviceReasonUpdate(context.TODO(), dh.deviceID, "initial-mib-downloaded"); err != nil {
+					//TODO with VOL-3045/VOL-3046: return the error and stop further processing
+					logger.Errorw("error-DeviceReasonUpdate to 'initial-mib-downloaded'",
+						log.Fields{"device-id": dh.deviceID, "error": err})
+				} else {
+					logger.Infow("dev reason updated to 'initial-mib-downloaded'", log.Fields{"device-id": dh.deviceID})
+				}
 			} else {
-				logger.Infow("dev reason updated to 'initial-mib-downloaded'", log.Fields{"device-id": dh.deviceID})
+				logger.Debugw("reconciling - don't notify core about DeviceReasonUpdate to initial-mib-downloaded",
+					log.Fields{"device-id": dh.deviceID})
 			}
 			//set internal state anyway - as it was done
 			dh.deviceReason = "initial-mib-downloaded"
@@ -1218,9 +1261,16 @@
 		{
 			go dh.enableUniPortStateUpdate() //cmp python yield self.enable_ports()
 
-			logger.Infow("UniUnlockStateDone event: Sending OnuUp event", log.Fields{"device-id": dh.deviceID})
-			raisedTs := time.Now().UnixNano()
-			go dh.sendOnuOperStateEvent(voltha.OperStatus_ACTIVE, dh.deviceID, raisedTs) //cmp python onu_active_event
+			if !dh.reconciling {
+				logger.Infow("UniUnlockStateDone event: Sending OnuUp event", log.Fields{"device-id": dh.deviceID})
+				raisedTs := time.Now().UnixNano()
+				go dh.sendOnuOperStateEvent(voltha.OperStatus_ACTIVE, dh.deviceID, raisedTs) //cmp python onu_active_event
+			} else {
+				logger.Debugw("reconciling - don't notify core that onu went to active but trigger tech profile config",
+					log.Fields{"device-id": dh.deviceID})
+				go dh.ReconcileDeviceTechProf()
+				//TODO: further actions e.g. restore flows, metrics, ...
+			}
 		}
 	case OmciAniConfigDone:
 		{
@@ -1231,11 +1281,17 @@
 			//  - which may cause some inconsistency
 			if dh.deviceReason != "tech-profile-config-download-success" {
 				// which may be the case from some previous actvity on another UNI Port of the ONU
-				if err := dh.coreProxy.DeviceReasonUpdate(context.TODO(), dh.deviceID, "tech-profile-config-download-success"); err != nil {
-					logger.Errorw("error-DeviceReasonUpdate to 'tech-profile-config-download-success'",
-						log.Fields{"device-id": dh.deviceID, "error": err})
+				if !dh.reconciling {
+					if err := dh.coreProxy.DeviceReasonUpdate(context.TODO(), dh.deviceID, "tech-profile-config-download-success"); err != nil {
+						//TODO with VOL-3045/VOL-3046: return the error and stop further processing
+						logger.Errorw("error-DeviceReasonUpdate to 'tech-profile-config-download-success'",
+							log.Fields{"device-id": dh.deviceID, "error": err})
+					} else {
+						logger.Infow("update dev reason to 'tech-profile-config-download-success'",
+							log.Fields{"device-id": dh.deviceID})
+					}
 				} else {
-					logger.Infow("update dev reason to 'tech-profile-config-download-success'",
+					logger.Debugw("reconciling - don't notify core about DeviceReasonUpdate to tech-profile-config-download-success",
 						log.Fields{"device-id": dh.deviceID})
 				}
 				//set internal state anyway - as it was done
@@ -1263,10 +1319,14 @@
 		} else {
 			//store UniPort with the System-PortNumber key
 			dh.uniEntityMap[uniNo] = pUniPort
-			// create announce the UniPort to the core as VOLTHA Port object
-			if err := pUniPort.CreateVolthaPort(dh); err == nil {
-				logger.Infow("onuUniPort-added", log.Fields{"for PortNo": uniNo})
-			} //error logging already within UniPort method
+			if !dh.reconciling {
+				// create announce the UniPort to the core as VOLTHA Port object
+				if err := pUniPort.CreateVolthaPort(dh); err == nil {
+					logger.Infow("onuUniPort-added", log.Fields{"for PortNo": uniNo})
+				} //error logging already within UniPort method
+			} else {
+				logger.Debugw("reconciling - onuUniPort already added", log.Fields{"for PortNo": uniNo, "device-id": dh.deviceID})
+			}
 		}
 	}
 }
@@ -1286,8 +1346,12 @@
 		if (1<<uniPort.uniId)&ActiveUniPortStateUpdateMask == (1 << uniPort.uniId) {
 			logger.Infow("onuUniPort-forced-OperState-ACTIVE", log.Fields{"for PortNo": uniNo})
 			uniPort.SetOperState(vc.OperStatus_ACTIVE)
-			//maybe also use getter functions on uniPort - perhaps later ...
-			go dh.coreProxy.PortStateUpdate(context.TODO(), dh.deviceID, voltha.Port_ETHERNET_UNI, uniPort.portNo, uniPort.operState)
+			if !dh.reconciling {
+				//maybe also use getter functions on uniPort - perhaps later ...
+				go dh.coreProxy.PortStateUpdate(context.TODO(), dh.deviceID, voltha.Port_ETHERNET_UNI, uniPort.portNo, uniPort.operState)
+			} else {
+				logger.Debugw("reconciling - don't notify core about PortStateUpdate", log.Fields{"device-id": dh.deviceID})
+			}
 		}
 	}
 }
diff --git a/internal/pkg/onuadaptercore/openonu.go b/internal/pkg/onuadaptercore/openonu.go
index fae3144..5dcf108 100644
--- a/internal/pkg/onuadaptercore/openonu.go
+++ b/internal/pkg/onuadaptercore/openonu.go
@@ -157,7 +157,7 @@
 	if handler = oo.getDeviceHandler(device.Id); handler == nil {
 		handler := NewDeviceHandler(oo.coreProxy, oo.adapterProxy, oo.eventProxy, device, oo)
 		oo.addDeviceHandlerToMap(ctx, handler)
-		go handler.AdoptDevice(ctx, device)
+		go handler.AdoptOrReconcileDevice(ctx, device)
 		// Launch the creation of the device topic
 		// go oo.createDeviceTopic(device)
 	}
@@ -217,14 +217,22 @@
 
 //Reconcile_device is called once when the adapter needs to re-create device - usually on core restart
 func (oo *OpenONUAC) Reconcile_device(device *voltha.Device) error {
-	logger.Debugw("Reconcile_device", log.Fields{"device-id": device.Id})
-	if handler := oo.getDeviceHandler(device.Id); handler != nil {
-		if err := handler.ReconcileDevice(device); err != nil {
-			return err
-		}
+	if device == nil {
+		logger.Warn("voltha-device-is-nil")
+		return errors.New("nil-device")
+	}
+	ctx := context.Background()
+	logger.Infow("Reconcile_device", log.Fields{"device-id": device.Id})
+	var handler *DeviceHandler
+	if handler = oo.getDeviceHandler(device.Id); handler == nil {
+		handler := NewDeviceHandler(oo.coreProxy, oo.adapterProxy, oo.eventProxy, device, oo)
+		oo.addDeviceHandlerToMap(ctx, handler)
+		handler.device = device
+		handler.reconciling = true
+		go handler.AdoptOrReconcileDevice(ctx, handler.device)
+		// reconcilement will be continued after onu-device entry is added
 	} else {
-		logger.Warnw("no handler found for device-reconcilement", log.Fields{"device-id": device.Id})
-		return fmt.Errorf(fmt.Sprintf("handler-not-found-%s", device.Id))
+		return fmt.Errorf(fmt.Sprintf("device-already-reconciled-or-active-%s", device.Id))
 	}
 	return nil
 }
