Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Cortex-A9 delay() shorten rarely



Hi,

On 2015/08/10 19:34, Kengo NAKAHARA wrote:
> I am testing NetBSD on Cortex-A9 development board. I found delay()
> shorten rarely.
> 
> I found below patch fix this issue.
> ====================
> diff --git a/sys/arch/arm/arm32/cortex_pmc.c b/sys/arch/arm/arm32/cortex_pmc.c
> index 277c272..16c9cc6 100644
> --- a/sys/arch/arm/arm32/cortex_pmc.c
> +++ b/sys/arch/arm/arm32/cortex_pmc.c
> @@ -103,7 +103,7 @@ delay(u_int arg)
>                 if (ctrl & CORTEX_CNTOFL_C) {
>                   /* Reset overflow flag for cycle counter in overflow register */
>                         armreg_pmovsr_write(CORTEX_CNTOFL_C);
> -                       delta += (last + (counts_per_wrap - cur));
> +                       delta += (cur + (counts_per_wrap - last));
>                 } else {
>                         delta += (cur - last);
>                 }
> ====================
> 
> Could you comment this patch?
> If there is no objection, I will commit this patch after a few days.

I committed this patch.


Thanks,

-- 
//////////////////////////////////////////////////////////////////////
Internet Initiative Japan Inc.

Device Engineering Section,
Core Product Development Department,
Product Division,
Technology Unit

Kengo NAKAHARA <k-nakahara%iij.ad.jp@localhost>



Home | Main Index | Thread Index | Old Index