From patchwork Sun Oct 17 22:36:32 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 260571 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 o9HMbQX0026148 for ; Sun, 17 Oct 2010 22:37:27 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751078Ab0JQWgf (ORCPT ); Sun, 17 Oct 2010 18:36:35 -0400 Received: from mail-bw0-f46.google.com ([209.85.214.46]:34660 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750980Ab0JQWge (ORCPT ); Sun, 17 Oct 2010 18:36:34 -0400 Received: by bwz15 with SMTP id 15so198548bwz.19 for ; Sun, 17 Oct 2010 15:36:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=jMR0fUv02yEoNXGjWb0U1towEycxnf1hBQThRKD7G5s=; b=DLM9msAlBDgheBCXxuU37yLW04DdM3gfpHGAvpuLaErLk/4q8zHp3hwvkC72xvoO92 62LKM1dAdcSZoe4jraJoQERZqahVL6rFIXFT2P2SXkDSLLGivivUP3k7GwQZb+6P11SZ cRaccdGFuEOQMxrMUeVcGaZI6JWSiN9ao63VQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=qOL2JRNyjFKSxhqWOX8P0C/8XymegQYTLA+sQGnD5heUItkkIIUIZ2XS2P0TGfOCKo gINESiPE5XhWqCelPlUcnyQ5R9oun+XJ4jh5dB/HEDQQNoLdmmjCPBSWaeqyWmVuMuG5 V807XJhXJsdseGV/4uxqCPGj6faaP1aSxLKms= MIME-Version: 1.0 Received: by 10.204.122.11 with SMTP id j11mr3239533bkr.171.1287354992934; Sun, 17 Oct 2010 15:36:32 -0700 (PDT) Received: by 10.204.13.68 with HTTP; Sun, 17 Oct 2010 15:36:32 -0700 (PDT) In-Reply-To: <1286310944-25035-2-git-send-email-x0095840@ti.com> References: <1286310944-25035-1-git-send-email-x0095840@ti.com> <1286310944-25035-2-git-send-email-x0095840@ti.com> Date: Mon, 18 Oct 2010 01:36:32 +0300 Message-ID: Subject: Re: [PATCHv3 01/11] staging: tidspbridge: replace iommu custom for opensource implementation From: Felipe Contreras To: Fernando Guzman Lugo Cc: gregkh@suse.de, felipe.contreras@nokia.com, ameya.palande@nokia.com, nm@ti.com, Hiroshi.DOYU@nokia.com, ohad@wizery.com, linux-kernel@vger.kernel.org, andy.shevchenko@gmail.com, linux-omap@vger.kernel.org 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]); Sun, 17 Oct 2010 22:37:27 +0000 (UTC) diff --git a/drivers/staging/tidspbridge/core/io_sm.c b/drivers/staging/tidspbridge/core/io_sm.c index 842b8db..16cf246 100644 --- a/drivers/staging/tidspbridge/core/io_sm.c +++ b/drivers/staging/tidspbridge/core/io_sm.c @@ -541,6 +541,14 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) ae_proc[ndx].ul_dsp_va * hio_mgr->word_size, page_size[i]); ndx++; + } else { + u32 tmp_curr; + tmp_curr = iommu_kmap(mmu, va_curr, pa_curr, page_size[i], + IOVMF_ENDIAN_LITTLE | IOVMF_ELSZ_32); + if (IS_ERR_VALUE(tmp_curr)) { + status = (int)tmp_curr; + goto func_end; + } } pa_curr += page_size[i]; va_curr += page_size[i]; @@ -593,6 +601,15 @@ int bridge_io_on_loaded(struct io_mgr *hio_mgr) "DSP_VA 0x%x\n", ae_proc[ndx].ul_gpp_pa, ae_proc[ndx].ul_dsp_va); ndx++; + } else { + u32 tmp_curr; + tmp_curr = iommu_kmap(mmu, + hio_mgr->ext_proc_info.ty_tlb[i].ul_dsp_virt, + hio_mgr->ext_proc_info.ty_tlb[i].ul_gpp_phys, + 0x100000, + IOVMF_ENDIAN_LITTLE | IOVMF_ELSZ_32); + if (IS_ERR_VALUE(tmp_curr)) + status = (int)tmp_curr; } } if (status) diff --git a/drivers/staging/tidspbridge/core/tiomap3430.c b/drivers/staging/tidspbridge/core/tiomap3430.c index c2f5105..92774fc 100644 --- a/drivers/staging/tidspbridge/core/tiomap3430.c +++ b/drivers/staging/tidspbridge/core/tiomap3430.c @@ -1195,7 +1195,7 @@ static int get_io_pages(struct mm_struct *mm, u32 uva, unsigned pages, struct page *pg; for (i = 0; i < pages; i++) { - pa = user_va2_pa(mm, uva); + pa = user_va2_pa(mm, uva + i * PAGE_SIZE); if (!pfn_valid(__phys_to_pfn(pa)))