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>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 19 Oct 2015 16:53:11 +0100
From:	Russell King - ARM Linux <linux@....linux.org.uk>
To:	Michael Turquette <mturquette@...libre.com>
Cc:	Viresh Kumar <viresh.kumar@...aro.org>,
	Arnd Bergmann <arnd@...db.de>, Nishanth Menon <nm@...com>,
	Len Brown <len.brown@...el.com>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	linux-pm@...r.kernel.org, Stephen Boyd <sboyd@...eaurora.org>,
	linux-kernel@...r.kernel.org,
	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	Pavel Machek <pavel@....cz>,
	Dmitry Torokhov <dtor@...omium.org>,
	linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH] PM / OPP: fix debugfs files for 64-bit

On Mon, Oct 19, 2015 at 08:40:09AM -0700, Michael Turquette wrote:
> Quoting Viresh Kumar (2015-10-08 00:48:28)
> > On 07-10-15, 21:12, Arnd Bergmann wrote:
> > > I think it clearly makes sense to have a fixed length for each of these
> > > members:
> > >
> > > either 32 bit is enough to represent all possible values, then
> > > there is no need to make them 'long' on 64-bit architectures, or 32 bit
> > > is not enough and then the code is broken on 32-bit architectures today
> > > and should be fixed.
> > 
> > I agree.
> > 
> > But I am not 100% sure why it was done this way to start with.
> > Probably this is the logic behind that:
> > - Max clock rate supported by a u32 is ~ 4.295 GHz

The limit is actually half that when you consider clk_round_rate()
returns a long, because clk_round_rate() needs to be able to return
errors.

The use of long and unsigned long was done in the knowledge that it'd
restrict to 2GHz the upper limit, partially because 64-bit math on
32-bit systems is inefficient and expensive, and I initially wanted
people to use the thing, so it had to be lean and fast.  (If I'd
started out with something as complex as the CCF, it would've been
laughed out as being "far too complex" and "we don't need this").

It also started out as a way to convey clock information to drivers
for peripherals, which commonly don't need clocks up in the GHz range,
indeed, it was rare at that time the API was designed for peripheral
clocks to be much above 100MHz.

-- 
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ