From 0119aa9e9d77ea8ee9b756d0d749a5dd576f9bf6 Mon Sep 17 00:00:00 2001 From: Gary King Date: Wed, 1 Sep 2010 13:13:45 -0700 Subject: [PATCH] [ARM] tegra: nvrm_transport: send address message after AVP init rather than storing the address message in the mailbox when the shared message memory is allocated during kernel init, send the message after the AVP is initialized. this prevents the message from being "lost" if the system enters LP0 before initializing the AVP. Change-Id: I14634e2a53abacf840ed906451f1a07016a99015 Signed-off-by: Gary King --- .../nv/nvrm/core/common/nvrm_moduleloader.c | 12 ++++++------ .../mach-tegra/nv/nvrm/core/common/nvrm_transport.c | 8 +++++++- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/arch/arm/mach-tegra/nv/nvrm/core/common/nvrm_moduleloader.c b/arch/arm/mach-tegra/nv/nvrm/core/common/nvrm_moduleloader.c index f15c90e79a8b..22241b72a70e 100644 --- a/arch/arm/mach-tegra/nv/nvrm/core/common/nvrm_moduleloader.c +++ b/arch/arm/mach-tegra/nv/nvrm/core/common/nvrm_moduleloader.c @@ -282,14 +282,12 @@ static NvError PrivateOsFopen( if (hFile == NULL) return NvError_InsufficientMemory; - NvOsDebugPrintf("%s : file=%s\n", __func__, filename); - NvOsDebugPrintf("%s : calling request_firmware()\n", __func__); + pr_debug("%s : file=%s\n", __func__, filename); if (request_firmware(&s_FwEntry, filename, nvfw_dev.this_device) != 0) { pr_err("%s: Cannot read firmware '%s'\n", __func__, filename); return NvError_FileReadFailed; } - NvOsDebugPrintf("%s : back from request_firmware()\n", __func__); hFile->pstart = s_FwEntry->data; hFile->pread = s_FwEntry->data; hFile->pend = s_FwEntry->data + s_FwEntry->size; @@ -316,7 +314,6 @@ NvError NvRmLoadLibrary( NvError Error = NvSuccess; NV_ASSERT(sizeOfArgs <= MAX_ARGS_SIZE); - NvOsDebugPrintf("%s : file=%s\n", __func__, pLibName); Error = NvRmLoadLibraryEx(hDevice, pLibName, pArgs, sizeOfArgs, NV_FALSE, hLibHandle); return Error; @@ -341,8 +338,6 @@ NvError NvRmLoadLibraryEx( NV_ASSERT(sizeOfArgs <= MAX_ARGS_SIZE); - NvOsDebugPrintf("%s : file=%s\n", __func__, pLibName); - NV_CHECK_ERROR_CLEANUP(NvRmPrivInitAvp(hDevice)); e = NvRmPrivRPCConnect(s_RPCHandle); @@ -535,6 +530,8 @@ static void NvRmPrivResetAvp(NvRmDeviceHandle hRm, unsigned long reset_va) writel(tmp, _TEGRA_AVP_RESET_VECTOR_ADDR); } +void NvRmPrivXpcSendMsgAddress(void); + static NvError NvRmPrivInitAvp(NvRmDeviceHandle hRm) { u32 *stub_phys = &_tegra_avp_launcher_stub_data[AVP_LAUNCHER_MMU_PHYSICAL]; @@ -573,6 +570,9 @@ static NvError NvRmPrivInitAvp(NvRmDeviceHandle hRm) NvRmPrivResetAvp(hRm, 0x00100000ul); NV_CHECK_ERROR_CLEANUP(NvRmPrivInitService(hRm)); + + NvRmPrivXpcSendMsgAddress(); + e = NvRmPrivInitModuleLoaderRPC(hRm); if (e != NvSuccess) { diff --git a/arch/arm/mach-tegra/nv/nvrm/core/common/nvrm_transport.c b/arch/arm/mach-tegra/nv/nvrm/core/common/nvrm_transport.c index 8227b9f2ca45..97a669879046 100644 --- a/arch/arm/mach-tegra/nv/nvrm/core/common/nvrm_transport.c +++ b/arch/arm/mach-tegra/nv/nvrm/core/common/nvrm_transport.c @@ -611,6 +611,13 @@ RegisterTransportInterrupt(NvRmDeviceHandle hDevice) return NvSuccess; } +void NvRmPrivXpcSendMsgAddress(void) +{ + BUG_ON(!s_TransportInfo.MessageMemPhysAddr); + NvRmPrivXpcSendMessage(s_TransportInfo.hXpc, + s_TransportInfo.MessageMemPhysAddr); +} + // allocate buffers to be used for sending/receiving messages. static void NvRmPrivTransportAllocBuffers(NvRmDeviceHandle hRmDevice) @@ -657,7 +664,6 @@ NvRmPrivTransportAllocBuffers(NvRmDeviceHandle hRmDevice) NvRmMemWr32(hNewMemHandle, 0, 0xdeadf00d); // set this non-zero to throttle messages to the avp till avp is ready. NvRmMemWr32(hNewMemHandle, MAX_MESSAGE_LENGTH + MAX_COMMAND_SIZE, 0); - NvRmPrivXpcSendMessage(s_TransportInfo.hXpc, s_TransportInfo.MessageMemPhysAddr); return; -- 2.34.1