From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751997AbdGQKtX (ORCPT ); Mon, 17 Jul 2017 06:49:23 -0400 Received: from mail-wm0-f50.google.com ([74.125.82.50]:37166 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751704AbdGQKtT (ORCPT ); Mon, 17 Jul 2017 06:49:19 -0400 Date: Mon, 17 Jul 2017 11:49:16 +0100 From: Lee Jones To: Sebastian Reichel Cc: Sebastian Reichel , Support Opensource , Rob Herring , Mark Rutland , Jean Delvare , Guenter Roeck , Dmitry Torokhov , devicetree@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCHv4 1/4] mfd: da9052: fix manual ADC read after timed out read Message-ID: <20170717104916.exhaspyska4okclc@dell> References: <20170630143506.10541-1-sebastian.reichel@collabora.co.uk> <20170630143506.10541-2-sebastian.reichel@collabora.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20170630143506.10541-2-sebastian.reichel@collabora.co.uk> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 30 Jun 2017, Sebastian Reichel wrote: > It is possible that under heavy system load, the counter in the completion > struct, used for waiting for end of AD conversion, gets incremented twice. > To make sure the driver recovers from this situation, the completion struct > should be reinitialized. > > Signed-off-by: Sebastian Reichel > --- > drivers/mfd/da9052-core.c | 2 ++ > 1 file changed, 2 insertions(+) Applied, thanks. > diff --git a/drivers/mfd/da9052-core.c b/drivers/mfd/da9052-core.c > index a88c2065d8ab..977418ca9117 100644 > --- a/drivers/mfd/da9052-core.c > +++ b/drivers/mfd/da9052-core.c > @@ -386,6 +386,8 @@ int da9052_adc_manual_read(struct da9052 *da9052, unsigned char channel) > > mutex_lock(&da9052->auxadc_lock); > > + reinit_completion(&da9052->done); > + > /* Channel gets activated on enabling the Conversion bit */ > mux_sel = chan_mux[channel] | DA9052_ADC_MAN_MAN_CONV; > -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog