From patchwork Thu Nov 4 00:31:24 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sapiens, Rene" X-Patchwork-Id: 300902 X-Patchwork-Delegate: omar.ramirez@ti.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oA40fYuC025645 for ; Thu, 4 Nov 2010 00:41:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753948Ab0KDAlN (ORCPT ); Wed, 3 Nov 2010 20:41:13 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:50436 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753913Ab0KDAlM (ORCPT ); Wed, 3 Nov 2010 20:41:12 -0400 Received: from dlep36.itg.ti.com ([157.170.170.91]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id oA40f5TP032729 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 3 Nov 2010 19:41:05 -0500 Received: from emcc2.sasken-mty.naucm.ext.ti.com (localhost [127.0.0.1]) by dlep36.itg.ti.com (8.13.8/8.13.8) with ESMTP id oA40f4lQ010292; Wed, 3 Nov 2010 19:41:04 -0500 (CDT) Received: from localhost.localdomain (renesapiens.sasken-mty.naucm.ext.ti.com [10.87.230.77]) by emcc2.sasken-mty.naucm.ext.ti.com (8.13.8+Sun/8.13.8) with ESMTP id oA40f39u012297; Wed, 3 Nov 2010 18:41:03 -0600 (CST) From: Rene Sapiens 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 Subject: [PATCH] staging: tidspbridge: overwrite DSP error codes Date: Wed, 3 Nov 2010 18:31:24 -0600 Message-Id: <1288830684-7828-1-git-send-email-rene.sapiens@ti.com> X-Mailer: git-send-email 1.6.3.3 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Thu, 04 Nov 2010 00:41:34 +0000 (UTC) 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 {