From: Rene Sapiens <rene.sapiens@ti.com>
To: greg@kroah.com
Cc: gregkh@suse.de, nm@ti.com, felipe.contreras@gmail.com,
ernesto@ti.com, linux-kernel@vger.kernel.org,
devel@driverdev.osuosl.org, linux-omap@vger.kernel.org,
Rene Sapiens <rene.sapiens@ti.com>
Subject: [PATCH] staging: tidspbridge: overwrite DSP error codes
Date: Wed, 3 Nov 2010 18:31:24 -0600 [thread overview]
Message-ID: <1288830684-7828-1-git-send-email-rene.sapiens@ti.com> (raw)
When calling the DSP's remote functions, the DSP returns error
codes different from the ones managed by the kernel, the
function's return value is shared with the MPU using a shared
structure. This patch overwrites those error codes by kernel
specifics and deletes unnecessary code.
Signed-off-by: Rene Sapiens <rene.sapiens@ti.com>
---
drivers/staging/tidspbridge/rmgr/disp.c | 44 +++++-------------------------
1 files changed, 8 insertions(+), 36 deletions(-)
diff --git a/drivers/staging/tidspbridge/rmgr/disp.c b/drivers/staging/tidspbridge/rmgr/disp.c
index b7ce435..560069a 100644
--- a/drivers/staging/tidspbridge/rmgr/disp.c
+++ b/drivers/staging/tidspbridge/rmgr/disp.c
@@ -460,17 +460,6 @@ int disp_node_create(struct disp_object *disp_obj,
DBC_ASSERT(ul_bytes < (RMS_COMMANDBUFSIZE * sizeof(rms_word)));
status = send_message(disp_obj, node_get_timeout(hnode),
ul_bytes, node_env);
- if (status >= 0) {
- /*
- * Message successfully received from RMS.
- * Return the status of the Node's create function
- * on the DSP-side
- */
- status = (((rms_word *) (disp_obj->pbuf))[0]);
- if (status < 0)
- dev_dbg(bridge, "%s: DSP-side failed: 0x%x\n",
- __func__, status);
- }
}
func_end:
return status;
@@ -513,18 +502,6 @@ int disp_node_delete(struct disp_object *disp_obj,
status = send_message(disp_obj, node_get_timeout(hnode),
sizeof(struct rms_command),
&dw_arg);
- if (status >= 0) {
- /*
- * Message successfully received from RMS.
- * Return the status of the Node's delete
- * function on the DSP-side
- */
- status = (((rms_word *) (disp_obj->pbuf))[0]);
- if (status < 0)
- dev_dbg(bridge, "%s: DSP-side failed: "
- "0x%x\n", __func__, status);
- }
-
}
}
return status;
@@ -566,18 +543,6 @@ int disp_node_run(struct disp_object *disp_obj,
status = send_message(disp_obj, node_get_timeout(hnode),
sizeof(struct rms_command),
&dw_arg);
- if (status >= 0) {
- /*
- * Message successfully received from RMS.
- * Return the status of the Node's execute
- * function on the DSP-side
- */
- status = (((rms_word *) (disp_obj->pbuf))[0]);
- if (status < 0)
- dev_dbg(bridge, "%s: DSP-side failed: "
- "0x%x\n", __func__, status);
- }
-
}
}
@@ -739,7 +704,14 @@ static int send_message(struct disp_object *disp_obj, u32 timeout,
} else {
if (CHNL_IS_IO_COMPLETE(chnl_ioc_obj)) {
DBC_ASSERT(chnl_ioc_obj.pbuf == pbuf);
- status = (*((rms_word *) chnl_ioc_obj.pbuf));
+ if (*((int *)chnl_ioc_obj.pbuf) < 0) {
+ /* Translate DSP's to kernel error */
+ status = -EREMOTEIO;
+ dev_dbg(bridge, "%s: DSP-side failed:"
+ " DSP errcode = 0x%x, Kernel "
+ "errcode = %d\n", __func__,
+ *(int *)pbuf, status);
+ }
*pdw_arg =
(((rms_word *) (chnl_ioc_obj.pbuf))[1]);
} else {
--
1.6.3.3
next reply other threads:[~2010-11-04 0:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-04 0:31 Rene Sapiens [this message]
2010-12-06 8:53 ` Ramirez Luna, Omar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1288830684-7828-1-git-send-email-rene.sapiens@ti.com \
--to=rene.sapiens@ti.com \
--cc=devel@driverdev.osuosl.org \
--cc=ernesto@ti.com \
--cc=felipe.contreras@gmail.com \
--cc=greg@kroah.com \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=nm@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®