From patchwork Tue Aug 11 01:21:53 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ameya Palande X-Patchwork-Id: 40543 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7B1M78M010158 for ; Tue, 11 Aug 2009 01:22:27 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753558AbZHKBWY (ORCPT ); Mon, 10 Aug 2009 21:22:24 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753615AbZHKBWY (ORCPT ); Mon, 10 Aug 2009 21:22:24 -0400 Received: from smtp.nokia.com ([192.100.122.230]:37640 "EHLO mgw-mx03.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753558AbZHKBWX (ORCPT ); Mon, 10 Aug 2009 21:22:23 -0400 Received: from vaebh105.NOE.Nokia.com (vaebh105.europe.nokia.com [10.160.244.31]) by mgw-mx03.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id n7B1MBmW012953; Tue, 11 Aug 2009 04:22:13 +0300 Received: from esebh102.NOE.Nokia.com ([172.21.138.183]) by vaebh105.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 11 Aug 2009 04:22:13 +0300 Received: from mgw-sa01.ext.nokia.com ([147.243.1.47]) by esebh102.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Tue, 11 Aug 2009 04:22:12 +0300 Received: from localhost.localdomain (mipv6-1.research.nokia.com [172.21.41.19]) by mgw-sa01.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id n7B1LpoO002545; Tue, 11 Aug 2009 04:22:09 +0300 From: Ameya Palande To: linux-omap@vger.kernel.org Cc: hiroshi.doyu@nokia.com, omar.ramirez@ti.com, x0095840@ti.com, suyog@ti.com, roman.tereshonkov@nokia.com, ernesto@ti.com Subject: [PATCH 12/13] DSPBRIDGE: Use pr_ctxt in STRM_FreeBuffer_ Date: Tue, 11 Aug 2009 04:21:53 +0300 Message-Id: <1249953714-20972-13-git-send-email-ameya.palande@nokia.com> X-Mailer: git-send-email 1.6.2.4 In-Reply-To: <1249953714-20972-12-git-send-email-ameya.palande@nokia.com> References: <1249953714-20972-1-git-send-email-ameya.palande@nokia.com> <1249953714-20972-2-git-send-email-ameya.palande@nokia.com> <1249953714-20972-3-git-send-email-ameya.palande@nokia.com> <1249953714-20972-4-git-send-email-ameya.palande@nokia.com> <1249953714-20972-5-git-send-email-ameya.palande@nokia.com> <1249953714-20972-6-git-send-email-ameya.palande@nokia.com> <1249953714-20972-7-git-send-email-ameya.palande@nokia.com> <1249953714-20972-8-git-send-email-ameya.palande@nokia.com> <1249953714-20972-9-git-send-email-ameya.palande@nokia.com> <1249953714-20972-10-git-send-email-ameya.palande@nokia.com> <1249953714-20972-11-git-send-email-ameya.palande@nokia.com> <1249953714-20972-12-git-send-email-ameya.palande@nokia.com> X-OriginalArrivalTime: 11 Aug 2009 01:22:13.0045 (UTC) FILETIME=[27AEAE50:01CA1A22] X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Signed-off-by: Ameya Palande --- arch/arm/plat-omap/include/dspbridge/strm.h | 3 +- drivers/dsp/bridge/pmgr/wcd.c | 2 +- drivers/dsp/bridge/rmgr/drv.c | 2 +- drivers/dsp/bridge/rmgr/strm.c | 33 ++++++-------------------- 4 files changed, 12 insertions(+), 28 deletions(-) diff --git a/arch/arm/plat-omap/include/dspbridge/strm.h b/arch/arm/plat-omap/include/dspbridge/strm.h index 9929210..71ea2a6 100644 --- a/arch/arm/plat-omap/include/dspbridge/strm.h +++ b/arch/arm/plat-omap/include/dspbridge/strm.h @@ -175,7 +175,8 @@ * Ensures: */ extern DSP_STATUS STRM_FreeBuffer(struct STRM_OBJECT *hStrm, - u8 **apBuffer, u32 uNumBufs); + u8 **apBuffer, u32 uNumBufs, + struct PROCESS_CONTEXT *pr_ctxt); /* * ======== STRM_GetEventHandle ======== diff --git a/drivers/dsp/bridge/pmgr/wcd.c b/drivers/dsp/bridge/pmgr/wcd.c index 4fdcb18..8ba6895 100644 --- a/drivers/dsp/bridge/pmgr/wcd.c +++ b/drivers/dsp/bridge/pmgr/wcd.c @@ -1528,7 +1528,7 @@ u32 STRMWRAP_FreeBuffer(union Trapped_Args *args, void *pr_ctxt) if (DSP_SUCCEEDED(status)) { status = STRM_FreeBuffer(args->ARGS_STRM_FREEBUFFER.hStream, - apBuffer, uNumBufs); + apBuffer, uNumBufs, pr_ctxt); } cp_to_usr(args->ARGS_STRM_FREEBUFFER.apBuffer, apBuffer, status, uNumBufs); diff --git a/drivers/dsp/bridge/rmgr/drv.c b/drivers/dsp/bridge/rmgr/drv.c index bf7d0b2..e880ea8 100644 --- a/drivers/dsp/bridge/rmgr/drv.c +++ b/drivers/dsp/bridge/rmgr/drv.c @@ -798,7 +798,7 @@ static DSP_STATUS DRV_ProcFreeSTRMRes(HANDLE hPCtxt) apBuffer = MEM_Alloc((pSTRMRes->uNumBufs * sizeof(u8 *)), MEM_NONPAGED); status = STRM_FreeBuffer(pSTRMRes->hStream, apBuffer, - pSTRMRes->uNumBufs); + pSTRMRes->uNumBufs, pCtxt); MEM_Free(apBuffer); } status = STRM_Close(pSTRMRes->hStream, pCtxt); diff --git a/drivers/dsp/bridge/rmgr/strm.c b/drivers/dsp/bridge/rmgr/strm.c index d68251f..0ef43ea 100644 --- a/drivers/dsp/bridge/rmgr/strm.c +++ b/drivers/dsp/bridge/rmgr/strm.c @@ -194,7 +194,7 @@ DSP_STATUS STRM_AllocateBuffer(struct STRM_OBJECT *hStrm, u32 uSize, } } if (DSP_FAILED(status)) - STRM_FreeBuffer(hStrm, apBuffer, uAllocated); + STRM_FreeBuffer(hStrm, apBuffer, uAllocated, pr_ctxt); #ifndef RES_CLEANUP_DISABLE if (DSP_FAILED(status)) @@ -363,18 +363,14 @@ void STRM_Exit(void) * Frees the buffers allocated for a stream. */ DSP_STATUS STRM_FreeBuffer(struct STRM_OBJECT *hStrm, u8 **apBuffer, - u32 uNumBufs) + u32 uNumBufs, struct PROCESS_CONTEXT *pr_ctxt) { DSP_STATUS status = DSP_SOK; u32 i = 0; - #ifndef RES_CLEANUP_DISABLE - DSP_STATUS res_status = DSP_SOK; - u32 hProcess; - HANDLE pCtxt = NULL; - HANDLE hDrvObject; - HANDLE hSTRMRes = NULL; - #endif +#ifndef RES_CLEANUP_DISABLE + HANDLE hSTRMRes = NULL; +#endif DBC_Require(cRefs > 0); DBC_Require(apBuffer != NULL); @@ -398,22 +394,9 @@ DSP_STATUS STRM_FreeBuffer(struct STRM_OBJECT *hStrm, u8 **apBuffer, } } #ifndef RES_CLEANUP_DISABLE - /* Update the node and stream resource status */ - /* Return TGID instead of process handle */ - hProcess = current->tgid; - - res_status = CFG_GetObject((u32 *)&hDrvObject, REG_DRV_OBJECT); - if (DSP_SUCCEEDED(res_status)) { - DRV_GetProcContext(hProcess, - (struct DRV_OBJECT *)hDrvObject, &pCtxt, - NULL, 0); - if (pCtxt != NULL) { - if (DRV_GetSTRMResElement(hStrm, hSTRMRes, pCtxt) != - DSP_ENOTFOUND) { - DRV_ProcUpdateSTRMRes(uNumBufs-i, hSTRMRes, - pCtxt); - } - } + if (DRV_GetSTRMResElement(hStrm, hSTRMRes, pr_ctxt) != + DSP_ENOTFOUND) { + DRV_ProcUpdateSTRMRes(uNumBufs-i, hSTRMRes, pr_ctxt); } #endif return status;