Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1186267

Re: [PATCH 3/5] x86/lguest/timer: Migrate to new 'set-state' interface

From Rusty Russell <rusty@rustcorp.com.au>
Newsgroups linux.kernel
Subject Re: [PATCH 3/5] x86/lguest/timer: Migrate to new 'set-state' interface
Date 2015-07-16 23:20 +0200
Message-ID <pMYJs-1Go-25@gated-at.bofh.it> (permalink)
References <pMP3s-4oJ-5@gated-at.bofh.it> <pMP3t-4oJ-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Viresh Kumar <viresh.kumar@linaro.org> writes:
> Migrate lguest driver to the new 'set-state' interface provided by
> clockevents core, the earlier 'set-mode' interface is marked obsolete
> now.
>
> This also enables us to implement callbacks for new states of clockevent
> devices, for example: ONESHOT_STOPPED.
>
> We weren't doing anything while switching modes other than in shutdown
> mode and so those are not implemented.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

Tested-by: Rusty Russell <rusty@rustcorp.com.au>
Acked-by: Rusty Russell <rusty@rustcorp.com.au>

Thanks!
Rusty.

> ---
>  arch/x86/lguest/boot.c | 24 ++++++------------------
>  1 file changed, 6 insertions(+), 18 deletions(-)
>
> diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c
> index f2dc08c003eb..433e5a7dd37f 100644
> --- a/arch/x86/lguest/boot.c
> +++ b/arch/x86/lguest/boot.c
> @@ -985,23 +985,11 @@ static int lguest_clockevent_set_next_event(unsigned long delta,
>  	return 0;
>  }
>  
> -static void lguest_clockevent_set_mode(enum clock_event_mode mode,
> -                                      struct clock_event_device *evt)
> -{
> -	switch (mode) {
> -	case CLOCK_EVT_MODE_UNUSED:
> -	case CLOCK_EVT_MODE_SHUTDOWN:
> -		/* A 0 argument shuts the clock down. */
> -		hcall(LHCALL_SET_CLOCKEVENT, 0, 0, 0, 0);
> -		break;
> -	case CLOCK_EVT_MODE_ONESHOT:
> -		/* This is what we expect. */
> -		break;
> -	case CLOCK_EVT_MODE_PERIODIC:
> -		BUG();
> -	case CLOCK_EVT_MODE_RESUME:
> -		break;
> -	}
> +static int lguest_clockevent_shutdown(struct clock_event_device *evt)
> +{
> +	/* A 0 argument shuts the clock down. */
> +	hcall(LHCALL_SET_CLOCKEVENT, 0, 0, 0, 0);
> +	return 0;
>  }
>  
>  /* This describes our primitive timer chip. */
> @@ -1009,7 +997,7 @@ static struct clock_event_device lguest_clockevent = {
>  	.name                   = "lguest",
>  	.features               = CLOCK_EVT_FEAT_ONESHOT,
>  	.set_next_event         = lguest_clockevent_set_next_event,
> -	.set_mode               = lguest_clockevent_set_mode,
> +	.set_state_shutdown	= lguest_clockevent_shutdown,
>  	.rating                 = INT_MAX,
>  	.mult                   = 1,
>  	.shift                  = 0,
> -- 
> 2.4.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/5] X86: Migrate clockevent drivers to 'set-state' interface Viresh Kumar <viresh.kumar@linaro.org> - 2015-07-16 13:00 +0200
  [PATCH 1/5] x86/apic: Migrate to new 'set-state' interface Viresh Kumar <viresh.kumar@linaro.org> - 2015-07-16 13:00 +0200
  [PATCH 5/5] x86/xen/time: Migrate to new 'set-state' interface Viresh Kumar <viresh.kumar@linaro.org> - 2015-07-16 13:00 +0200
  [PATCH 3/5] x86/lguest/timer: Migrate to new 'set-state' interface Viresh Kumar <viresh.kumar@linaro.org> - 2015-07-16 13:00 +0200
    Re: [PATCH 3/5] x86/lguest/timer: Migrate to new 'set-state' interface Rusty Russell <rusty@rustcorp.com.au> - 2015-07-16 23:20 +0200
  [PATCH 2/5] x86/hpet: Migrate to new 'set-state' interface Viresh Kumar <viresh.kumar@linaro.org> - 2015-07-16 13:00 +0200
  [PATCH 4/5] x86/uv/time: Migrate to new 'set-state' interface Viresh Kumar <viresh.kumar@linaro.org> - 2015-07-16 13:00 +0200

csiph-web