From patchwork Sun May 16 15:44:28 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 99960 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 o4GFilsQ024737 for ; Sun, 16 May 2010 15:44:47 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752389Ab0EPPor (ORCPT ); Sun, 16 May 2010 11:44:47 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:49359 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751809Ab0EPPoq (ORCPT ); Sun, 16 May 2010 11:44:46 -0400 Received: by fxm6 with SMTP id 6so2976907fxm.19 for ; Sun, 16 May 2010 08:44:44 -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=oY/7R+eq/5J55b/AIMSovhG0rs7urjcysc8mqoPaZQM=; b=lPFmrwtDmhaUUNDJEOEJS/E8D2tT+/RU+f38NcYY0mXmhsWXRuDbF3a2hOfJ4l/rz9 NwX4jEcCTsrjs60yyKPTZEXW10hScYjTpr+pNwlfmq8RPPScJrpZR99vvvuPGQA1uedy 7So9ai4KVbVO0AN+RWMT0hUxniPLgyJsCom7o= 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=G4cUxGXTE90cZ+o6UhlfyXC7evGMMWs1uexyIPMOIhnY8dbf1I7TMOJRtmJxTAB9C6 CRMsbzSbUVvmhxfXzkQP8Ig7fNdpzvI2YO/PXvxFSJCb5AJ8xarJuRKTb4BpvH3bFk8x OfVltiJ7anmpH8bOV+02fpypSy5YUd5Xrv//k= Received: by 10.86.124.35 with SMTP id w35mr6779543fgc.49.1274024684713; Sun, 16 May 2010 08:44:44 -0700 (PDT) Received: from localhost (a91-153-253-80.elisa-laajakaista.fi [91.153.253.80]) by mx.google.com with ESMTPS id e11sm5193186fga.28.2010.05.16.08.44.43 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 16 May 2010 08:44:43 -0700 (PDT) From: Felipe Contreras To: linux-omap Cc: Omar Ramirez Luna , Fernando Guzman Lugo , Deepak Chitriki , Felipe Contreras Subject: [PATCH v2] dspbridge: deh: fix corruption on MMU fault Date: Sun, 16 May 2010 18:44:28 +0300 Message-Id: <1274024668-20899-2-git-send-email-felipe.contreras@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1274024668-20899-1-git-send-email-felipe.contreras@gmail.com> References: <1274024668-20899-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]); Sun, 16 May 2010 15:44:47 +0000 (UTC) diff --git a/drivers/dsp/bridge/core/ue_deh.c b/drivers/dsp/bridge/core/ue_deh.c index 605f312..ab95916 100644 --- a/drivers/dsp/bridge/core/ue_deh.c +++ b/drivers/dsp/bridge/core/ue_deh.c @@ -53,8 +53,6 @@ #include "_tiomap_pwr.h" #include -#define ALIGN_DOWN(x, a) ((x)&(~((a)-1))) - /* GP Timer number to trigger interrupt for MMU-fault ISR on DSP */ #define GPTIMER_FOR_DSP_MMU_FAULT 8 /* Bit mask to enable overflow interrupt */ @@ -191,7 +189,6 @@ void bridge_deh_notify(struct deh_mgr *deh_mgr, u32 ulEventMask, u32 dwErrInfo) { struct bridge_dev_context *dev_context; dsp_status status = DSP_SOK; - u32 mem_physical = 0; u32 hw_mmu_max_tlb_count = 31; struct cfg_hostres *resources; hw_status hw_status_obj; @@ -227,9 +224,7 @@ 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); + dummy_va_addr = (void*)__get_free_page(GFP_ATOMIC); dev_context = (struct bridge_dev_context *) deh_mgr->hbridge_context; @@ -249,7 +244,7 @@ void bridge_deh_notify(struct deh_mgr *deh_mgr, u32 ulEventMask, u32 dwErrInfo) if (DSP_SUCCEEDED(status)) { hw_status_obj = hw_mmu_tlb_add(resources->dw_dmmu_base, - mem_physical, fault_addr, + virt_to_phys(dummy_va_addr), fault_addr, HW_PAGE_SIZE4KB, 1, &map_attrs, HW_SET, HW_SET); } @@ -355,6 +350,6 @@ dsp_status bridge_deh_get_info(struct deh_mgr *deh_mgr, void bridge_deh_release_dummy_mem(void) { - kfree(dummy_va_addr); + free_page((unsigned long)dummy_va_addr); dummy_va_addr = NULL; }