mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-11 13:27:06 +09:00
[ARM] tegra: nvrm: make RM transport a bit quieter.
Change-Id: Ic82c256ed229e7c8042bd23270ae443bbe7534cf Signed-off-by: Gary King <gking@nvidia.com>
This commit is contained in:
@@ -63,8 +63,6 @@ static void ServiceThread( void *args )
|
||||
static NvU8 ReceiveMessage[MAX_MESSAGE_LENGTH];
|
||||
NvU32 MessageLength = 0;
|
||||
|
||||
NvOsDebugPrintf("%s: started\n", __func__);
|
||||
|
||||
Error = NvRmPrivRPCWaitForConnect(gs_hRPCHandle);
|
||||
if (Error)
|
||||
{
|
||||
@@ -95,8 +93,6 @@ NvError NvRmPrivRPCInit(NvRmDeviceHandle hDeviceHandle, char* portName,
|
||||
{
|
||||
NvError Error = NvSuccess;
|
||||
|
||||
NvOsDebugPrintf("%s: portName=%s\n", __func__, portName);
|
||||
|
||||
*hRPCHandle = NvOsAlloc(sizeof(NvRmRPC));
|
||||
if (!*hRPCHandle)
|
||||
{
|
||||
@@ -115,8 +111,6 @@ NvError NvRmPrivRPCInit(NvRmDeviceHandle hDeviceHandle, char* portName,
|
||||
}
|
||||
if (! strcmp(portName, "RPC_AVP_PORT")) {
|
||||
if (g_hTransportAvp) panic("%s: g_hTransportAvp is already set.\n", __func__);
|
||||
NvOsDebugPrintf("%s: creating RPC_AVP_PORT.\n", __func__);
|
||||
|
||||
Error = NvOsSemaphoreCreate(&g_hTransportAvpSem, 0);
|
||||
if (Error != NvSuccess) panic(__func__);
|
||||
|
||||
@@ -127,12 +121,9 @@ NvError NvRmPrivRPCInit(NvRmDeviceHandle hDeviceHandle, char* portName,
|
||||
(*hRPCHandle)->svcTransportHandle = g_hTransportAvp;
|
||||
(*hRPCHandle)->TransportRecvSemId = g_hTransportAvpSem;
|
||||
(*hRPCHandle)->isConnected = g_hTransportAvpIsConnected;
|
||||
NvOsDebugPrintf("%s: isConnected=%d\n", __func__, g_hTransportAvpIsConnected);
|
||||
}
|
||||
if (! strcmp(portName, "RPC_CPU_PORT")) {
|
||||
if (g_hTransportCpu) panic("%s: g_hTransportCpu is already set.\n", __func__);
|
||||
NvOsDebugPrintf("%s: creating RPC_CPU_PORT.\n", __func__);
|
||||
|
||||
Error = NvOsSemaphoreCreate(&g_hTransportCpuSem, 0);
|
||||
if (Error != NvSuccess) panic(__func__);
|
||||
|
||||
@@ -143,7 +134,6 @@ NvError NvRmPrivRPCInit(NvRmDeviceHandle hDeviceHandle, char* portName,
|
||||
(*hRPCHandle)->svcTransportHandle = g_hTransportCpu;
|
||||
(*hRPCHandle)->TransportRecvSemId = g_hTransportCpuSem;
|
||||
(*hRPCHandle)->isConnected = g_hTransportCpuIsConnected;
|
||||
NvOsDebugPrintf("%s: isConnected=%d\n", __func__, g_hTransportCpuIsConnected);
|
||||
}
|
||||
(*hRPCHandle)->hRmDevice = hDeviceHandle;
|
||||
|
||||
@@ -190,11 +180,9 @@ void NvRmPrivRPCSendMsgWithResponse( NvRmRPCHandle hRPCHandle,
|
||||
NvU32 MessageSize)
|
||||
{
|
||||
NvError Error = NvSuccess;
|
||||
NvOsDebugPrintf("%s: started\n", __func__);
|
||||
NV_ASSERT(hRPCHandle->svcTransportHandle != NULL);
|
||||
|
||||
NvOsMutexLock(hRPCHandle->RecvLock);
|
||||
NvOsDebugPrintf("%s: calling NvRmTransportSendMsg\n", __func__);
|
||||
Error = NvRmTransportSendMsg(hRPCHandle->svcTransportHandle,
|
||||
pSendMessageBuffer, MessageSize, NV_WAIT_INFINITE);
|
||||
if (Error)
|
||||
@@ -203,12 +191,8 @@ void NvRmPrivRPCSendMsgWithResponse( NvRmRPCHandle hRPCHandle,
|
||||
NvOsDebugPrintf("%s: error in NvRmTransportSendMsg\n", __func__);
|
||||
goto clean_up;
|
||||
}
|
||||
NvOsDebugPrintf("%s: returned from NvRmTransportSendMsg\n", __func__);
|
||||
|
||||
NvOsDebugPrintf("%s: NvOsSemaphoreWait(TransportRecvSemId=%x)\n", __func__,hRPCHandle->TransportRecvSemId);
|
||||
NvOsSemaphoreWait(hRPCHandle->TransportRecvSemId);
|
||||
|
||||
NvOsDebugPrintf("%s: calling NvRmTransportRecvMsg\n", __func__);
|
||||
Error = NvRmTransportRecvMsg(hRPCHandle->svcTransportHandle,
|
||||
pRecvMessageBuffer, MaxSize, pMessageSize);
|
||||
if (Error)
|
||||
@@ -216,7 +200,6 @@ void NvRmPrivRPCSendMsgWithResponse( NvRmRPCHandle hRPCHandle,
|
||||
NvOsDebugPrintf("%s: error in NvRmTransportRecvMsg\n", __func__);
|
||||
goto clean_up;
|
||||
}
|
||||
NvOsDebugPrintf("%s: returned from NvRmTransportRecvMsg\n", __func__);
|
||||
|
||||
clean_up:
|
||||
NV_ASSERT(Error == NvSuccess);
|
||||
@@ -243,10 +226,8 @@ NvError NvRmPrivRPCWaitForConnect( NvRmRPCHandle hRPCHandle )
|
||||
// Connect to the other end
|
||||
while (s_ContinueProcessing)
|
||||
{
|
||||
/* NvOsDebugPrintf("%s: NvRmTransportWaitForConnect(handle=%x)\n", __func__, hRPCHandle->svcTransportHandle); */
|
||||
Error = NvRmTransportWaitForConnect(
|
||||
hRPCHandle->svcTransportHandle, 100 );
|
||||
/* NvOsDebugPrintf("%s: NvRmTransportWaitForConnect=%d\n", __func__, Error); */
|
||||
if (Error == NvSuccess)
|
||||
{
|
||||
hRPCHandle->isConnected = NV_TRUE;
|
||||
@@ -290,13 +271,10 @@ NvError NvRmPrivRPCConnect( NvRmRPCHandle hRPCHandle )
|
||||
// Connect to the other end with a large timeout
|
||||
// Timeout value has been increased to suit slow enviornments like
|
||||
// emulation FPGAs
|
||||
NvOsDebugPrintf("%s: NvRmTransportConnect(handle=%x)\n", __func__, hRPCHandle->svcTransportHandle);
|
||||
Error = NvRmTransportConnect(hRPCHandle->svcTransportHandle,
|
||||
CONNECTION_TIMEOUT );
|
||||
NvOsDebugPrintf("%s: NvRmTransportConnect=%d\n", __func__, Error);
|
||||
if(Error == NvSuccess)
|
||||
{
|
||||
NvOsDebugPrintf("%s: Connected.\n", __func__);
|
||||
hRPCHandle->isConnected = NV_TRUE;
|
||||
}
|
||||
else
|
||||
@@ -353,7 +331,6 @@ NvError NvRmPrivInitService(NvRmDeviceHandle hDeviceHandle)
|
||||
{
|
||||
NvError Error = NvSuccess;
|
||||
|
||||
NvOsDebugPrintf("%s <kernel>: called\n", __func__);
|
||||
Error = NvRmPrivRPCInit(hDeviceHandle, PORT_NAME, &gs_hRPCHandle);
|
||||
if( Error != NvSuccess)
|
||||
{
|
||||
@@ -364,7 +341,6 @@ NvError NvRmPrivInitService(NvRmDeviceHandle hDeviceHandle)
|
||||
#if !NV_IS_AVP
|
||||
Error = NvOsInterruptPriorityThreadCreate(ServiceThread, NULL,
|
||||
&s_RecvThreadId_Service);
|
||||
NvOsDebugPrintf("%s: s_RecvThreadId_Service=%p\n", __func__, s_RecvThreadId_Service);
|
||||
#else
|
||||
Error = NvOsThreadCreate(ServiceThread, NULL, &s_RecvThreadId_Service);
|
||||
#endif
|
||||
|
||||
@@ -112,20 +112,15 @@ ssize_t nvfw_write(struct file *file, const char __user *buff, size_t count, lof
|
||||
char filename[100];
|
||||
int error;
|
||||
|
||||
printk(KERN_INFO "%s: entry\n", __func__);
|
||||
|
||||
error = copy_from_user(filename, buff, count);
|
||||
if (error) panic("%s: line=%d\n", __func__, __LINE__);
|
||||
filename[count] = 0;
|
||||
printk(KERN_INFO "%s: filename=%s\n", __func__, filename);
|
||||
|
||||
error = NvRmOpen( &hRmDevice, 0 );
|
||||
if (error) panic("%s: line=%d\n", __func__, __LINE__);
|
||||
|
||||
error = NvRmLoadLibrary(hRmDevice, filename, NULL, 0, &hRmLibHandle);
|
||||
if (error) panic("%s: line=%d\n", __func__, __LINE__);
|
||||
|
||||
printk(KERN_INFO "%s: return\n", __func__);
|
||||
return count;
|
||||
}
|
||||
|
||||
@@ -154,7 +149,6 @@ static int nvfw_ioctl_load_library(struct file *filp, void __user *arg)
|
||||
filename = NvOsAlloc(op.length + 1);
|
||||
error = copy_from_user(filename, op.filename, op.length + 1);
|
||||
if (error) panic("%s: line=%d\n", __func__, __LINE__);
|
||||
printk(KERN_INFO "%s: filename=%s\n", __func__, filename);
|
||||
|
||||
args = NvOsAlloc(op.argssize);
|
||||
error = copy_from_user(args, op.args, op.argssize);
|
||||
@@ -189,7 +183,6 @@ static int nvfw_ioctl_load_library_ex(struct file *filp, void __user *arg)
|
||||
filename = NvOsAlloc(op.length + 1);
|
||||
error = copy_from_user(filename, op.filename, op.length + 1);
|
||||
if (error) panic("%s: line=%d\n", __func__, __LINE__);
|
||||
printk(KERN_INFO "%s: filename=%s\n", __func__, filename);
|
||||
|
||||
args = NvOsAlloc(op.argssize);
|
||||
error = copy_from_user(args, op.args, op.argssize);
|
||||
@@ -240,7 +233,6 @@ static int nvfw_ioctl_get_proc_address(struct file *filp, void __user *arg)
|
||||
symbolname = NvOsAlloc(op.length + 1);
|
||||
error = copy_from_user(symbolname, op.symbolname, op.length + 1);
|
||||
if (error) panic("%s: line=%d\n", __func__, __LINE__);
|
||||
printk(KERN_INFO "%s: symbolname=%s\n", __func__, symbolname);
|
||||
|
||||
error = NvRmOpen( &hRmDevice, 0 );
|
||||
if (error) panic("%s: line=%d\n", __func__, __LINE__);
|
||||
@@ -743,7 +735,6 @@ static int __init nvfw_init(void)
|
||||
int ret = 0;
|
||||
struct platform_device *pdev;
|
||||
|
||||
NvOsDebugPrintf("%s: called\n", __func__);
|
||||
ret = misc_register(&nvfw_dev);
|
||||
s_KernelImage = NULL;
|
||||
if (ret) panic("%s: misc_register FAILED\n", __func__);
|
||||
@@ -758,8 +749,6 @@ static int __init nvfw_init(void)
|
||||
goto err;
|
||||
}
|
||||
|
||||
pr_info("avp driver initialized\n");
|
||||
|
||||
return 0;
|
||||
|
||||
err:
|
||||
|
||||
@@ -184,7 +184,6 @@ static int nvrpc_ioctl_open(struct file *filp,
|
||||
if (e != NvSuccess)
|
||||
goto fail;
|
||||
}
|
||||
printk(KERN_ERR "%s: NvRmTransportOpen\n", __func__);
|
||||
op.ret_val = NvRmTransportOpen(s_hRmGlobal, p_name, recv_sem,
|
||||
(void *)&op.transport_handle);
|
||||
error = copy_to_user(arg, &op, sizeof(op));
|
||||
@@ -194,7 +193,6 @@ static int nvrpc_ioctl_open(struct file *filp,
|
||||
}
|
||||
g_hTransportCpu = (NvRmTransportHandle)op.transport_handle;
|
||||
g_hTransportCpuSem = (NvOsSemaphoreHandle) op.sem;
|
||||
printk(KERN_ERR "%s: g_hTransportCpu=%p\n", __func__, g_hTransportCpu);
|
||||
}
|
||||
if (p_name && ! strcmp(p_name, "RPC_AVP_PORT")) {
|
||||
if (g_hTransportAvp) {
|
||||
@@ -202,7 +200,6 @@ static int nvrpc_ioctl_open(struct file *filp,
|
||||
}
|
||||
g_hTransportAvp = (NvRmTransportHandle)op.transport_handle;
|
||||
g_hTransportAvpSem = (NvOsSemaphoreHandle) op.sem;
|
||||
printk(KERN_ERR "%s: g_hTransportAvp=%p\n", __func__, g_hTransportAvp);
|
||||
}
|
||||
|
||||
fail:
|
||||
@@ -296,7 +293,6 @@ static int nvrpc_ioctl_connect(struct file *filp,
|
||||
|
||||
NvRmTransportGetPortName((void *)op.handle,
|
||||
port_name, sizeof(port_name));
|
||||
printk(KERN_INFO "%s: port_name=%s\n", __func__, port_name);
|
||||
|
||||
|
||||
op.ret_val = NvRmTransportConnect(
|
||||
@@ -659,7 +655,6 @@ static int __init nvrpc_init(void)
|
||||
if (s_init_done == NV_FALSE) {
|
||||
NvError e;
|
||||
|
||||
printk(KERN_INFO "%s: NvRmTransportInit\n", __func__);
|
||||
e = NvRmOpen(&s_hRmGlobal, 0);
|
||||
e = NvRmTransportInit(s_hRmGlobal);
|
||||
s_init_done = NV_TRUE;
|
||||
|
||||
Reference in New Issue
Block a user