From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754755AbbGCLNw (ORCPT ); Fri, 3 Jul 2015 07:13:52 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:52065 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754840AbbGCLNo (ORCPT ); Fri, 3 Jul 2015 07:13:44 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: Fri, 03 Jul 2015 13:11:04 +0200 From: Stefan Agner To: Viresh Kumar Cc: Thomas Gleixner , Daniel Lezcano , linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Jingchang Lu , Shawn Guo Subject: Re: [PATCH 39/41] clocksource: vf_pit: Migrate to new 'set-state' interface In-Reply-To: <20150703085749.GE23297@linux> References: <19859bd18fb69fa1f10c07de01b2259d@agner.ch> <20150703085749.GE23297@linux> Message-ID: <6a6d4ec3156cb00537ed632f60430a37@agner.ch> User-Agent: Roundcube Webmail/1.1.2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2015-07-03 10:57, Viresh Kumar wrote: > On 03-07-15, 10:10, Stefan Agner wrote: >> > .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, >> > - .set_mode = pit_set_mode, >> > + .set_state_shutdown = pit_shutdown, >> > + .set_state_periodic = pit_set_periodic, >> >> I'm not really familiar with the interface, but given that we announce >> the feature CLOCK_EVT_FEAT_ONESHOT shouldn't we add a set_state_oneshot >> callback here? > > We weren't doing anything in pit_set_mode(ONESHOT) and so that > callback is not implemented. In case you need to do something in > set_state_oneshot(), we can add it back. True, weren't doing anything. I wonder if that is right. Afaik, we should set the same timer for oneshot too, hence call pit_set_next_event. With your change we can just reuse the same function (pit_set_periodic) for set_state_oneshot. To maintain the atomicity of the changes, this would need to be fixed in a separate patch anyway. So this change looks good to me: Acked-by: Stefan Agner I guess "clockevents: Allow set-state callbacks to be optional" makes it before this patch? Otherwise we would call a null pointer... -- Stefan From mboxrd@z Thu Jan 1 00:00:00 1970 From: stefan@agner.ch (Stefan Agner) Date: Fri, 03 Jul 2015 13:11:04 +0200 Subject: [PATCH 39/41] clocksource: vf_pit: Migrate to new 'set-state' interface In-Reply-To: <20150703085749.GE23297@linux> References: <19859bd18fb69fa1f10c07de01b2259d@agner.ch> <20150703085749.GE23297@linux> Message-ID: <6a6d4ec3156cb00537ed632f60430a37@agner.ch> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 2015-07-03 10:57, Viresh Kumar wrote: > On 03-07-15, 10:10, Stefan Agner wrote: >> > .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, >> > - .set_mode = pit_set_mode, >> > + .set_state_shutdown = pit_shutdown, >> > + .set_state_periodic = pit_set_periodic, >> >> I'm not really familiar with the interface, but given that we announce >> the feature CLOCK_EVT_FEAT_ONESHOT shouldn't we add a set_state_oneshot >> callback here? > > We weren't doing anything in pit_set_mode(ONESHOT) and so that > callback is not implemented. In case you need to do something in > set_state_oneshot(), we can add it back. True, weren't doing anything. I wonder if that is right. Afaik, we should set the same timer for oneshot too, hence call pit_set_next_event. With your change we can just reuse the same function (pit_set_periodic) for set_state_oneshot. To maintain the atomicity of the changes, this would need to be fixed in a separate patch anyway. So this change looks good to me: Acked-by: Stefan Agner I guess "clockevents: Allow set-state callbacks to be optional" makes it before this patch? Otherwise we would call a null pointer... -- Stefan