From patchwork Mon Apr 2 19:18:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 150230 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 084EAB6EEB for ; Tue, 3 Apr 2012 05:18:25 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1F36D28137; Mon, 2 Apr 2012 21:18:24 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id F0s86u49LvQw; Mon, 2 Apr 2012 21:18:23 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 820A92812C; Mon, 2 Apr 2012 21:18:22 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 978D72812E for ; Mon, 2 Apr 2012 21:18:20 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nRo5ueJrHOwb for ; Mon, 2 Apr 2012 21:18:20 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-ee0-f44.google.com (mail-ee0-f44.google.com [74.125.83.44]) by theia.denx.de (Postfix) with ESMTPS id 1FA002812A for ; Mon, 2 Apr 2012 21:18:18 +0200 (CEST) Received: by eeke51 with SMTP id e51so1138906eek.3 for ; Mon, 02 Apr 2012 12:18:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=RuL0s+qR8pdwEqSjzT847L7gRa7f/BJ83IMpyhp5v3g=; b=IUDo5OsMUlDNLYXp8O86HRPmgV0LNl2odEuaE9i169w3JEdvrhUayguAc1cpfjsq4H 1/Eo9opobwiQ3qzaTRWiStxC8vyH18tp5gtp8k1en6/uZxo5M6LsoHeAFp0w+kLT33lF Tuls0DHA8RZsNBLdlC0mfEKKpQAqezrbF/wZLe/kSS1qbMcQBt13xqnUSUL52Xp9ZWup RU9SWIlqP53Ah1Q4ng/Eq9GRcclcWyEAYC219EwVpdGH3RGRyr0Ce6Axi+u1MSlut2h9 xcLaAM+t7acpn7UIef7+Vm2ZLx/flzq+S3HTn6VfRkFFANtdbJM+P4L8Q2tGLTqbhqGT OUqQ== MIME-Version: 1.0 Received: by 10.14.188.131 with SMTP id a3mr1573754een.92.1333394298398; Mon, 02 Apr 2012 12:18:18 -0700 (PDT) Received: by 10.213.4.131 with HTTP; Mon, 2 Apr 2012 12:18:18 -0700 (PDT) In-Reply-To: <201204022103.02717.marex@denx.de> References: <1333391050-25199-1-git-send-email-fabio.estevam@freescale.com> <201204022039.47051.marex@denx.de> <201204022103.02717.marex@denx.de> Date: Mon, 2 Apr 2012 16:18:18 -0300 Message-ID: From: Fabio Estevam To: Marek Vasut Cc: Fabio Estevam , u-boot@lists.denx.de, afleming@freescale.com Subject: Re: [U-Boot] [PATCH v2] mmc: mxsmmc: Fix operation with DMA X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de On Mon, Apr 2, 2012 at 4:03 PM, Marek Vasut wrote: > Because that's called before relocation ;-) What about this? Too ugly? Or any better place for calling mxs_dma_init()? --- a/drivers/dma/apbh_dma.c +++ b/drivers/dma/apbh_dma.c @@ -35,6 +35,7 @@ static struct mxs_dma_chan mxs_dma_channels[MXS_MAX_DMA_CHANNELS]; +static int first; /* * Test is the DMA channel is valid channel */ @@ -346,6 +347,10 @@ struct mxs_dma_desc *mxs_dma_desc_alloc(void) struct mxs_dma_desc *pdesc; uint32_t size; + if (!first) + mxs_dma_init(); + first++; + size = roundup(sizeof(struct mxs_dma_desc), MXS_DMA_ALIGNMENT); pdesc = memalign(MXS_DMA_ALIGNMENT, size);