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] [thread-next>] [day] [month] [year] [list]
Message-ID: <5348663.eHVXUR5shS@wuerfel>
Date:	Tue, 15 Jul 2014 11:45:17 +0200
From:	Arnd Bergmann <arnd@...db.de>
To:	Ley Foon Tan <lftan@...era.com>
Cc:	linux-arch@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-doc@...r.kernel.org, lftan.linux@...il.com,
	cltang@...esourcery.com
Subject: Re: [PATCH v2 19/29] nios2: Time keeping

On Tuesday 15 July 2014 16:45:46 Ley Foon Tan wrote:
> +
> +static inline void __delay(unsigned long loops)
> +{
> +	int dummy;
> +
> +	__asm__ __volatile__(
> +	"1:\n\t"
> +	"    beq    %0,zero,2f\n\t"
> +	"    addi   %0, %0, -1\n\t"
> +	"    br     1b\n\t"
> +	"2:\n\t"
> +	:  "=r" (dummy)		/* Need output for optimizer */
> +	:  "0" (loops));	/* %0  Input */
> +}

Do you have a reliable clock source? If you do, it would be better
to replace the delay loop with an implementation that waits for
the exact time to pass instead. This will also avoid the loop
calibration during boot and give you better boot times.

> +#ifndef _ASM_NIOS2_TIMEX_H
> +#define _ASM_NIOS2_TIMEX_H
> +
> +/* Supply dummy tick-rate. Real value will be read from devicetree */
> +#define CLOCK_TICK_RATE		(HZ * 100000UL)
> +
> +#include <asm-generic/timex.h>
> +
> +#endif

CLOCK_TICK_RATE is no longer used anywhere, no need for this file.

> diff --git a/arch/nios2/kernel/time.c b/arch/nios2/kernel/time.c
> new file mode 100644
> index 0000000..111ade1
> --- /dev/null
> +++ b/arch/nios2/kernel/time.c

Maybe move this to drivers/clocksource? Same argument as for the
irqchip driver, so either move both or neither.

	Arnd
--
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