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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200214141714.GA30872@Mani-XPS-13-9360>
Date:   Fri, 14 Feb 2020 19:47:14 +0530
From:   Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
To:     Matheus Castello <matheus@...tello.eng.br>
Cc:     afaerber@...e.de, daniel.lezcano@...aro.org, tglx@...utronix.de,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] clocksource: owl: Improve owl_timer_init fail messages

Hi,

Thanks for the patch!

On Fri, Feb 14, 2020 at 03:49:23AM -0300, Matheus Castello wrote:
> Adding error messages, in case of not having a defined clock property
> and in case of an error in clocksource_mmio_init, which may not be
> fatal, so just adding a pr_err to notify that it failed.
> 
> Signed-off-by: Matheus Castello <matheus@...tello.eng.br>
> ---
> 
> Tested on my Caninos Labrador s500 based board. If the clock property is not
> set this message would help debug:
> 
> ...
> [    0.000000] Failed to get OF clock for clocksource
> [    0.000000] Failed to initialize '/soc/timer@...68000': -2
> [    0.000000] timer_probe: no matching timers found
> ...
> 
>  drivers/clocksource/timer-owl.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/clocksource/timer-owl.c b/drivers/clocksource/timer-owl.c
> index 900fe736145d..f53596f9e86c 100644
> --- a/drivers/clocksource/timer-owl.c
> +++ b/drivers/clocksource/timer-owl.c
> @@ -135,8 +135,10 @@ static int __init owl_timer_init(struct device_node *node)
>  	}
> 
>  	clk = of_clk_get(node, 0);
> -	if (IS_ERR(clk))
> +	if (IS_ERR(clk)) {
> +		pr_err("Failed to get OF clock for clocksource\n");

No need to mention OF here. Just, "Failed to get clock for clocksource"
is good enough.

>  		return PTR_ERR(clk);
> +	}
> 
>  	rate = clk_get_rate(clk);
> 
> @@ -144,8 +146,11 @@ static int __init owl_timer_init(struct device_node *node)
>  	owl_timer_set_enabled(owl_clksrc_base, true);
> 
>  	sched_clock_register(owl_timer_sched_read, 32, rate);
> -	clocksource_mmio_init(owl_clksrc_base + OWL_Tx_VAL, node->name,
> -			      rate, 200, 32, clocksource_mmio_readl_up);
> +	ret = clocksource_mmio_init(owl_clksrc_base + OWL_Tx_VAL, node->name,
> +				    rate, 200, 32, clocksource_mmio_readl_up);
> +
> +	if (ret)
> +		pr_err("Failed to register clocksource %d\n", ret);
> 

Do you want to continue if it fails? I'd bail out.

Thanks,
Mani

>  	owl_timer_reset(owl_clkevt_base);
> 
> --
> 2.25.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ