From patchwork Wed Aug 22 18:53:54 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 179362 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 ED8E42C00A5 for ; Thu, 23 Aug 2012 04:54:05 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 761F6280AC; Wed, 22 Aug 2012 20:54:04 +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 4+7A9UKKQz5u; Wed, 22 Aug 2012 20:54:04 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A0D05280A2; Wed, 22 Aug 2012 20:54:03 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 98C2D280A2 for ; Wed, 22 Aug 2012 20:53:58 +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 RzKM2P-fsGBv for ; Wed, 22 Aug 2012 20:53:57 +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-ob0-f172.google.com (mail-ob0-f172.google.com [209.85.214.172]) by theia.denx.de (Postfix) with ESMTPS id 72819280A1 for ; Wed, 22 Aug 2012 20:53:55 +0200 (CEST) Received: by obbwc20 with SMTP id wc20so1727592obb.3 for ; Wed, 22 Aug 2012 11:53:54 -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=5rK2AKAlEWn3TbNwy4IaAtDGMjsISNyBAaVgQdDuCjc=; b=QneXsTqvyFqr7C6E2KNjal0TcYkkTDVmpTP6XAv3Om1/+sgefhoI2gQMfiGV/KyFr5 fYVb5Tkzu6B74yfUadhAc8velDcNTYMLUQ/t1lmUrGISAlq3DlmzDDkLM8uIy6gDUGyy wh7IvG288F4b/6Xbl/53N59SbR8jMRTXfRVUBwYBnKPIOSMvzkDrbA6u71sQ4A566OPp DNLn1YvZIRMFFf435R6UmHHcmhpZYr5JLfaWEGw4uK1wJ/ZFoZb5KfJe6Bj4Nx8lFg9r cSydHPYUBn2Bc3XWE7bgZEqga12OngbQb7A6KA+0f74kkK17WDZDv0ydHj1u6Ag2bHKR P9Nw== MIME-Version: 1.0 Received: by 10.182.73.65 with SMTP id j1mr16695274obv.42.1345661634365; Wed, 22 Aug 2012 11:53:54 -0700 (PDT) Received: by 10.76.5.201 with HTTP; Wed, 22 Aug 2012 11:53:54 -0700 (PDT) In-Reply-To: <201208221942.41151.marex@denx.de> References: <1345601849-23474-1-git-send-email-marex@denx.de> <1345601849-23474-2-git-send-email-marex@denx.de> <201208221942.41151.marex@denx.de> Date: Wed, 22 Aug 2012 15:53:54 -0300 Message-ID: From: Fabio Estevam To: Marek Vasut Cc: u-boot@lists.denx.de Subject: Re: [U-Boot] [PATCH 2/5] MX28: DMA: Prolong the DMA timeout 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 Wed, Aug 22, 2012 at 2:42 PM, Marek Vasut wrote: > Dear Fabio Estevam, > >> On Tue, Aug 21, 2012 at 11:17 PM, Marek Vasut wrote: >> > int mxs_dma_go(int chan) >> > { >> > >> > - uint32_t timeout = 10000; >> > + uint32_t timeout = 10000000; >> >> Should we use a proper timeout mechanism instead? > > What would that be? I think 10 seconds is more than plenty for now. Ok, but we need to change to unsigned int to be able to fit 10000000: Regards, Fabio Estevam --- a/arch/arm/cpu/arm926ejs/mxs/mxs.c +++ b/arch/arm/cpu/arm926ejs/mxs/mxs.c @@ -81,7 +81,8 @@ void enable_caches(void) #endif } -int mxs_wait_mask_set(struct mxs_register_32 *reg, uint32_t mask, int timeout) +int mxs_wait_mask_set(struct mxs_register_32 *reg, uint32_t mask, unsigned + int timeout) { while (--timeout) { if ((readl(®->reg) & mask) == mask) @@ -92,7 +93,8 @@ int mxs_wait_mask_set(struct mxs_register_32 *reg, uint32_t ma return !timeout; } -int mxs_wait_mask_clr(struct mxs_register_32 *reg, uint32_t mask, int timeout) +int mxs_wait_mask_clr(struct mxs_register_32 *reg, uint32_t mask, unsigned + int timeout) { while (--timeout) { if ((readl(®->reg) & mask) == 0) diff --git a/arch/arm/include/asm/arch-mxs/sys_proto.h b/arch/arm/include/asm/ar index 4610363..983b888 100644 --- a/arch/arm/include/asm/arch-mxs/sys_proto.h +++ b/arch/arm/include/asm/arch-mxs/sys_proto.h @@ -26,10 +26,10 @@ int mxs_reset_block(struct mxs_register_32 *reg); int mxs_wait_mask_set(struct mxs_register_32 *reg, uint32_t mask, - int timeout); + unsigned int timeout); int mxs_wait_mask_clr(struct mxs_register_32 *reg, uint32_t mask, - int timeout); + unsigned int timeout); int mxsmmc_initialize(bd_t *bis, int id, int (*wp)(int));