author | Robert Tivy <rtivy@ti.com> | |
Wed, 20 May 2015 01:17:21 +0000 (18:17 -0700) | ||
committer | Robert Tivy <rtivy@ti.com> | |
Wed, 20 May 2015 23:58:29 +0000 (16:58 -0700) | ||
commit | 2a4256289d462d93a7e00a6ffb10bd46081a9500 | |
tree | cfb1748a43eceaff4f847463c3ee687e0b00700f | tree | snapshot (tar.xz tar.gz zip) |
parent | f2ad3ee2d55ddf594f9e3170618c738967760030 | commit | diff |
Fix Linux GateMP bug by introducing new GateMP_attach(procId) API
Previous to the introduction of Linux Ipc_attach() and NameServer_attach(),
LAD would effectively "attach" to GateMP via NameServer_setup() and
GateMP_setup(), all before opening the command FIFO and accepting commands
from clients. This worked because NameServer_setup() had internal code
that would perform the "attach" functionality, allowing GateMP_setup() to
proceed.
Now that NameServer_attach() has been introduced, NameServer_setup() no
longer performs the "attach" functionality. But Ipc_start() now needs to
call Ipc_attach() which, in turn, calls NameServer_attach(), but before
doing so Ipc_start must connect and communicate with LAD. However, LAD
gets stuck in the pre-FIFO GateMP_setup() since NameServer has not yet
attached, which caused Ipc_start() to hang waiting to connect to LAD
(since there was no command FIFO yet). In a nutshell, a deadlock.
This is fixed by introducing GateMP_attach(procId), which is called by
Ipc_attach(). GateMP_attach() performs the functionality that was
getting stuck in GateMP_setup() (and GateMP_setup() is pared down to not
need to "attach").
GateMP_detach(procId) is also introduced and called by Ipc_detach().
While these APIs can be called by the advanced user, they are considered
to be "internal" APIs.
Previous to the introduction of Linux Ipc_attach() and NameServer_attach(),
LAD would effectively "attach" to GateMP via NameServer_setup() and
GateMP_setup(), all before opening the command FIFO and accepting commands
from clients. This worked because NameServer_setup() had internal code
that would perform the "attach" functionality, allowing GateMP_setup() to
proceed.
Now that NameServer_attach() has been introduced, NameServer_setup() no
longer performs the "attach" functionality. But Ipc_start() now needs to
call Ipc_attach() which, in turn, calls NameServer_attach(), but before
doing so Ipc_start must connect and communicate with LAD. However, LAD
gets stuck in the pre-FIFO GateMP_setup() since NameServer has not yet
attached, which caused Ipc_start() to hang waiting to connect to LAD
(since there was no command FIFO yet). In a nutshell, a deadlock.
This is fixed by introducing GateMP_attach(procId), which is called by
Ipc_attach(). GateMP_attach() performs the functionality that was
getting stuck in GateMP_setup() (and GateMP_setup() is pared down to not
need to "attach").
GateMP_detach(procId) is also introduced and called by Ipc_detach().
While these APIs can be called by the advanced user, they are considered
to be "internal" APIs.