[U-Boot] [PATCH 2/5] MX28: DMA: Prolong the DMA timeout
Marek Vasut
marek.vasut at gmail.com
Wed Aug 22 21:55:43 CEST 2012
Dear Fabio Estevam,
> On Wed, Aug 22, 2012 at 2:42 PM, Marek Vasut <marek.vasut at gmail.com> wrote:
> > Dear Fabio Estevam,
> >
> >> On Tue, Aug 21, 2012 at 11:17 PM, Marek Vasut <marex at denx.de> 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
More information about the U-Boot
mailing list