mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 5/8] clocksource: allow to have multiple device from clock source
Date: Tue, 28 Feb 2017 08:09:01 +0100	[thread overview]
Message-ID: <20170228070901.gbkwxlh772plqi4e@pengutronix.de> (raw)
In-Reply-To: <1488190770-4034-5-git-send-email-plagnioj@jcrosoft.com>

On Mon, Feb 27, 2017 at 11:19:27AM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> use the one with the most priority.
> 
> We can not select the clocksource at user level.
> 
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> ---
>  common/clock.c  | 11 +++++++++++
>  include/clock.h |  3 ++-
>  2 files changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/common/clock.c b/common/clock.c
> index 2c5dd91cc..d99d06853 100644
> --- a/common/clock.c
> +++ b/common/clock.c
> @@ -213,6 +213,17 @@ EXPORT_SYMBOL(mdelay_non_interruptible);
>  
>  int init_clock(struct clocksource *cs)
>  {
> +	if (current_clock && cs->priority < current_clock->priority)
> +		return -EBUSY;

You should return successfully here. Otherwise driver probe functions
return -EBUSY for something which is not the drivers fault. In fact,
it's not an error, it's just that we currently don't have any use for an
additional clock. Also consider testing for <= current_clock->priority
instead of <. All current clocks have priority 0 and we want to
initialize only the first one.

Sascha

-- 
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-02-28  7:09 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-27 10:14 [PATCH 0/8] add generic EFI timer Jean-Christophe PLAGNIOL-VILLARD
2017-02-27 10:19 ` [PATCH 1/8] efi: add prototype and definition for creating and closing event Jean-Christophe PLAGNIOL-VILLARD
2017-02-27 10:19   ` [PATCH 2/8] efi: add prototype and definition for setting timer Jean-Christophe PLAGNIOL-VILLARD
2017-02-27 10:19   ` [PATCH 3/8] efi: move LoaderTimeInitUSec and LoaderDevicePartUUID to postcore initcall Jean-Christophe PLAGNIOL-VILLARD
2017-02-27 10:19   ` [PATCH 4/8] efi: move x86 clocksource init at core initcall level Jean-Christophe PLAGNIOL-VILLARD
2017-02-27 10:19   ` [PATCH 5/8] clocksource: allow to have multiple device from clock source Jean-Christophe PLAGNIOL-VILLARD
2017-02-28  7:09     ` Sascha Hauer [this message]
2017-03-01 15:52       ` Jean-Christophe PLAGNIOL-VILLARD
2017-03-02  7:36         ` Sascha Hauer
2017-02-27 10:19   ` [PATCH 6/8] efi: move x86 clocksource to device/driver Jean-Christophe PLAGNIOL-VILLARD
2017-02-27 10:19   ` [PATCH 7/8] efi: clocksoure: use event for timer Jean-Christophe PLAGNIOL-VILLARD
2017-03-13 10:30     ` Michael Olbrich
2017-03-13 10:52       ` Jean-Christophe PLAGNIOL-VILLARD
2017-03-13 13:16         ` [PATCH] fixup! efi: clocksoure: add EFI event timer Michael Olbrich
2017-03-13 15:55           ` Jean-Christophe PLAGNIOL-VILLARD
2017-03-14  7:16           ` Sascha Hauer
2017-02-27 10:19   ` [PATCH 8/8] efi: add veriable to report secure boot support and status Jean-Christophe PLAGNIOL-VILLARD

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=20170228070901.gbkwxlh772plqi4e@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=plagnioj@jcrosoft.com \
    /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