lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Sat, 15 Oct 2016 11:55:38 +0900
From:   Masahiro Yamada <yamada.masahiro@...ionext.com>
To:     linux-clk <linux-clk@...r.kernel.org>,
        Stephen Boyd <sboyd@...eaurora.org>,
        Michael Turquette <mturquette@...libre.com>
Cc:     Viresh Kumar <viresh.kumar@...aro.org>, linux-pm@...r.kernel.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: [problem on 32-bit systems] changing the type of clk_rate to "long long"?

Hi.


When I was testing my clk driver + generic cpufreq driver,
I was hit by a problem.


Everything worked fine on my 64-bit SoCs,
but not on 32-bit SoCs.


I found the cause of the problem was
that the type of clk_rate is "long".

It is long enough on 64-bit systems,
but only 32-bit wide on 32-bit systems.


The CPU clocks on my SoCs
are derived from a 2.4GHz PLL.


The .round_rate() callback tries to return 2400000000,
but it does not fit in a signed 32-bit-wide variable
and it is treated as -1894967296, which is an error.


In order to handle clock frequency safely,
shall we use "long long" instead?
(It is guaranteed to have 64-bit width)



-- 
Best Regards
Masahiro Yamada

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ