Date: Mon, 3 Mar 2014 15:14:50 GMT From: Svatopluk Kraus <onwahe@gmail.com> To: freebsd-gnats-submit@FreeBSD.org Subject: arm/187223: omap4 clock frequency computation overflow Message-ID: <201403031514.s23FEoUS083764@cgiserv.freebsd.org> Resent-Message-ID: <201403031520.s23FK0gV088941@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403031514.s23FEoUS083764>