From 0894d9693ceb985734bb7448d298c60379f912f1 Mon Sep 17 00:00:00 2001 From: GongHui Date: Mon, 14 Sep 2020 10:04:26 +0800 Subject: [PATCH 1/2] Description: modify driver dynamic load policy Reviewed-by: yuanbo --- core/manager/src/devhost_service_clnt.c | 1 - core/manager/src/devmgr_service.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/core/manager/src/devhost_service_clnt.c b/core/manager/src/devhost_service_clnt.c index 03c5136db..5d9d52620 100755 --- a/core/manager/src/devhost_service_clnt.c +++ b/core/manager/src/devhost_service_clnt.c @@ -62,7 +62,6 @@ int DevHostServiceClntInstallDriver(struct DevHostServiceClnt *hostClnt) } ret = devHostSvcIf->AddDevice(devHostSvcIf, deviceInfo); if (ret != HDF_SUCCESS) { - deviceInfo->preload = DEVICE_PRELOAD_DISABLE; HDF_LOGE("Install %s driver failed, ret = %d", deviceInfo->svcName, ret); } } diff --git a/core/manager/src/devmgr_service.c b/core/manager/src/devmgr_service.c index 2d0001aac..d6d5d0c0d 100755 --- a/core/manager/src/devmgr_service.c +++ b/core/manager/src/devmgr_service.c @@ -77,7 +77,7 @@ static int DevmgrServiceFindAndActiveDevice(const char *svcName, bool isLoad) HdfSListIteratorInit(&itDeviceInfo, hostClnt->deviceInfos); while (HdfSListIteratorHasNext(&itDeviceInfo)) { deviceInfo = (struct HdfDeviceInfo *)HdfSListIteratorNext(&itDeviceInfo); - if (strcmp(deviceInfo->svcName, svcName) == 0) { + if ((strcmp(deviceInfo->svcName, svcName) == 0) && (deviceInfo->preload == DEVICE_PRELOAD_DISABLE)) { return DevmgrServiceActiveDevice(hostClnt, deviceInfo, isLoad); } } -- Gitee From 466bc1b0bbe31dc17155a118ef54fcd45c3d7ec9 Mon Sep 17 00:00:00 2001 From: GongHui Date: Wed, 16 Sep 2020 10:37:07 +0800 Subject: [PATCH 2/2] Description: fix hcs parse inaccurate log --- ability/config/hcs_parser/src/hcs_blob_if.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ability/config/hcs_parser/src/hcs_blob_if.c b/ability/config/hcs_parser/src/hcs_blob_if.c index f4159e0f9..22db6fcaf 100755 --- a/ability/config/hcs_parser/src/hcs_blob_if.c +++ b/ability/config/hcs_parser/src/hcs_blob_if.c @@ -197,13 +197,11 @@ static bool CheckHcsBlobLength(const char *start, uint32_t length, struct HbcHea if (header->totalSize >= 0) { blobLength = HBC_HEADER_LENGTH + header->totalSize; g_byteAlign = false; - HDF_LOGE("%s: the blobLength: %u, byteAlign: %d, totalSize: %d", __func__, blobLength, - g_byteAlign, header->totalSize); + HDF_LOGI("%s: the blobLength: %u, byteAlign: %d", __func__, blobLength, g_byteAlign); } else { blobLength = HBC_HEADER_LENGTH - header->totalSize; g_byteAlign = true; - HDF_LOGE("%s: the blobLength: %u, byteAlign: %d, totalSize: %d", __func__, blobLength, - g_byteAlign, header->totalSize); + HDF_LOGI("%s: the blobLength: %u, byteAlign: %d", __func__, blobLength, g_byteAlign); } if ((length != blobLength) || (blobLength < minLength)) { HDF_LOGE("%s failed, Hcsblob file length is %u, But the length of calculation is %u", -- Gitee