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]
Message-ID: <20150502163659.GA23998@griffinp-ThinkPad-X1-Carbon-2nd>
Date:	Sat, 2 May 2015 17:36:59 +0100
From:	Peter Griffin <peter.griffin@...aro.org>
To:	Thomas Gleixner <tglx@...utronix.de>
Cc:	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
	srinivas.kandagatla@...il.com, maxime.coquelin@...com,
	patrice.chotard@...com, daniel.lezcano@...aro.org,
	lee.jones@...aro.org, devicetree@...r.kernel.org,
	Ajit Pal Singh <ajitpal.singh@...com>
Subject: Re: [PATCH 1/5] clocksource: st_lpc: Add LPC timer as a clocksource.

Hi Thomas,

On Tue, 21 Apr 2015, Thomas Gleixner wrote:

> On Fri, 17 Apr 2015, Peter Griffin wrote:
> > +/* Low Power Timer */
> > +#define LPC_LPT_LSB_OFF		0x400
> > +#define LPC_LPT_MSB_OFF		0x404
> > +#define LPC_LPT_START_OFF	0x408
> > +
> > +struct st_lpc {
> > +	struct clk *clk;
> > +	void __iomem *iomem_cs;
> > +};
> > +
> > +static struct st_lpc *st_lpc;
> > +
> > +static u64 notrace st_lpc_counter_read(void)
> > +{
> > +	u64 counter;
> > +	u32 lower;
> > +	u32 upper, old_upper;
> > +
> > +	upper = readl_relaxed(st_lpc->iomem_cs + LPC_LPT_MSB_OFF);
> > +	do {
> > +		old_upper = upper;
> > +		lower = readl_relaxed(st_lpc->iomem_cs + LPC_LPT_LSB_OFF);
> > +		upper = readl_relaxed(st_lpc->iomem_cs + LPC_LPT_MSB_OFF);
> > +	} while (upper != old_upper);
> > +
> > +	counter = upper;
> > +	counter <<= 32;
> > +	counter |= lower;
> > +	return counter;
> 
> 
> What's the point of this exercise? The kernel can handle 32bit
> clocksources nicely. So why do you want to artificially expand them to
> 64bit by adding useless loops and hoops to a hotpath?

Thanks for reviewing, yes your correct, we don't really need to be
doing this. We will fix this in the v2 version.

Lee Jones has also pointed out something which I was not aware of when
submitting this, and that is this IP has shared registers with the RTC
driver.

He has been working on some patches here https://lkml.org/lkml/2015/4/9/609
which deal with configuring between watchdog and rtc and ensuring only one
can be configured at a time, and this driver should also be making use of
that mechanism.

As he is already working on this, we decided it would be best if he takes
over for the V2 submission, and aligns it with the work he has already done
for this IP.

regards,

Peter.
--
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