From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Wed, 22 Aug 2012 21:55:43 +0200 Subject: [U-Boot] [PATCH 2/5] MX28: DMA: Prolong the DMA timeout In-Reply-To: References: <1345601849-23474-1-git-send-email-marex@denx.de> <201208221942.41151.marex@denx.de> Message-ID: <201208222155.44018.marek.vasut@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Fabio Estevam, > 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: Do we? 10M still fits in ... but it's indeed a good idea, can you submit a patch for that please? > --- 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)); > > Regards, > > Fabio Estevam Best regards, Marek Vasut