From ced61e7aeefda999037013f48ad3014a47e2eff6 Mon Sep 17 00:00:00 2001 From: xiongchangwu Date: Tue, 17 Dec 2024 22:28:53 +0800 Subject: [PATCH] modify startHost Signed-off-by: xiongchangwu --- adapter/uhdf2/manager/src/devmgr_service_stub.c | 2 +- framework/core/manager/src/devmgr_service.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/adapter/uhdf2/manager/src/devmgr_service_stub.c b/adapter/uhdf2/manager/src/devmgr_service_stub.c index 7cb72a928..7eaa093f8 100644 --- a/adapter/uhdf2/manager/src/devmgr_service_stub.c +++ b/adapter/uhdf2/manager/src/devmgr_service_stub.c @@ -197,7 +197,7 @@ int32_t DevmgrServiceStubDispatch(struct HdfRemoteService *stub, int code, struc HDF_LOGE("%{public}s devmgr service stub dispach failed, cmd id is %{public}d, ret = %{public}d", __func__, code, ret); } - return HDF_SUCCESS; + return ret; } // LCOV_EXCL_START diff --git a/framework/core/manager/src/devmgr_service.c b/framework/core/manager/src/devmgr_service.c index fe66b391f..9beac9167 100644 --- a/framework/core/manager/src/devmgr_service.c +++ b/framework/core/manager/src/devmgr_service.c @@ -51,13 +51,13 @@ static bool DevmgrServiceDynamicDevInfoFound( return false; } -#define WAIT_HOST_SLEEP_TIME 1 // ms +#define WAIT_HOST_SLEEP_TIME 2 // ms #define WAIT_HOST_SLEEP_CNT 1000 static int DevmgrServiceStartHostProcess(struct DevHostServiceClnt *hostClnt, bool sync, bool dynamic) { int waitCount = WAIT_HOST_SLEEP_CNT; struct IDriverInstaller *installer = DriverInstallerGetInstance(); - if (installer == NULL || installer->StartDeviceHost == NULL) { + if (installer == NULL || installer->StartDeviceHost == NULL || installer->StopDeviceHost == NULL) { HDF_LOGE("invalid installer"); return HDF_FAILURE; } @@ -79,6 +79,7 @@ static int DevmgrServiceStartHostProcess(struct DevHostServiceClnt *hostClnt, bo if (waitCount <= 0) { HDF_LOGE("wait host(%{public}s, %{public}d) attach timeout", hostClnt->hostName, hostClnt->hostId); + installer->StopDeviceHost(hostClnt->hostId, hostClnt->hostName); hostClnt->hostPid = -1; return HDF_ERR_TIMEOUT; } -- Gitee