From patchwork Tue Mar 23 21:25:42 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 87774 X-Patchwork-Delegate: omar.ramirez@ti.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2NLQYOC018186 for ; Tue, 23 Mar 2010 21:26:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753797Ab0CWV0h (ORCPT ); Tue, 23 Mar 2010 17:26:37 -0400 Received: from mail-bw0-f209.google.com ([209.85.218.209]:46268 "EHLO mail-bw0-f209.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753764Ab0CWV0g (ORCPT ); Tue, 23 Mar 2010 17:26:36 -0400 Received: by mail-bw0-f209.google.com with SMTP id 1so2292192bwz.21 for ; Tue, 23 Mar 2010 14:26:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=DOr7UNPCfL/FC+15/vkmrkX5Xt+NUko+XQIq52Cc7YQ=; b=BYCWHLUbFVyGhrtrSrAbRR25CtcYYoac1QEMnD3ATE90V0Beq6koTVmI88cLZyLA28 tJW29Qs761mvrlMewKX1SoOfoKejseeojLSzwMeFXwYutoqaAOthfMmP8uijcMVSQ7mh GLvHJ4SVZ5TutnUGSvynGpTuaN5Tr/jrLWxK8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=HGW91kqaKwNTCNsz7HMtd6/I7nBOOlX6LKX1PqpfCMmtRanv8tXPRsFr6nXeJ6ZPyv Buf2AVLDUv2epXYEpxXkmSP5PH/YumRsOHLOgRijWl+o/UEOMB7w2ZF0mOjLGGp8Gyk/ HFBDjPUfoRWwoa6q8wVD6rxgVny2WoWoVfk6c= Received: by 10.204.49.83 with SMTP id u19mr664458bkf.157.1269379595612; Tue, 23 Mar 2010 14:26:35 -0700 (PDT) Received: from localhost (a91-153-253-80.elisa-laajakaista.fi [91.153.253.80]) by mx.google.com with ESMTPS id 15sm2993644bwz.8.2010.03.23.14.26.35 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 23 Mar 2010 14:26:35 -0700 (PDT) From: Felipe Contreras To: linux-omap Cc: Ameya Palande , Omar Ramirez Luna , Felipe Contreras Subject: [PATCH 10/10] dsp-bridge: deh: fix dummy_va_addr Date: Tue, 23 Mar 2010 23:25:42 +0200 Message-Id: <1269379542-11892-11-git-send-email-felipe.contreras@gmail.com> X-Mailer: git-send-email 1.7.0.3 In-Reply-To: <1269379542-11892-1-git-send-email-felipe.contreras@gmail.com> References: <1269379542-11892-1-git-send-email-felipe.contreras@gmail.com> 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 (demeter.kernel.org [140.211.167.41]); Tue, 23 Mar 2010 21:26:37 +0000 (UTC) diff --git a/drivers/dsp/bridge/wmd/ue_deh.c b/drivers/dsp/bridge/wmd/ue_deh.c index b1c3189..018905e 100644 --- a/drivers/dsp/bridge/wmd/ue_deh.c +++ b/drivers/dsp/bridge/wmd/ue_deh.c @@ -52,15 +52,15 @@ #include "_tiomap_pwr.h" #include +#define ALIGN_DOWN(x,a) ((x)&(~((a)-1))) + static struct hw_mmu_map_attrs_t map_attrs = { HW_LITTLE_ENDIAN, HW_ELEM_SIZE16BIT, HW_MMU_CPUES }; -#define VIRT_TO_PHYS(x) ((x) - PAGE_OFFSET + PHYS_OFFSET) - -static u32 dummy_va_addr; +static void *dummy_va_addr; dsp_status bridge_deh_create(struct deh_mgr **ret_deh_mgr, struct dev_object *hdev_obj) @@ -80,7 +80,7 @@ dsp_status bridge_deh_create(struct deh_mgr **ret_deh_mgr, /* Get WMD context info. */ dev_get_wmd_context(hdev_obj, &hwmd_context); DBC_ASSERT(hwmd_context); - dummy_va_addr = 0; + dummy_va_addr = NULL; /* Allocate IO manager object: */ MEM_ALLOC_OBJECT(deh_mgr, struct deh_mgr, SIGNATURE); if (!deh_mgr) { @@ -210,13 +210,11 @@ void bridge_deh_notify(struct deh_mgr *deh_mgr, u32 ulEventMask, u32 dwErrInfo) (unsigned int) deh_mgr->err_info.dw_val1, (unsigned int) deh_mgr->err_info.dw_val2, (unsigned int) fault_addr); - dummy_va_addr = - (u32) mem_calloc(sizeof(char) * 0x1000, MEM_PAGED); - mem_physical = - VIRT_TO_PHYS(PG_ALIGN_LOW - ((u32) dummy_va_addr, PG_SIZE4K)); + dummy_va_addr = mem_calloc(0x1000, MEM_PAGED); + mem_physical = ALIGN_DOWN(virt_to_phys(dummy_va_addr), PAGE_SIZE); dev_context = (struct wmd_dev_context *) deh_mgr->hwmd_context; + /* * Reset the dynamic mmu index to fixed count if it exceeds * 31. So that the dynmmuindex is always between the range of @@ -291,6 +289,6 @@ dsp_status bridge_deh_get_info(struct deh_mgr *deh_mgr, void bridge_deh_release_dummy_mem(void) { - kfree((void *)dummy_va_addr); - dummy_va_addr = 0; + kfree(dummy_va_addr); + dummy_va_addr = NULL; }