mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Michael Olbrich <m.olbrich@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] efi: clocksoure: make sure the meassured frequency is valid
Date: Wed, 15 Mar 2017 08:27:26 +0100	[thread overview]
Message-ID: <20170315072726.hyiabusdgl4jludz@pengutronix.de> (raw)
In-Reply-To: <20170314093729.27803-1-m.olbrich@pengutronix.de>

On Tue, Mar 14, 2017 at 10:37:29AM +0100, Michael Olbrich wrote:
> Some EFI implementations have a even slower tick rate and the meassured
> frequency may be zero.
> 
> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
> Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> ---
>  drivers/clocksource/efi.c | 4 ++++
>  1 file changed, 4 insertions(+)

Applied, thanks

Sascha

> 
> diff --git a/drivers/clocksource/efi.c b/drivers/clocksource/efi.c
> index 89906c452eb7..fb5b7ca63de9 100644
> --- a/drivers/clocksource/efi.c
> +++ b/drivers/clocksource/efi.c
> @@ -71,6 +71,10 @@ static int efi_cs_init(struct clocksource *cs)
>  		uint64_t nb_100ns;
>  
>  		freq = ticks_freq_x86();
> +		if (freq == 0) {
> +			BS->close_event(efi_cs_evt);
> +			return -ENODEV;
> +		}
>  		nb_100ns = 10 * 1000 * 1000 / freq;
>  		pr_warn("EFI Event timer too slow freq = %llu Hz\n", freq);
>  		efiret = BS->set_timer(efi_cs_evt, EFI_TIMER_PERIODIC, nb_100ns);
> -- 
> 2.11.0
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2017-03-15  7:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-14  9:37 Michael Olbrich
2017-03-15  7:27 ` Sascha Hauer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170315072726.hyiabusdgl4jludz@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=m.olbrich@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox