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


Groups > linux.kernel > #1674835

[PATCH 1/2] mfd: da9052: fix manual ADC read after timed out read

From Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Newsgroups linux.kernel
Subject [PATCH 1/2] mfd: da9052: fix manual ADC read after timed out read
Date 2017-06-26 16:50 +0200
Message-ID <tWDuW-3Bo-33@gated-at.bofh.it> (permalink)
References <tWDuV-3Bo-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 <sebastian.reichel@collabora.co.uk>
---
 drivers/mfd/da9052-core.c | 2 ++
 1 file changed, 2 insertions(+)

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;
 
-- 
2.11.0

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


Thread

[PATCH 0/2] DA9052 hardware monitoring improvements Sebastian Reichel <sebastian.reichel@collabora.co.uk> - 2017-06-26 16:50 +0200
  [PATCH 2/2] hwmon: da9052: add support for TSI channel Sebastian Reichel <sebastian.reichel@collabora.co.uk> - 2017-06-26 16:50 +0200
    Re: [PATCH 2/2] hwmon: da9052: add support for TSI channel Guenter Roeck <linux@roeck-us.net> - 2017-06-27 01:00 +0200
    RE: [PATCH 2/2] hwmon: da9052: add support for TSI channel Steve Twiss <stwiss.opensource@diasemi.com> - 2017-06-28 20:00 +0200
  [PATCH 1/2] mfd: da9052: fix manual ADC read after timed out read Sebastian Reichel <sebastian.reichel@collabora.co.uk> - 2017-06-26 16:50 +0200

csiph-web