Age | Commit message (Collapse) | Author |
|
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>
|
|
Added null check to avoid direct crash and return error or assert.
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Fix compilation warnings seen with Android build.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Fix compilation warnings introduced with commit
6736bb2b9b060cf37d3e6728e21509b24ec12da8,
"MmRpc: Add Input Paramter Checking to APIs".
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
|
|
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>
|
|
Want all the sources to be part of IPC package irrespective of platform
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
|
|
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>
|
|
Fix compilation warnings discovered when compiling with
newer QNX versions.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
|
|
Fix compilation warnings discovered when compiling with
newer QNX versions.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
|
|
Fix compilation warnings discovered when compiling
with newer QNX versions.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
|
|
Fix compilation warnings discovered when compiling with
newer QNX versions.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
|
|
Fix compilation warnings discovered when building with
newer QNX versions.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
|
|
Fix compilation warnings discovered when building with
newer QNX version.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
|
|
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>
|
|
This patch fixes compilation warnings introduced with
the newer QNX version.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
|
|
This patch fixes compilation warnings introduced with
the newer QNX version.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
|
|
This patch fixes compilation warnings introduced with
newer QNX version build.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
|
|
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>
|
|
Enable the DSP PM for the test images also.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
|
|
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>
|
|
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>
|
|
Update the Makefile.in to account for the fault app name
change.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
|
|
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>
|
|
Updated Makefile.am accordingly
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
|
|
Updated package.bld accordingly
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|