ipc: static analysis issues on NULL pointer access
Added null check to avoid direct crash and return error or assert.
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
Added null check to avoid direct crash and return error or assert.
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
Android: Remove use of LOCAL_MODULE_PATH to allow Multilib build
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>
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>
tests: DRA7XX: Fix clock configuration in gatempapp.cfg
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>
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>
Linux: Cleanup on Failure in Ipc_start
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>
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>
Linux: GateMP: Fix Error Handling When defaultGate Not Found Due to Timeout
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>
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>
ipc-bios.mak: Update to allow use of top level Rule.mak
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>
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>
GateMP: Add cache operation to make sure the SR0 contents are synced up
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>
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>
ListMP: Add barrier to ensure write backs complete
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>
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>
Android: Fix compilation warnings
Fix compilation warnings seen with Android build.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
Fix compilation warnings seen with Android build.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
Linux: Update user AF_RPMSG define for 4.11+ kernels
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>
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>
Linux: LAD_client: Fix Race Condition with Command FIFO
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>
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>
6 years agoAndroid: Makefile: move IPC libraries/binaries to vendor partition 3.47.00.00 3.47.00.00_eng
Android: Makefile: move IPC libraries/binaries to vendor partition
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>
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>
Vayu: NotifySetup: Incorrect Index in NotifySetup_unplugHwi
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>
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>
Android: update version.h include path for AF_RPMSG handling
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>
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>
Linux: TransportRpmsg: Fix Mutex Deadlock Issue
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>
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>
MmRpc: Fix Compilation Warnings
Fix compilation warnings introduced with commit
6736bb2b9b060cf37d3e6728e21509b24ec12da8,
"MmRpc: Add Input Paramter Checking to APIs".
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>
TransportRpmsg: Fix Check for Invalid Socket
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>
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>
Linux: LAD_client: Avoid hang in fopen during connect
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>
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>
MmRpc: Add Input Paramter Checking to APIs
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>
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>
6 years agoQNX: NameServer_daemon: Initialize mutex_attr 3.46 ipc-3.46-next 3.46.02.04 3.46.02.04_eng
QNX: NameServer_daemon: Initialize mutex_attr
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>
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>
QNX: Tests: Add NameServer and GateMP to Fault Test
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>
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>
QNX: NameServer Daemon: Check that Handles passed from User are Valid
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>
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>
QNX: Tests: Add error/cleanup tests to NameServer test
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
QNX: NameServer_delete in NameServer daemon leaks memory
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>
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>
Makefile: Include GATE related sources for all platforms.
Want all the sources to be part of IPC package irrespective of platform
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
Want all the sources to be part of IPC package irrespective of platform
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
6 years agoLinux: NameServer_daemon: Initialize mutex_attr before using it 3.46.01.03 3.46.01.03_eng
Linux: NameServer_daemon: Initialize mutex_attr before using it
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>
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>
QNX: ProcMgr: Fix Compilation Warnings
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>
QNX: Osal: Fix Compilation Warnings
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>
QNX: Resmgr: Fix Compilation Warnings
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>
QNX: tests: Fix Compilation Warnings
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>
QNX: Samples: Fix Compilation Warnings
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 versions.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
QNX: Loader: Fix Compilation Warnings
Fix compilation warnings discovered when building with
newer QNX version.
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>
QNX: DRA7XX: Fix Compilation Warnings
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 in the DRA7XX-specific
files that were introduced with the newer QNX version build.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
QNX: Trace Daemon: Fix Compilation Warnings
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>
QNX: Shmemallocator: Fix Compilation Warnings
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>
QNX: Mx: Fix Compilation Warnings
This patch fixes compilation warnings introduced with
newer QNX version build.
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>
QNX: Build: Fix Build for Newer QNX Versions on Windows
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>
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>
Examples: DRA7XX: Enable PM for DSP test images
Enable the DSP PM for the test images also.
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: Add Watchdog_restore for DRA7XX DSP
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>
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>
Remoteproc: OMAP-L138: Fix up resource table
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>
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>
autotools: Update Linux tests Makefile.in for fault app name change
Update the Makefile.in to account for the fault app name
change.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
Update the Makefile.in to account for the fault app name
change.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
Android: Makefile: Update Name of Fault Test Source File
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>
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>
fault: Linux: Renamed test application fault to MessageQFaultApp
Updated Makefile.am accordingly
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
Updated Makefile.am accordingly
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
fault: BIOS: Renamed test application fault to messageq_fault
Updated package.bld accordingly
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
Updated package.bld accordingly
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
rpmsg: Add Rpmsg NS 2.0 to OmapL138 platform
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>
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>
Linux: GateHWSpinlock: Fix Compiler Warnings
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>
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>
Linux/Android: MessageQ - Fix Implicit Declaration Warning
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>
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>
MessageQ: Remove Error declaration with local MessageQ object not available
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>
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>
Linux: Fix Static Analysis Reported Issues in IPC
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>
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>
QNX: rpmsg-rpc: Add MAP_SHARED to mmap64 Call
With newer QNX kernels, there are issues unless the MAP_SHARED/MAP_PRIVATE
flag is added to the mmap64 call alongside the MAP_PHYS parameter
in rpmsg-rpc.
This patch adds the MAP_SHARED flag to address the issues.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
With newer QNX kernels, there are issues unless the MAP_SHARED/MAP_PRIVATE
flag is added to the mmap64 call alongside the MAP_PHYS parameter
in rpmsg-rpc.
This patch adds the MAP_SHARED flag to address the issues.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
Deh: DRA7XX: Add DEH and Watchdog to DSP2 tests
Add the DEH and Watchdog module to the DSP2 tests for DRA7XX.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
Add the DEH and Watchdog module to the DSP2 tests for DRA7XX.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
Watchdog: Add Config to disable Watchdog
Add a new module config to the Watchdog module that
allows to disable the module. The Watchdog
module is automatically included when Deh module is
included in an image. This parameter allows the user
to disable the watchdog while still using the Deh
module and allows this to be done from a config param
at the application level on the BIOS-side application.
The following can be added to the application config
file to disable Watchdog module (if desired) when including
Deh module.
WD = xdc.useModule('ti.deh.Watchdog');
WD.disableWatchdog = true;
There are other ways to disable the watchdog from Linux/Android
that already exist. This method just provides additional
flexibility to the user.
The default value is false if this parameter is not set.
So, if this parameter is not set, the behavior is the same as
before this patch.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
Add a new module config to the Watchdog module that
allows to disable the module. The Watchdog
module is automatically included when Deh module is
included in an image. This parameter allows the user
to disable the watchdog while still using the Deh
module and allows this to be done from a config param
at the application level on the BIOS-side application.
The following can be added to the application config
file to disable Watchdog module (if desired) when including
Deh module.
WD = xdc.useModule('ti.deh.Watchdog');
WD.disableWatchdog = true;
There are other ways to disable the watchdog from Linux/Android
that already exist. This method just provides additional
flexibility to the user.
The default value is false if this parameter is not set.
So, if this parameter is not set, the behavior is the same as
before this patch.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
Tests: ping_tasks: Use different description names for each channel
The RPMSG_NS_2.0 feature was introduced to distinguish multiple channels of
the same service type to the host OS. The ping_tasks example however has been
using the same descriptor name for both the services. Use unique names for
each channel so that it conforms to the NS_2.0 design. Also, fixed some minor
incorrect whitespace indentation issues.
Issue found with the recent changes on upstream Linux 4.9 kernel.
Signed-off-by: Suman Anna <s-anna@ti.com>
The RPMSG_NS_2.0 feature was introduced to distinguish multiple channels of
the same service type to the host OS. The ping_tasks example however has been
using the same descriptor name for both the services. Use unique names for
each channel so that it conforms to the NS_2.0 design. Also, fixed some minor
incorrect whitespace indentation issues.
Issue found with the recent changes on upstream Linux 4.9 kernel.
Signed-off-by: Suman Anna <s-anna@ti.com>
Linux: Update user AF_RPMSG define for 4.7+ kernels
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
definition is always 'one more' than the last address family
defined by the mainline kernel's socket.h.
Prior to Linux 3.9, this was aways 40. Couple of new address
families were introduced in 4.6 (AF_KCM) and 4.7 (AF_QIPCRTR),
and as a result, we needed to set AF_RPMSG to 43 post 4.7 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>
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
definition is always 'one more' than the last address family
defined by the mainline kernel's socket.h.
Prior to Linux 3.9, this was aways 40. Couple of new address
families were introduced in 4.6 (AF_KCM) and 4.7 (AF_QIPCRTR),
and as a result, we needed to set AF_RPMSG to 43 post 4.7 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>
watchdog: enable __FAR__ for static variable
This allows freedom in memory placement of data memory sections.
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
This allows freedom in memory placement of data memory sections.
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
lad: Skip daemon running check in Android
The Android service start already takes care of checking
if the service is already running, so it's not required
to check again if the daemon is running or not.
It's recommended to add an Android service in the init.rc
script file for the lad_dra7xx. For instance:
service lad_dra7xx /system/bin/lad_dra7xx -g
class main
user media
group system
oneshot
The service can be set up to automatically launch when
Android boots or manually started later:
$ start lad_dra7xx
Directly running the lad_dra7xx executable in Android is
discouraged as the capability to enforce that only one
instance is running is lost.
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
The Android service start already takes care of checking
if the service is already running, so it's not required
to check again if the daemon is running or not.
It's recommended to add an Android service in the init.rc
script file for the lad_dra7xx. For instance:
service lad_dra7xx /system/bin/lad_dra7xx -g
class main
user media
group system
oneshot
The service can be set up to automatically launch when
Android boots or manually started later:
$ start lad_dra7xx
Directly running the lad_dra7xx executable in Android is
discouraged as the capability to enforce that only one
instance is running is lost.
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
lad: Compile lad_dra7xx as app for Android
lad_dra7xx is being launched as an Android service. The
service status is tracked based on the pid of the binary
run when the service is launched.
In daemon mode, the pid that Android keeps track of is that
of the parent process that started the daemon. So, the
lad_dra7xx service status is not properly shown.
The lad_dra7xx will be compiled in app mode for Android to
avoid the problem described above. The lad_dra7xx will
continue as a daemon for Linux.
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
lad_dra7xx is being launched as an Android service. The
service status is tracked based on the pid of the binary
run when the service is launched.
In daemon mode, the pid that Android keeps track of is that
of the parent process that started the daemon. So, the
lad_dra7xx service status is not properly shown.
The lad_dra7xx will be compiled in app mode for Android to
avoid the problem described above. The lad_dra7xx will
continue as a daemon for Linux.
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
make: Update to build interfaces first
This change is aimed to avoid parallel build issues, due to interfaces
not built.
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
This change is aimed to avoid parallel build issues, due to interfaces
not built.
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
autotools: Update of autogenerated files
Captures change with subdir-objects removed
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
Captures change with subdir-objects removed
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
autotools: Update to remove subdir-objects
automake has a bug handling subdir-objects.
Removing subdir-objects for now and live with warning to avoid build
issue.
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
automake has a bug handling subdir-objects.
Removing subdir-objects for now and live with warning to avoid build
issue.
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
autoreconf: Linux: Update autotools generated files
Check in autoreconf generated files after update to Makefile.am files
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
Check in autoreconf generated files after update to Makefile.am files
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
configure.ac: Update to avoid warnings with auroreconf
Without these fixes, the following warnings were seen and now fixed
configure.ac:54: warning: Unknown LT_INIT option `gcc'
linux/src/api/Makefile.am:61: warning: source file
'$(top_srcdir)/linux/src/heaps/HeapStd.c' is in a subdirectory,
linux/src/api/Makefile.am:61: but option 'subdir-objects' is disabled
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
Without these fixes, the following warnings were seen and now fixed
configure.ac:54: warning: Unknown LT_INIT option `gcc'
linux/src/api/Makefile.am:61: warning: source file
'$(top_srcdir)/linux/src/heaps/HeapStd.c' is in a subdirectory,
linux/src/api/Makefile.am:61: but option 'subdir-objects' is disabled
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
Makefile.am: Update to use -pthread
Based on gcc documentation and other discussions online, looks like
"-pthread" is required in compile options.
Needed to add -pthread with CFLAGS
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
Based on gcc documentation and other discussions online, looks like
"-pthread" is required in compile options.
Needed to add -pthread with CFLAGS
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
Linux: Add pthread dependency for transport
On Poky based builds, the ti-ipc compilation results in the below
error:
.libs/libtitransportrpmsg.so: undefined reference to `pthread_join'
~~~~~~~~~~~~~~~~~~~
Signed-off-by: Karthik Ramanan <a0393906@ti.com>
On Poky based builds, the ti-ipc compilation results in the below
error:
.libs/libtitransportrpmsg.so: undefined reference to `pthread_join'
~~~~~~~~~~~~~~~~~~~
Signed-off-by: Karthik Ramanan <a0393906@ti.com>
Build scripts: Add far model for ipc data
This helps to relocate and place data sections without any restrictions.
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
This helps to relocate and place data sections without any restrictions.
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
Build.xs: Add missing files for building A15 libraries in release
Without this fix the NonInstrumented example builds fail for K2
platforms with IPC configured for Build.LibType_NonInstrumented
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
Without this fix the NonInstrumented example builds fail for K2
platforms with IPC configured for Build.LibType_NonInstrumented
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
Linux/Android: Refactor MessageQ_create to Register Later with NameServer
In the current MessageQ_create implementation, the NameServer
registration is done early, before local creation in the user
library is done. It is therefore possible that a remote core
could open a MessageQ that is still being created and put a
message to that MessageQ. This can result in dropped messages
or in the worst case a crash.
This patch moves the NameServer registration to the end of
the creation sequence so that the MessageQ cannot be opened
before it is fully created.
A new LAD command called MESSAGEQ_ANNOUNCE is added that is specifically
for registering a previously created MessageQ with the NameServer.
Once all creation is completed and the MessageQ is ready to
receive messages, the MessageQ_create api makes the call to LAD
MESSAGEQ_ANNOUNCE to register with the NameServer.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
In the current MessageQ_create implementation, the NameServer
registration is done early, before local creation in the user
library is done. It is therefore possible that a remote core
could open a MessageQ that is still being created and put a
message to that MessageQ. This can result in dropped messages
or in the worst case a crash.
This patch moves the NameServer registration to the end of
the creation sequence so that the MessageQ cannot be opened
before it is fully created.
A new LAD command called MESSAGEQ_ANNOUNCE is added that is specifically
for registering a previously created MessageQ with the NameServer.
Once all creation is completed and the MessageQ is ready to
receive messages, the MessageQ_create api makes the call to LAD
MESSAGEQ_ANNOUNCE to register with the NameServer.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
QNX: NameServer: Fix Debug Trace in NameServer_add
Fix a trace in NameServer_add which was assuming a 32-bit aligned
pointer, but the pointer may not be aligned. So, print only the
first byte, as the size of the entry is varaible anyway.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
Fix a trace in NameServer_add which was assuming a 32-bit aligned
pointer, but the pointer may not be aligned. So, print only the
first byte, as the size of the entry is varaible anyway.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
Tests: Enable RPMSG_NS_2_0 for all Keystone 2 platforms
The rpmsg channel publishing requires RPMSG_NS_2_0 to be defined
for all Keystone 2 platforms, otherwise the channels are not
created properly on the Linux kernel side and the ping_tasks and
ping_rpmsg base images do not work with corresponding MPU-side
samples.
Signed-off-by: Suman Anna <s-anna@ti.com>
The rpmsg channel publishing requires RPMSG_NS_2_0 to be defined
for all Keystone 2 platforms, otherwise the channels are not
created properly on the Linux kernel side and the ping_tasks and
ping_rpmsg base images do not work with corresponding MPU-side
samples.
Signed-off-by: Suman Anna <s-anna@ti.com>
Linux: remove always true check
With latest Android N compiler, we get following error. Fixing it by
removing the always true check.
linux/src/api/NameServer.c:311:17: error: comparison of array 'rsp.get.buf'
not equal to a null pointer is always true [-Werror,-Wtautological-pointer-compare]
if (rsp.get.buf != NULL) {
~~~~~~~~^~~ ~~~~
linux/src/api/NameServer.c:453:17: error: comparison of array 'rsp.get.buf'
not equal to a null pointer is always true [-Werror,-Wtautological-pointer-compare]
if (rsp.get.buf != NULL) {
~~~~~~~~^~~ ~~~~
Signed-off-by: Vishal Mahaveer <vishalm@ti.com>
With latest Android N compiler, we get following error. Fixing it by
removing the always true check.
linux/src/api/NameServer.c:311:17: error: comparison of array 'rsp.get.buf'
not equal to a null pointer is always true [-Werror,-Wtautological-pointer-compare]
if (rsp.get.buf != NULL) {
~~~~~~~~^~~ ~~~~
linux/src/api/NameServer.c:453:17: error: comparison of array 'rsp.get.buf'
not equal to a null pointer is always true [-Werror,-Wtautological-pointer-compare]
if (rsp.get.buf != NULL) {
~~~~~~~~^~~ ~~~~
Signed-off-by: Vishal Mahaveer <vishalm@ti.com>
QNX: Change LOGn to GT traces for consistency
The QNX IPC code has a mix of LOGn and GT traces. This patch
modifies all the LOGn traces to be GT traces for consistency,
and to give better control to trace enabling.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
The QNX IPC code has a mix of LOGn and GT traces. This patch
modifies all the LOGn traces to be GT traces for consistency,
and to give better control to trace enabling.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
RcmServer: Replace System_printf with Log_print
System_printf in this function floods the IPU trace buffer and drowns out other
logs because this code is executed for every MmRpc_call made from the host.
Log_print provides better control to enable or disable logs on a per module
basis.
Signed-off-by: Harinarayan Bhatta <harinarayan@ti.com>
System_printf in this function floods the IPU trace buffer and drowns out other
logs because this code is executed for every MmRpc_call made from the host.
Log_print provides better control to enable or disable logs on a per module
basis.
Signed-off-by: Harinarayan Bhatta <harinarayan@ti.com>
Linux: NameServer_daemon: Check All Remote Cores Even if One Core is in Bad State
The current implementation will cease checking of the remaining remote cores in
the cluster if NameServer_getRemote fails for any reason other than
NameServer_E_NOTFOUND or NameServer_E_RESOURCE. If one of the remote cores in
the cluster is in an unresponsive state, then either NameServer_E_TIMEOUT or
NameServer_E_FAIL could be returned. And when that error code is returned, no
more remote cores in the cluster will be checked by NameServer_get. So if one
core goes into a bad state, then communication becomes blocked for all remaining
cores in the cluster.
To improve error handling and allow other cores to continue communication with
the HOST even if one core has crashed, the remaining cores should continue to
be checked, regardless of an error being returned from one of the cores.
This patch modifies NameServer_get so that if NameServer_getRemote fails for
a particular core, it no longer breaks, but continues to try the remaining
cores. In this way a crashed core does not block communication with the other
cores.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
The current implementation will cease checking of the remaining remote cores in
the cluster if NameServer_getRemote fails for any reason other than
NameServer_E_NOTFOUND or NameServer_E_RESOURCE. If one of the remote cores in
the cluster is in an unresponsive state, then either NameServer_E_TIMEOUT or
NameServer_E_FAIL could be returned. And when that error code is returned, no
more remote cores in the cluster will be checked by NameServer_get. So if one
core goes into a bad state, then communication becomes blocked for all remaining
cores in the cluster.
To improve error handling and allow other cores to continue communication with
the HOST even if one core has crashed, the remaining cores should continue to
be checked, regardless of an error being returned from one of the cores.
This patch modifies NameServer_get so that if NameServer_getRemote fails for
a particular core, it no longer breaks, but continues to try the remaining
cores. In this way a crashed core does not block communication with the other
cores.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
Watchdog: DRA7XX: Fix Watchdog Timer13 BaseAddr
The baseaddr for watchdog timer 13 was being incorrectly set
for DRA7XX DSP. This patch fixes the value to be the correct
address.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
The baseaddr for watchdog timer 13 was being incorrectly set
for DRA7XX DSP. This patch fixes the value to be the correct
address.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
grcm: Only Assert on Received Message Checks if Shutdown is False
If RPMessage_recv returns due to shutdown, then no valid message
is received by the call, and it should not assert if the message
is invalid.
This patch fixes the code to only do the assert checks if shutdown
is false.
Also fixes a minor issue with a trace referencing a parameter
that no longer exists.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
If RPMessage_recv returns due to shutdown, then no valid message
is received by the call, and it should not assert if the message
is invalid.
This patch fixes the code to only do the assert checks if shutdown
is false.
Also fixes a minor issue with a trace referencing a parameter
that no longer exists.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
Linux: GateMP_daemon: Fix incorrect mapping of IGateProvider_NULL
In the case that IGateProvider_NULL is used for one of the remoteCustom
gates, the code will anyway attempt to map it and throw and error trace.
The code continues as this is the last part of the attach and the error
is essentially ignored as part of the design of GateMP support in order
to allow the LAD daemon to continue even if the setup fails. So the error
trace doesn't cause any functionality failure.
Fix up the code so that mappings are only done when there is a valid
size, so that the valid case of IGateProvider_NULL is properly handled.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
In the case that IGateProvider_NULL is used for one of the remoteCustom
gates, the code will anyway attempt to map it and throw and error trace.
The code continues as this is the last part of the attach and the error
is essentially ignored as part of the design of GateMP support in order
to allow the LAD daemon to continue even if the setup fails. So the error
trace doesn't cause any functionality failure.
Fix up the code so that mappings are only done when there is a valid
size, so that the valid case of IGateProvider_NULL is properly handled.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
tests: gatempapp: update sr0 addresses to align with kernel dts
Update the sr0 addresses to align with default values for
linux kernel jamr dts file.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
Update the sr0 addresses to align with default values for
linux kernel jamr dts file.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
ipc-bios.mak: Remove use of find command under windows
Avoid use of find command in windows:
Use of find in windows results in build issues, especially with
xdctools/bin in the path.
Also there is no examples modules under packages directory ( examples
are maintained outside packages directory) and so no need to filter
them.
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
Avoid use of find command in windows:
Use of find in windows results in build issues, especially with
xdctools/bin in the path.
Also there is no examples modules under packages directory ( examples
are maintained outside packages directory) and so no need to filter
them.
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
makefile: Update makefile template to create lib directory
Without this, build will fail, when building for A15 targets alone
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
Without this, build will fail, when building for A15 targets alone
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
linux/ipc: Replace error message with debug print for GateMP Start
Error print was misleading when this is expected in case the GateMP not
supported in the system. Replaced with Verbose print
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
Error print was misleading when this is expected in case the GateMP not
supported in the system. Replaced with Verbose print
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
Remove INTMEM Type to match Linux K4.x
Starting in Linux kernel 4.1, the INTMEM type is removed
in favor of the internal memory sections needed for loading
being handled entirely in the Linux kernel. As such, the
INTMEM type no longer is defined.
This patch updated the rsc_types header file to match the
Linux defined types, which no longer defines the INTMEM
type.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
Starting in Linux kernel 4.1, the INTMEM type is removed
in favor of the internal memory sections needed for loading
being handled entirely in the Linux kernel. As such, the
INTMEM type no longer is defined.
This patch updated the rsc_types header file to match the
Linux defined types, which no longer defines the INTMEM
type.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
Tests: Update Tests to Remove INTMEM type usage
Update the tests to remove usage of the INTMEM type
which is deprecated starting in Linux kernel 4.1.
Note that this is a compatibility break with k3.14
and the tests only support k4.1 and newer kernels
now.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
Update the tests to remove usage of the INTMEM type
which is deprecated starting in Linux kernel 4.1.
Note that this is a compatibility break with k3.14
and the tests only support k4.1 and newer kernels
now.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
QNX: IPC: Handle Internal Memory Loading outside of Resource Table
This patch essentially reverts the following commits:
1. "Add fw_rsc_intmem definition to support new TYPE_INTMEM entries in QNX"
(commit 4a5f6fd0864854a99d430c6e6e7c65fb962f00e4)
2. " Add INTMEM resource type support in QNX"
(commit eb3d6bcfd35b823746c6032a9f811fc414824704)
Support for TYPE_INTMEM is being removed. Instead the internal memory
regions will be available by default from the QNX resource manager, without
the remote core image needing to speicify a special resource table
entry. The changes are being made to align with coming BIOS-side changes
to remove the TYPE_INTMEM.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
This patch essentially reverts the following commits:
1. "Add fw_rsc_intmem definition to support new TYPE_INTMEM entries in QNX"
(commit 4a5f6fd0864854a99d430c6e6e7c65fb962f00e4)
2. " Add INTMEM resource type support in QNX"
(commit eb3d6bcfd35b823746c6032a9f811fc414824704)
Support for TYPE_INTMEM is being removed. Instead the internal memory
regions will be available by default from the QNX resource manager, without
the remote core image needing to speicify a special resource table
entry. The changes are being made to align with coming BIOS-side changes
to remove the TYPE_INTMEM.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
ipc-bios.bld: Add building of smp libraries for A15
Previously smp was supported for M4 targets only.
Adding A15 support now.
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
Previously smp was supported for M4 targets only.
Adding A15 support now.
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
Linux: GateMP: Check for Proper NameServer Value Length
After getting the NameServer value for _GateMP_TI_dGate, check
to make sure that the length is equal to the expected value.
This is to prevent using some uninitialized values to configure
the GateMP. Indirectly, this can help check if hostSupport
has been enabled on the remote processor or not, because
currently, only if hostSupport has been enabled are there 4
entries. Otherwise there are only 2 entries.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
After getting the NameServer value for _GateMP_TI_dGate, check
to make sure that the length is equal to the expected value.
This is to prevent using some uninitialized values to configure
the GateMP. Indirectly, this can help check if hostSupport
has been enabled on the remote processor or not, because
currently, only if hostSupport has been enabled are there 4
entries. Otherwise there are only 2 entries.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
Shared memory cache management
Additional cache invalidates are needed to ensure all data remains fresh.
Signed-off-by: John Godbey <j-godbey@ti.com>
Additional cache invalidates are needed to ensure all data remains fresh.
Signed-off-by: John Godbey <j-godbey@ti.com>
Linux: tests: Call MessageQ_unbind in Fault Test
Call MessageQ_unbind in the fault test to unbind the application
from remote cores that it doesn't care about. This is useful in
the case of remote core recovery, so that recovery of a remote
core doesn't trigger errors in MessageQ APIs if the application
doesn't care about the state of a particular core. In this way,
the MessageQ for the application is only bound to the core(s)
with which it is communicating.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
Call MessageQ_unbind in the fault test to unbind the application
from remote cores that it doesn't care about. This is useful in
the case of remote core recovery, so that recovery of a remote
core doesn't trigger errors in MessageQ APIs if the application
doesn't care about the state of a particular core. In this way,
the MessageQ for the application is only bound to the core(s)
with which it is communicating.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
Linux: Reattach to Proc In NameServer daemon In case of Error Recovery
In the case of error recovery on one core while more than one
core is currently connected to the LAD daemon, the refcount for
the NameServer daemon will never reach zero unless all connected
applications call Ipc_stop. This will prevent the NameServer
daemon from reconnecting to the recovered remote core until all
applications call Ipc_stop. This is not desireable behavior because
this prevents an application opening a MessageQ on the recovered
core until all applications call Ipc_stop.
Instead, the patch makes changes to internally re-connect with the
recovered core within NameServer daemon itself in the case of
remote core error recovery. The NameServer daemon will continue
trying to reconnect to the recovered core until successful. In
this way, the other applications are not required to exit for a new
MessageQ_open to be successful with the recovered core.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
In the case of error recovery on one core while more than one
core is currently connected to the LAD daemon, the refcount for
the NameServer daemon will never reach zero unless all connected
applications call Ipc_stop. This will prevent the NameServer
daemon from reconnecting to the recovered remote core until all
applications call Ipc_stop. This is not desireable behavior because
this prevents an application opening a MessageQ on the recovered
core until all applications call Ipc_stop.
Instead, the patch makes changes to internally re-connect with the
recovered core within NameServer daemon itself in the case of
remote core error recovery. The NameServer daemon will continue
trying to reconnect to the recovered core until successful. In
this way, the other applications are not required to exit for a new
MessageQ_open to be successful with the recovered core.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
Linux: Fix Error Handling in TransportRpmsg_delete
TransportRpmsg_delete was not checking for a NULL handle
before de-referencing it, resulting in an application crash
if it was called with a NULL handle. A NULL handle was
being passed to TransportRpmsg_delete in the case where
TransportRpmsg_create socket connect call failed. In this
case, TransportRpmsg_create called TransportRpmsg_delete
with a NULL handle.
This patch adds a check for a NULL handle before de-referencing
the pointer in TransportRpmsg_delete, and also takes care
to cleanup the socket in TransportRpmsg_create in the failure
case where it cannot be cleaned by TransportRpmsg_delete.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
TransportRpmsg_delete was not checking for a NULL handle
before de-referencing it, resulting in an application crash
if it was called with a NULL handle. A NULL handle was
being passed to TransportRpmsg_delete in the case where
TransportRpmsg_create socket connect call failed. In this
case, TransportRpmsg_create called TransportRpmsg_delete
with a NULL handle.
This patch adds a check for a NULL handle before de-referencing
the pointer in TransportRpmsg_delete, and also takes care
to cleanup the socket in TransportRpmsg_create in the failure
case where it cannot be cleaned by TransportRpmsg_delete.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
GateMP: Fix for hostSupport with GateMPSupportNull
The default configuration for GateMP remoteCustom2 is to use
GateMPSupportNull. In this case, the remoteCustom2InUse array
will be NULL. Due to this, the virtToPhys translation will
fail. If Asserts are enabled for the GateMP module, this
will result in a failure.
This patch fixes the issue by first checking if the pointer
is NULL before attempting the translation, since it is a valid
case for the pointer to be NULL.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
The default configuration for GateMP remoteCustom2 is to use
GateMPSupportNull. In this case, the remoteCustom2InUse array
will be NULL. Due to this, the virtToPhys translation will
fail. If Asserts are enabled for the GateMP module, this
will result in a failure.
This patch fixes the issue by first checking if the pointer
is NULL before attempting the translation, since it is a valid
case for the pointer to be NULL.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
Linux: GateMP: Baseaddr not Correctly Set when UIO is not Present
In the case where UIO is not present, the GateMP_get_sr0() function
should set the baseaddr to 0. However, the code was not correctly
de-referencing the baseaddr parameter when attempting to set it to
zero, resulting in an un-initialized value for baseaddr when the UIO
driver is not present. This can result in an incorrect address for
the inUse arrays with consequences such as failure to map or other
unexpected behavior.
This patch fixes it to properly set the baseaddr to 0 for the case
where UIO is not present.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
In the case where UIO is not present, the GateMP_get_sr0() function
should set the baseaddr to 0. However, the code was not correctly
de-referencing the baseaddr parameter when attempting to set it to
zero, resulting in an un-initialized value for baseaddr when the UIO
driver is not present. This can result in an incorrect address for
the inUse arrays with consequences such as failure to map or other
unexpected behavior.
This patch fixes it to properly set the baseaddr to 0 for the case
where UIO is not present.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
deh: Watchdog: Timer structures declared as volatile
Watchdog implementation configures timers to operate in posted-write
mode, requiring SW to poll on TWPS register prior to subsequent write
access.
Therefore, references to the Watchdog timer instance must be declared
as volatile. Otherwise, the initial value read of the TWPS will be
used as the polling value indefinitely, causing a potential lockup
if the application is completely idle.
Signed-off-by: Stephen Molfetta <sjmolfetta@ti.com>
Watchdog implementation configures timers to operate in posted-write
mode, requiring SW to poll on TWPS register prior to subsequent write
access.
Therefore, references to the Watchdog timer instance must be declared
as volatile. Otherwise, the initial value read of the TWPS will be
used as the polling value indefinitely, causing a potential lockup
if the application is completely idle.
Signed-off-by: Stephen Molfetta <sjmolfetta@ti.com>
ipc: Remove warnings found with MISRA checkers
- Removed following warning "In the definition of a function-like
macro each instance of a parameter shall be enclosed in parentheses
unless it is used as the operand of # or ##
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
- Removed following warning "In the definition of a function-like
macro each instance of a parameter shall be enclosed in parentheses
unless it is used as the operand of # or ##
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
ipc: Fix to handle remote GateMP not available
There is an issue when GateMP in the remote processor is not available,
resulting in error. This fix handles the case gracefully by
ignoring remote gateMP availability.
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
There is an issue when GateMP in the remote processor is not available,
resulting in error. This fix handles the case gracefully by
ignoring remote gateMP availability.
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
tests: gatempapp: update cmem and sr0 addresses to align with kernel
Update the cmem and sr0 addresses to align with default values for
linux kernel.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
Update the cmem and sr0 addresses to align with default values for
linux kernel.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
ipc-bios.bld: Update default platform for C6678
- Also update print string for unknown platform
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
- Also update print string for unknown platform
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
GateMP: Correct exception string
- Correct typo in Exception string for RemoteCustom2
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
- Correct typo in Exception string for RemoteCustom2
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
GateMP: Add check for zero resources case
When reserving SR0 regions for GateMp instances, in some cases,
(for example the NULL gate) has zero resources. This was
not handled properly and resulted in failure. Fix is to avoid doing
unnecessary operations in case of zero resources.
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
When reserving SR0 regions for GateMp instances, in some cases,
(for example the NULL gate) has zero resources. This was
not handled properly and resulted in failure. Fix is to avoid doing
unnecessary operations in case of zero resources.
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
tests: Update messageq_multicore to use ti.ipc.remoteproc.Resource
Before this fix, the rsc table header file was included directly in C
code. And the table was getting optimized away due to no direct
reference to the resource table. This resulted in failure of test
downloaded through user space loader.
Instead added the configuration to include the resource table (without
vdev and vring) through configuration file, which is more cleaner.
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
Before this fix, the rsc table header file was included directly in C
code. And the table was getting optimized away due to no direct
reference to the resource table. This resulted in failure of test
downloaded through user space loader.
Instead added the configuration to include the resource table (without
vdev and vring) through configuration file, which is more cleaner.
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
lad: Allow only one instance of the daemon
Make sure only one instance of the LAD daemon is running
at a time. This implementation is based on syslink's
daemon.
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
Make sure only one instance of the LAD daemon is running
at a time. This implementation is based on syslink's
daemon.
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>