Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752296AbdIXMKd (ORCPT ); Sun, 24 Sep 2017 08:10:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:36166 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751987AbdIXMKb (ORCPT ); Sun, 24 Sep 2017 08:10:31 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 94E57218B3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=jic23@kernel.org Date: Sun, 24 Sep 2017 13:10:27 +0100 From: Jonathan Cameron To: Fabrice Gasnier Cc: , , , , , , , , , Subject: Re: [PATCH 2/3] iio: trigger: stm32-timer: fix a corner case to write preset Message-ID: <20170924131027.2d6c5d90@archlinux> In-Reply-To: <1505729132-1369-3-git-send-email-fabrice.gasnier@st.com> References: <1505729132-1369-1-git-send-email-fabrice.gasnier@st.com> <1505729132-1369-3-git-send-email-fabrice.gasnier@st.com> X-Mailer: Claws Mail 3.15.1-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1217 Lines: 34 On Mon, 18 Sep 2017 12:05:31 +0200 Fabrice Gasnier wrote: > Balance timer start routine that sets ARPE: clear it in stop routine. > This fixes a corner case, when timer is used successively as trigger > (with sampling_frequency start/stop routines), then as a counter > (with preset). > > Fixes: 93fbe91b5521 ("iio: Add STM32 timer trigger driver") > > Signed-off-by: Fabrice Gasnier Applied to the fixes-togreg-post-rc1 branch of iio.git and marked for stable. Thanks, Jonathan > --- > drivers/iio/trigger/stm32-timer-trigger.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/iio/trigger/stm32-timer-trigger.c b/drivers/iio/trigger/stm32-timer-trigger.c > index 34cc25b..eb212f8c 100644 > --- a/drivers/iio/trigger/stm32-timer-trigger.c > +++ b/drivers/iio/trigger/stm32-timer-trigger.c > @@ -174,6 +174,7 @@ static void stm32_timer_stop(struct stm32_timer_trigger *priv) > clk_disable(priv->clk); > > /* Stop timer */ > + regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_ARPE, 0); > regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN, 0); > regmap_write(priv->regmap, TIM_PSC, 0); > regmap_write(priv->regmap, TIM_ARR, 0);