From 313ac68a3f78d4bbe728eb499e1faf8720d33d93 Mon Sep 17 00:00:00 2001 From: Venu Byravarasu Date: Thu, 5 Aug 2010 17:37:05 +0530 Subject: tegra fuse: correcting error handling With this change: 1. corrected error handling in case of failures in FUSE_SET macro. 2. Reverted changes done to make sysfs-read of SecBootDeviceConfig fuse GfShell compatible. Tested on Whistler bug 715134 Change-Id: I7c4b57e6e3abb116e53c1da887d268375ce32a5d Reviewed-on: http://git-master/r/4805 Tested-by: Venu Byravarasu Reviewed-by: Vinod Atyam Tested-by: Vinod Atyam Reviewed-by: Gary King --- arch/arm/mach-tegra/nvddk/nvddk_fuse_ap20.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-tegra/nvddk/nvddk_fuse_ap20.c b/arch/arm/mach-tegra/nvddk/nvddk_fuse_ap20.c index 4509fbdf2271..8ad5d5ba930f 100755 --- a/arch/arm/mach-tegra/nvddk/nvddk_fuse_ap20.c +++ b/arch/arm/mach-tegra/nvddk/nvddk_fuse_ap20.c @@ -1102,9 +1102,11 @@ NvError NvDdkFuseGet(NvDdkFuseDataType Type, void *pData, NvU32 *pSize) BOOT_DEVICE_INFO, BOOT_DEVICE_CONFIG, RegData); - +/* FixMe: Need to properly fix below code, for matching sysfs read with GfShell. *((NvU8 *)pData) = (RegData >> 0x8) & 0xFF; *((NvU8 *)pData + 1) = RegData & 0xFF; +*/ + *((NvU32 *)pData) = RegData; break; @@ -1296,7 +1298,7 @@ NvError NvDdkFuseSet(NvDdkFuseDataType Type, void *pData, NvU32 *pSize) if (e != NvSuccess) \ {\ NvOsDebugPrintf("\r\n Err returned from Fuse Get:0x%x in Set",e); \ - return e; \ + goto fail; \ }\ /* check consistency between existing and desired fuse values. */ \ /* fuses cannot be unburned, so desired value cannot specify */ \ @@ -1308,7 +1310,7 @@ NvError NvDdkFuseSet(NvDdkFuseDataType Type, void *pData, NvU32 *pSize) e = NvError_InvalidState; \ NvOsDebugPrintf("\n p[%d] = 0x%x, pDataptr[%d] = 0x%x",i, p[i],i,*(NvU32*)pDataPtr); \ NvOsDebugPrintf("\r\n Consistency check failure in Fuse Set:0x%x",e); \ - return e; \ + goto fail; \ } \ /* consistency check passed; schedule fuses to be burned */ \ fusememcpy(&(s_FuseData.name), (void *)pDataPtr, Size); \ -- cgit v1.2.3