summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-05-07Resource: Rename the IpcMemory name in Resource.xs3.47.02.00ipc-3.47-next3.47Suman Anna
The Resource module is derived from the IpcMemory module within the sysbios-rpmsg codebase originally, but the Resource.xs file is still using the IpcMemory name and so the config processing of this module will print erroneous names on any misconfiguration. Rename the variable IpcMemory to Resource like is normally done with .xs files. Signed-off-by: Suman Anna <s-anna@ti.com>
2018-04-24ipc: static analysis issues on NULL pointer accessSam Nelson
Added null check to avoid direct crash and return error or assert. Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2018-04-24Android: Remove use of LOCAL_MODULE_PATH to allow Multilib buildAndrew F. Davis
LOCAL_MODULE_PATH is not multilib safe, the recommended alternative is LOCAL_MODULE_RELATIVE_PATH, but we don't need that either as using LOCAL_VENDOR_MODULE will get our output deployed to the correct spot without needing to hard-code paths. Signed-off-by: Andrew F. Davis <afd@ti.com>
2018-04-24tests: DRA7XX: Fix clock configuration in gatempapp.cfgAngela Stegmaier
The gatempapp.cfg was not selecting the proper clock config for DSP1. This patch fixes the gatempapp.cfg file to use the same common Dsp_vayu.cfg and Dsp_vayu_power.cfg files to do the common configurations including clock configuration. Without this, the watchdog will not be proper and will result in unexpected watchdog timings for the messageq_fault tests for DSP1. Reported-by: Suman Anna <s-anna@ti.com> Signed-off-by: Angela Stegmaier <angelabaker@ti.com> Tested-by: Suman Anna <s-anna@ti.com>
2018-03-20Linux: Cleanup on Failure in Ipc_startAngela Stegmaier
Add the appropriate cleanup calls when Ipc_start fails, so that Ipc_start can be called again in a clean state. This allows retry of Ipc_start in case of failure due to various conditions including if reponses are delayed from the remote core for some reason. Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
2018-03-20Linux: GateMP: Fix Error Handling When defaultGate Not Found Due to TimeoutAngela Stegmaier
In a corner case where remote NameServer requests take too long and time out, it is possible that remoteSystemGate may be de-referenced in GateMP_start when it wasn't allocated during GateMP_attach. This patch improves error checking in GateMP_start to avoid the potential NULL pointer de-reference. Before trying to access the remoteSystemGates pointer during GateMP_start, we should first make sure that the pointer is valid. Also check to make sure that the gate number does not exceed the number of allocated gates. If the corner case has been hit where the GateMP_attach failed but GateMP_open later passes during GateMP_start, GateMP_start will now return an error, resulting in Ipc_start returning an error. The application can then call Ipc_start again. Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
2018-01-11ipc-bios.mak: Update to allow use of top level Rule.mak3.47.01.00_eng3.47.01.00Sam Nelson
Products.mak sets variables to point to external products. Allowing RULES_MAKE variable to be overriden, helps in building in a SDK context. This is to help with build with SDKs bundling IPC. Should not affect stand alone IPC builds Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2017-12-21GateMP: Add cache operation to make sure the SR0 contents are synced upSam Nelson
Before opening the shared region, make sure the cache is invalidated. Even though the memory was not accessed before, because of speculative execution the memory may be in the cache line already. Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2017-11-20ListMP: Add barrier to ensure write backs completeSam Nelson
The call to barrier function is needed to ensure the intended changes are already written back to memory before leaving the gate to avoid issues. Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2017-11-20Android: Fix compilation warningsAngela Stegmaier
Fix compilation warnings seen with Android build. Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
2017-10-19Linux: Update user AF_RPMSG define for 4.11+ kernelsSuman Anna
IPC's Linux user space support contains a copy of a few kernel-defined structs and definitions including the socket address family used for rpmsg-based sockets - AF_RPMSG. This driver is currently out-of-tree and so it's definition is always 'one more' than the last address family defined by the mainline kernel's socket.h. A new address family was introduced in 4.11 (AF_SMC), and as a result, the AF_RPMSG macro needs to be set to 44 post 4.11 kernel. The user space header has been updated to reflect on the kernel version and appropriately assign the value of AF_RPMSG. Do note that a specific value of AF_RPMSG can always be provided through the products.mak when KERNEL_INSTALL_DIR is not set. Signed-off-by: Suman Anna <s-anna@ti.com>
2017-10-18Linux: LAD_client: Fix Race Condition with Command FIFOAngela Stegmaier
With the current implementation, there is a small window where the FIFO is closed by the client for writing while it is still open by the LAD daemon for reading. In this small window, if the LAD daemon attempts to do a read on the FIFO, it will get EOF and the LAD daemon will close it's own FIFO and re-open it. If the client then is able to open the FIFO again after the LAD daemon has received EOF from the read call, but before the LAD daemon has closed the FIFO, then there is now a situation where the client has a handle to a stale FIFO. If all these things happen, then when the client tries to write/flush to the FIFO, a SIGPIPE signal will happen, resulting in the client crash. To avoid this race condition, we must close the window where the FIFO is not open for writing by the client while it is already open for reading by the daemon. This patch closes the window by modifiying the client code to delay closing it's non-blocking FIFO handle (used for handshaking) until after it has successfully opened the regular FIFO. Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
2017-09-14Android: Makefile: move IPC libraries/binaries to vendor partition3.47.00.00_eng3.47.00.00Vishal Mahaveer
Updating Android makefile to generate IPC userspace binaries and libraries in /vendor location instead of /system. This change requires the lad_dra7xx service definition in init.*.rc files to be updated accordingly -service lad_dra7xx /system/bin/lad_dra7xx -g +service lad_dra7xx /vendor/bin/lad_dra7xx -g Signed-off-by: Vishal Mahaveer <vishalm@ti.com>
2017-09-14Vayu: NotifySetup: Incorrect Index in NotifySetup_unplugHwiAngela Stegmaier
When checking the reference count before deleting the Hwi, the code was always checking against index 0, instead of the mbxIdx. This lead to the Hwi being deleted, even when there were still references. Then, even if NotifySetup_plugHwi was called again, the reference count was greater than 1, and the Hwi would never be plugged again. This issue manifests when Ipc_detach is called followed by Ipc_attach. This patch fixes the issue by checking against the appropriate refcount for the mbxIdx. Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
2017-09-14Android: update version.h include path for AF_RPMSG handlingVishal Mahaveer
Update include path of version.h for current Android setup. Previously (before O) we used to update the socket.h bionic header with AF_RPMSG definitions, so the KERNEL_VERSION check was not exercized. Now the kernel-headers of dra7xx in Android repo is updated to reflect the correct Kernel version and can be used to check the kernel version. For older Android versions that do not have version.h in kernel-headers, AF_RPMSG can still be taken from the socket.h bionic header if it is updated to include AF_RPMSG. Signed-off-by: Vishal Mahaveer <vishalm@ti.com> Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
2017-09-13Linux: TransportRpmsg: Fix Mutex Deadlock IssueAngela Stegmaier
In an error recovery situation, it is possible that a mutex deadlock could occur when MessageQ_delete happened at the same time that an fd was being signaled about the remote core error in the same process. This error could occur if there are multiple MessageQs in the same process communicating with the remote core that is doing recovery. When MessageQ_delete grabs the lock, it then tries to communicate with rpmsgThreadFxn, sending a message and then waiting for a response. If at the same time, the thread is processing a shutdown notification for an fd, it will also try to grab the mutex, but will be blocked because MessageQ_delete is holding the mutex. The rpmsgThreadFxn will not continue until it gets the mutex, leading to the deadlock. The fix is to change the mutex_lock to a trylock when handling shutdown notifications in rpmsgThreadFxn. If the thread fails to acquire the lock, it continues processing commands and will try again later to process the shutdown request at a time when the lock is no longer being held. Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
2017-09-01MmRpc: Fix Compilation WarningsAngela Stegmaier
Fix compilation warnings introduced with commit 6736bb2b9b060cf37d3e6728e21509b24ec12da8, "MmRpc: Add Input Paramter Checking to APIs". Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
2017-09-01TransportRpmsg: Fix Check for Invalid SocketAngela Stegmaier
A check for sock in TransportRpmsg was incorrectly checking for sock != 0, when it should have been checking against INVALIDSOCKET (the value uninitialized socket are set to). This patch fixes the check. Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
2017-08-03Linux: LAD_client: Avoid hang in fopen during connectAngela Stegmaier
If the application is started and calls Ipc_start before the LAD is started and created/opened the fifo, then the application can block in the fopen trying to connect to the command FIFO. This patch makes the sequence more robust by first checking if the fifo exists, then trying to open it as non-blocking, thereby getting an immediate success or error instead of blocking until it has been opened for reading by LAD. Once the non-blocking open returns successfully, the regular connect sequence can continue. If it returns with a failure, it will sleep and then try again for a period of time, eventually returning a timeout failure if it is unable to connect. This should prevent the application from hanging if LAD is not started before it calls Ipc_start. Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
2017-08-03MmRpc: Add Input Paramter Checking to APIsAngela Stegmaier
This patch adds input paramter checking to the MmRpc_* APIs, specifically checking for NULL pointers, in order to prevent a crash due to NULL-pointer de-reference in the case that the user sends a bad (NULL) pointer. Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
2017-06-30QNX: NameServer_daemon: Initialize mutex_attr3.46.02.04_eng3.46.02.04ipc-3.46-next3.46Angela Stegmaier
Initialize mutex_attr before using it. Otherwise, it could contain some uninitialized values. This patch is ported from commit id 7b3a739876e46d3194861a2d93077ff95954affb Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
2017-06-30QNX: Tests: Add NameServer and GateMP to Fault TestAngela Stegmaier
Add NameServer and GatemP to fault recovery test in order to test error recovery of these modules. Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
2017-06-30QNX: NameServer Daemon: Check that Handles passed from User are ValidAngela Stegmaier
Check that the handle being passed from the user is a valid handle that the daemon has previously allocated. This prevents the resource manager from crashing by accessing a stale handle that the user has passed (for instance in some error recovery scenarios). This patch adds the checking for function calls which are accessible through a devctl call. Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
2017-06-30QNX: Tests: Add error/cleanup tests to NameServer testAngela Stegmaier
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
2017-06-30QNX: NameServer_delete in NameServer daemon leaks memoryAngela Stegmaier
Remove an invalid assertion that the name list must be empty. This is not true and the instance might still be in use by another client (object is reference counted). Add a while loop to delete each entry on the name list. Destroy the object's gate (was not being done). Remove the macro to destruct a list object (not needed). [Ported from commits 8a52a6a5fa20ac028158a3ad346da46555ce45b7 "SDOCM00115434 NameServer_delete in LAD daemon leaks memory" and 6c4799151327f2c83b9f253ea25c52bef4e10803 "Remove NameServer instance from module list in NameServer_delete()"] Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
2017-06-27Makefile: Include GATE related sources for all platforms.Sam Nelson
Want all the sources to be part of IPC package irrespective of platform Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2017-05-26Linux: NameServer_daemon: Initialize mutex_attr before using it3.46.01.03_eng3.46.01.03Falk Tristram
Initialize mutex_attr before using it. Otherwise, it could contain some uninitialized values. Also, initialize nsMsg to zero before using it. Signed-off-by: Falk Tristram <falk.tristram@cognex.com> Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
2017-05-23QNX: ProcMgr: Fix Compilation WarningsAngela Stegmaier
Fix compilation warnings discovered when compiling with newer QNX versions. Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
2017-05-23QNX: Osal: Fix Compilation WarningsAngela Stegmaier
Fix compilation warnings discovered when compiling with newer QNX versions. Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
2017-05-23QNX: Resmgr: Fix Compilation WarningsAngela Stegmaier
Fix compilation warnings discovered when compiling with newer QNX versions. Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
2017-05-23QNX: tests: Fix Compilation WarningsAngela Stegmaier
Fix compilation warnings discovered when compiling with newer QNX versions. Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
2017-05-23QNX: Samples: Fix Compilation WarningsAngela Stegmaier
Fix compilation warnings discovered when building with newer QNX versions. Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
2017-05-23QNX: Loader: Fix Compilation WarningsAngela Stegmaier
Fix compilation warnings discovered when building with newer QNX version. Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
2017-05-23QNX: DRA7XX: Fix Compilation WarningsAngela Stegmaier
This patch fixes compilation warnings in the DRA7XX-specific files that were introduced with the newer QNX version build. Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
2017-05-23QNX: Trace Daemon: Fix Compilation WarningsAngela Stegmaier
This patch fixes compilation warnings introduced with the newer QNX version. Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
2017-05-23QNX: Shmemallocator: Fix Compilation WarningsAngela Stegmaier
This patch fixes compilation warnings introduced with the newer QNX version. Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
2017-05-23QNX: Mx: Fix Compilation WarningsAngela Stegmaier
This patch fixes compilation warnings introduced with newer QNX version build. Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
2017-05-23QNX: Build: Fix Build for Newer QNX Versions on WindowsAngela Stegmaier
When building on Windows, the overriding of the usemsg command in quiet.mk was causing the build to fail. It appears that usemsg isn't always defined when building with newer QNX versions and the overriding of the command should be done conditionally. This patch changes quiet.mk to only update the usemsg command if it is defined. Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
2017-04-24Examples: DRA7XX: Enable PM for DSP test images3.46.00.02_eng3.46.00.02Angela Stegmaier
Enable the DSP PM for the test images also. Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
2017-04-24Watchdog: Add Watchdog_restore for DRA7XX DSPAngela Stegmaier
Watchdog code is not currently adding the Watchdog_restore callback for DRA7XX DSP. When power management (suspend/resume) is enabled for the DSP, the restore hook should be added so that the values of the timer are proper upon resume. Without this patch, when power management is enabled for the DSP, the watchdog timeout is not proper after resuming from suspend. Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
2017-04-12Remoteproc: OMAP-L138: Fix up resource table3.46.00.01_engSuman Anna
The OMAP-L138 resource table structure definitions are incorrect, the offset variable was defined to be an array of 13, whereas the real valid entries are 3, thereby mis-representing the offsets of the resources in the actual resource table when compared to the resource structure definition. Fix this properly by adjusting the array length. While at this, also replace the name IPU with DSP in various macros. The SoC only has a DSP, and has no IPU, and the IPU name can be misleading for users even though there is no difference functionally. Signed-off-by: Suman Anna <s-anna@ti.com>
2017-04-10autotools: Update Linux tests Makefile.in for fault app name changeAngela Stegmaier
Update the Makefile.in to account for the fault app name change. Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
2017-04-10Android: Makefile: Update Name of Fault Test Source FileAngela Stegmaier
A recent change was made to rename the fault.c file to MessageQFaultApp.c. This patch updates the Android.mk file with the new source file name. Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
2017-04-04fault: Linux: Renamed test application fault to MessageQFaultApp3.46.00.00_engSam Nelson
Updated Makefile.am accordingly Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2017-04-04fault: BIOS: Renamed test application fault to messageq_faultSam Nelson
Updated package.bld accordingly Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2017-03-31rpmsg: Add Rpmsg NS 2.0 to OmapL138 platformSam Nelson
Additional of OMAPL138 in upcoming SDK releases will require support of NS_2.0 ( Note: The default will break compatibility with Upstream kernel which does not support NS_2.0 The Non-NS_2.0 libraries are also created for customer to use, in case if customer is using upstream kernel, but this will not fully tested) Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2017-03-31Linux: GateHWSpinlock: Fix Compiler WarningsAngela Stegmaier
Fix the following compiler warnings in the Linux GateHWSpinlock module: ../../../linux/src/api/gates/GateHWSpinlock.c: In function 'GateHWSpinlock_enter': ../../../linux/src/api/gates/GateHWSpinlock.c:346:23: warning: implicit declaration of function 'ioctl' [-Wimplicit-function-declaration] locked = !ioctl(Mod->fd, HWSPINLOCK_USER_LOCK, &data); GateHWSpinlock.c: In function 'GateHWSpinlock_enter': GateHWSpinlock.c:283:23: warning: implicit declaration of function 'ioctl' [-Wimplicit-function-declaration] locked = !ioctl(Mod->fd, HWSPINLOCK_USER_LOCK, &data); ^ GateHWSpinlock_daemon.c: In function 'GateHWSpinlock_getConfig': GateHWSpinlock_daemon.c:61:9: warning: unused variable 'i' [-Wunused-variable] int i; ^ Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
2017-03-31Linux/Android: MessageQ - Fix Implicit Declaration WarningAngela Stegmaier
This patch fixes the following compiler warning: lad.c:685:17: warning: implicit declaration of function 'MessageQ_announce' This patch adds the MessageQ_announce prototype to MessageQ.h so that MessageQ_announce is no longer implicitly declared. Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
2017-03-14MessageQ: Remove Error declaration with local MessageQ object not availableSam Nelson
There are cases where there is a MessageQ created on a different process, in which case the local queue obj will be NULL. The declaration of fail need to be removed. Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2017-01-30Linux: Fix Static Analysis Reported Issues in IPC3.45.00.00_eng3.45.00.003.45Angela Stegmaier
This patch addresses the following static analysis reported issues: In linux/src/api/gates/GateMP.c: Possible Null Pointer Dereference in GateMP_Instance_finalize In linux/src/api/gates/GateMutex.c: Possible Null Pointer Dereference in GateMutex_delete In linux/src/api/MessageQ.c: Uninitialized Variable in MessageQ_free Signed-off-by: Angela Stegmaier <angelabaker@ti.com>