From patchwork Thu May 13 20:46:40 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 99425 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 o4DKkr7M013430 for ; Thu, 13 May 2010 20:46:53 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754889Ab0EMUqw (ORCPT ); Thu, 13 May 2010 16:46:52 -0400 Received: from fg-out-1718.google.com ([72.14.220.159]:27230 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752861Ab0EMUqu (ORCPT ); Thu, 13 May 2010 16:46:50 -0400 Received: by fg-out-1718.google.com with SMTP id d23so1321319fga.1 for ; Thu, 13 May 2010 13:46:49 -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=yeZMuOo4QlqbESZuOIPbr/13C7RbnUCw/HhtFOdd1ts=; b=GUphugIvdCx5zJYi7g0kQ5O32IcBabooRwIPretSY3BWABDCZgpipZgz0QXbfSsTOh JL7JAmx5RqhkHodw+ZbuoxoxKtqI4FeUKWfz9/cHF6NSFHJS50kMyuu6kInHGw4wXfrK 4Ip+z0b8XIGcqE39NTNoaOPTISLWJFyvpmV3c= 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=NDst9EnN+frn1ebWM8ABMT9J4aUZK3LeN6p6jFYiBa1nUJe3CUhxAW3y+0TmkWOzcq CSNgWEcFKwf44+XKj7uh9vwbJpb4UxNxSLDWdMTB6r/2Xs/P1w+nbsWNi8qV1ZBSZqBg L4JNc5xz1+2giznq8XyaKias8xVpul8dtoXPc= Received: by 10.86.22.31 with SMTP id 31mr1382165fgv.24.1273783609214; Thu, 13 May 2010 13:46:49 -0700 (PDT) Received: from localhost (a91-153-253-80.elisa-laajakaista.fi [91.153.253.80]) by mx.google.com with ESMTPS id l12sm12143434fgb.17.2010.05.13.13.46.48 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 13 May 2010 13:46:48 -0700 (PDT) From: Felipe Contreras To: linux-omap Cc: Omar Ramirez Luna , Fernando Guzman Lugo , Hiroshi Doyu , Felipe Contreras Subject: [PATCH 1/2] dspbridge: deh: fix corruption on MMU fault Date: Thu, 13 May 2010 23:46:40 +0300 Message-Id: <1273783601-13472-2-git-send-email-felipe.contreras@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1273783601-13472-1-git-send-email-felipe.contreras@gmail.com> References: <1273783601-13472-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]); Thu, 13 May 2010 20:46:53 +0000 (UTC) diff --git a/drivers/dsp/bridge/wmd/ue_deh.c b/drivers/dsp/bridge/wmd/ue_deh.c index 03b29b6..233ad17 100644 --- a/drivers/dsp/bridge/wmd/ue_deh.c +++ b/drivers/dsp/bridge/wmd/ue_deh.c @@ -62,13 +62,6 @@ /* Max time to check for GP Timer IRQ */ #define GPTIMER_IRQ_WAIT_MAX_CNT 1000 -static struct hw_mmu_map_attrs_t map_attrs = { HW_LITTLE_ENDIAN, - HW_ELEM_SIZE16BIT, - HW_MMU_CPUES -}; - -static void *dummy_va_addr; - static struct omap_dm_timer *timer; dsp_status bridge_deh_create(struct deh_mgr **ret_deh_mgr, @@ -84,7 +77,6 @@ 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 = NULL; /* Allocate IO manager object: */ deh_mgr = kzalloc(sizeof(struct deh_mgr), GFP_KERNEL); if (!deh_mgr) { @@ -190,12 +182,8 @@ dsp_status bridge_deh_register_notify(struct deh_mgr *deh_mgr, u32 event_mask, void bridge_deh_notify(struct deh_mgr *deh_mgr, u32 ulEventMask, u32 dwErrInfo) { struct wmd_dev_context *dev_context; - dsp_status status = DSP_SOK; - u32 mem_physical = 0; u32 hw_mmu_max_tlb_count = 31; extern u32 fault_addr; - struct cfg_hostres *resources; - hw_status hw_status_obj; u32 cnt = 0; if (!deh_mgr) @@ -203,7 +191,6 @@ void bridge_deh_notify(struct deh_mgr *deh_mgr, u32 ulEventMask, u32 dwErrInfo) dev_info(bridge, "%s: device exception\n", __func__); dev_context = (struct wmd_dev_context *)deh_mgr->hwmd_context; - resources = dev_context->resources; switch (ulEventMask) { case DSP_SYSERROR: @@ -228,9 +215,6 @@ 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 = kzalloc(sizeof(char) * 0x1000, GFP_ATOMIC); - mem_physical = - ALIGN_DOWN(virt_to_phys(dummy_va_addr), PAGE_SIZE); dev_context = (struct wmd_dev_context *) deh_mgr->hwmd_context; @@ -247,13 +231,6 @@ void bridge_deh_notify(struct deh_mgr *deh_mgr, u32 ulEventMask, u32 dwErrInfo) dev_context->num_tlb_entries = dev_context->fixed_tlb_entries; } - if (DSP_SUCCEEDED(status)) { - hw_status_obj = - hw_mmu_tlb_add(resources->dw_dmmu_base, - mem_physical, fault_addr, - HW_PAGE_SIZE4KB, 1, - &map_attrs, HW_SET, HW_SET); - } /* * Send a GP Timer interrupt to DSP. @@ -286,9 +263,6 @@ void bridge_deh_notify(struct deh_mgr *deh_mgr, u32 ulEventMask, u32 dwErrInfo) } } - /* Clear MMU interrupt */ - hw_mmu_event_ack(resources->dw_dmmu_base, - HW_MMU_TRANSLATION_FAULT); dump_dsp_stack(deh_mgr->hwmd_context); omap_dm_timer_disable(timer); break; @@ -356,6 +330,4 @@ dsp_status bridge_deh_get_info(struct deh_mgr *deh_mgr, void bridge_deh_release_dummy_mem(void) { - kfree(dummy_va_addr); - dummy_va_addr = NULL; }