From patchwork Wed Nov 3 23:36:34 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sapiens, Rene" X-Patchwork-Id: 300842 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 oA3NkuQ0020495 for ; Wed, 3 Nov 2010 23:46:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753158Ab0KCXqc (ORCPT ); Wed, 3 Nov 2010 19:46:32 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:42859 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753020Ab0KCXqb (ORCPT ); Wed, 3 Nov 2010 19:46:31 -0400 Received: from dlep33.itg.ti.com ([157.170.170.112]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id oA3NkQtb028368 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 3 Nov 2010 18:46:26 -0500 Received: from emcc2.sasken-mty.naucm.ext.ti.com (localhost [127.0.0.1]) by dlep33.itg.ti.com (8.13.7/8.13.7) with ESMTP id oA3NkPbT023059; Wed, 3 Nov 2010 18:46:25 -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 oA3NkN5M023069; Wed, 3 Nov 2010 17:46:24 -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 1/8] staging: tidspbridge: overwrite DSP error codes Date: Wed, 3 Nov 2010 17:36:34 -0600 Message-Id: <1288827394-7505-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]); Wed, 03 Nov 2010 23:46:57 +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 {