arm/187223: omap4 clock frequency computation overflow

Svatopluk Kraus onwahe at gmail.com
Mon Mar 3 15:20:00 UTC 2014


>Number:         187223
>Category:       arm
>Synopsis:       omap4 clock frequency computation overflow
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-arm
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 03 15:20:00 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator:     Svatopluk Kraus
>Release:        FreeBSD  11.0-CURRENT
>Organization:
>Environment:
Pandaboard ES
>Description:
uint32_t is not enough. See patch.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

Index: sys/arm/ti/omap4/omap4_prcm_clks.c
===================================================================
--- sys/arm/ti/omap4/omap4_prcm_clks.c	(revision 262153)
+++ sys/arm/ti/omap4/omap4_prcm_clks.c	(working copy)
@@ -984,13 +984,11 @@
 	pll_mult = ((clksel >> 8) & 0x7ff);
 	pll_div = (clksel & 0x7f) + 1;

-
 	/* Get the system clock freq */
 	omap4_clk_get_sysclk_freq(NULL, &sysclk);

-
 	/* Calculate the MPU freq */
-	mpuclk = (sysclk * pll_mult) / pll_div;
+	mpuclk = ((uint64_t)sysclk * pll_mult) / pll_div;

 	/* Return the value */
 	if (freq)

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-arm mailing list