summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (from parent 1: e2c0234)
raw | patch | inline | side by side (from parent 1: e2c0234)
author | vwan@ti.com <vwan@ti.com> | |
Fri, 20 Mar 2015 18:47:12 +0000 (11:47 -0700) | ||
committer | Robert Tivy <rtivy@ti.com> | |
Wed, 25 Mar 2015 23:41:41 +0000 (16:41 -0700) |
This commit removes DSP2 from the invalid processor list, and improves
error handling in case the IPC driver is asked to load DSP2
when it does not exist (e.g. on J6 Eco)
Signed-off-by: VW <vwan@ti.com>
error handling in case the IPC driver is asked to load DSP2
when it does not exist (e.g. on J6 Eco)
Signed-off-by: VW <vwan@ti.com>
qnx/src/ipc3x_dev/ti/syslink/build/Qnx/resmgr/syslink_main.c | patch | blob | history |
diff --git a/qnx/src/ipc3x_dev/ti/syslink/build/Qnx/resmgr/syslink_main.c b/qnx/src/ipc3x_dev/ti/syslink/build/Qnx/resmgr/syslink_main.c
index 8edddf7cd6b060d2b9411c618185c2a6c00dc181..3f24b246ac6f44484ce2f83058a955db41f1ed47 100644 (file)
static int numAttach = 0;
#if defined(IPC_PLATFORM_VAYU)
-/* DSP2 is invalid on Vayu */
-#define INVALID_PROC "DSP2"
-
static bool gatempEnabled = false;
static Int32 sr0OwnerProcId = -1;
-#else
-#define INVALID_PROC ""
#endif
// IPC hibernation global variables
return (ENOSYS);
}
- if (strcmp(MultiProc_getName(procId), INVALID_PROC) == 0) {
- fprintf(stderr, "Unsupported core\n");
- return (EPERM);
- }
-
pthread_mutex_lock(&dev->firmwareLock);
for (i = 0; i < ipc_num_cores; i++) {
return (ENOSYS);
}
- if (strcmp(MultiProc_getName(procId), INVALID_PROC) == 0) {
- fprintf(stderr, "Unsupported core\n");
- return (EPERM);
- }
-
/* set up the number of bytes (returned by client's write()) */
_IO_SET_WRITE_NBYTES (ctp, msg->i.nbytes);
if (strcmp("1", buf) == 0) {
if ((ipc_firmware[i].procState == RESET_STATE) &&
(ipc_firmware[i].firmware != NULL)) {
- runSlave(ocb->ocb.attr->dev, procId, &ipc_firmware[i]);
+ status = runSlave(ocb->ocb.attr->dev, procId, &ipc_firmware[i]);
+ if (status < 0) {
+ pthread_mutex_unlock(&dev->firmwareLock);
+ free(buf);
+ fprintf(stderr, "IPC: failed to run slave core %s\n",
+ MultiProc_getName(procId));
+ return (EIO);
+ }
#if defined(IPC_PLATFORM_VAYU)
if (gatempEnabled) {
if (sr0OwnerProcId == -1) {
resetSlave(ocb->ocb.attr->dev, procId);
pthread_mutex_unlock(&dev->firmwareLock);
free(buf);
+ fprintf(stderr, "GateMP_setup failed\n");
return (EIO);
}
else if (status == 0) {
ipc_firmware[i].reload = true;
status = init_ipc_trace_device(dev);
if (status < 0) {
+#if defined(IPC_PLATFORM_VAYU)
+ if ((gatempEnabled) && (procId == sr0OwnerProcId)) {
+ sr0OwnerProcId = -1;
+ GateMP_destroy(FALSE);
+ }
+#endif
+ resetSlave(ocb->ocb.attr->dev, procId);
pthread_mutex_unlock(&dev->firmwareLock);
free(buf);
+ fprintf(stderr, "IPC: init_ipc_trace_device failed %d\n",
+ status);
return (EIO);
}
printf("Core %s has been started.\n", MultiProc_getName(procId));
}
}
#endif
- resetSlave(ocb->ocb.attr->dev, procId);
+ status = resetSlave(ocb->ocb.attr->dev, procId);
+ if (status < 0) {
+ pthread_mutex_unlock(&dev->firmwareLock);
+ free(buf);
+ fprintf(stderr, "IPC: failed to reset slave core %s\n",
+ MultiProc_getName(procId));
+ return (EIO);
+ }
ipc_firmware[i].procState = RESET_STATE;
ipc_firmware[i].reload = false;
status = deinit_ipc_trace_device(dev);
if (status < 0) {
pthread_mutex_unlock(&dev->firmwareLock);
free(buf);
- Osal_printf("IPC: deinit_ipc_trace_device failed %d",
+ fprintf(stderr, "IPC: deinit_ipc_trace_device failed %d\n",
status);
return (EIO);
}
return (ENOSYS);
}
- if (strcmp(MultiProc_getName(procId), INVALID_PROC) == 0) {
- fprintf(stderr, "Unsupported core\n");
- return (EPERM);
- }
-
pthread_mutex_lock(&dev->firmwareLock);
for (i = 0; i < ipc_num_cores; i++) {
if (ipc_firmware[i].proc_id == procId) {
return (ENOSYS);
}
- if (strcmp(MultiProc_getName(procId), INVALID_PROC) == 0) {
- fprintf(stderr, "Unsupported core\n");
- return (EPERM);
- }
-
/* set up the number of bytes (returned by client's write()) */
_IO_SET_WRITE_NBYTES (ctp, msg->i.nbytes);
continue;
}
else {
+ fprintf(stderr, "Failed to run core %s\n",
+ MultiProc_getName(procId));
break;
}
}
printUsage(argv[0]);
return (error);
}
- if (strcmp(argv[optind], INVALID_PROC) == 0) {
- fprintf (stderr, "Unsupported core specified\n");
- return (error);
- }
ipc_firmware[ipc_num_cores].proc = argv [optind];
ipc_firmware[ipc_num_cores].attachOnly =