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  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]
Date:	Thu, 20 Mar 2014 17:34:09 +0100
From:	Boris BREZILLON <b.brezillon.dev@...il.com>
To:	Alexandre Belloni <alexandre.belloni@...e-electrons.com>,
	Nicolas Ferre <nicolas.ferre@...el.com>
CC:	Jean-Christophe Plagniol-Villard <plagnioj@...osoft.com>,
	linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH] ARM: at91: panic when the mck rate is zero

Le 20/03/2014 17:14, Alexandre Belloni a écrit :
> If the mck rate is zero, we'll hit the following warning:
>
> WARNING: CPU: 0 PID: 0 at arch/arm/mach-at91/at91sam926x_time.c:257 at91sam926x_pit_init+0x13c/0x260()
>
> But the kernel will continue to try booting and face a lot of divisions by zero
> when trying to handle the various clocks.
>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@...e-electrons.com>
> ---
>   arch/arm/mach-at91/at91sam926x_time.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/arch/arm/mach-at91/at91sam926x_time.c b/arch/arm/mach-at91/at91sam926x_time.c
> index 0f04ffe9c5a8..f060f6371392 100644
> --- a/arch/arm/mach-at91/at91sam926x_time.c
> +++ b/arch/arm/mach-at91/at91sam926x_time.c
> @@ -250,6 +250,8 @@ void __init at91sam926x_pit_init(void)
>   	if (IS_ERR(mck))
>   		panic("AT91: PIT: Unable to get mck clk\n");
>   	pit_rate = clk_get_rate(mck) / 16;
> +	if (pit_rate == 0)
> +		panic("AT91: PIT: can't continue, mck rate is zero\n");
You're testing pit_rate why not printing:

"AT91: PIT: can't continue, *pit* rate is zero\n"


Otherwise,

Acked-by: Boris BREZILLON <b.brezillon.dev@...il.com>
>   	pit_cycle = (pit_rate + HZ/2) / HZ;
>   	WARN_ON(((pit_cycle - 1) & ~AT91_PIT_PIV) != 0);
>   

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