patch "iio: adc: ti_am335x_adc: Increase timeout value waiting for ADC" added to staging-linus
Subsystems (3)
This is a note to let you know that I've just added the patch titled
iio: adc: ti_am335x_adc: Increase timeout value waiting for ADC
to my staging git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
in the staging-linus branch.
The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.
If you have any questions about this process, please let me know.
Quoted 1 line
From
7175cce1c3f1d8c8840d2004f78f96a3904249b5Mon Sep 17 00:00:00 2001
From: Vignesh R <[email protected]>
Date: Wed, 17 Aug 2016 17:43:01 +0530
Subject: iio: adc: ti_am335x_adc: Increase timeout value waiting for ADC
sample
Now that open delay and sample delay for each channel is configurable via DT, the default IDLE_TIMEOUT value is not enough as this is calculated based on hardcoded macros. This results in driver returning EBUSY sometimes. Fix this by increasing the timeout
value based on maximum value possible to open delay and sample delays for each channel.
--- drivers/iio/adc/ti_am335x_adc.c | 2 +- include/linux/mfd/ti_am335x_tscadc.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/iio/adc/ti_am335x_adc.c +1 -1
@@ -381,7 +381,7 @@ static int tiadc_read_raw(struct iio_dev *indio_dev,am335x_tsc_se_set_once (adc_dev->mfd_tscadc, step_en); - timeout = jiffies +usecs_to_jiffies + timeout = jiffies +msecs_to_jiffies (IDLE_TIMEOUT * adc_dev->channels);/* Wait for Fifo threshold interrupt */ while (1 ) {
include/linux/mfd/ti_am335x_tscadc.h +4 -4
@@ -138,16 +138,16 @@/* * time in us for processing a single channel, calculated as follows: * -* num cycles = open delay + (sample delay + conv time) * averaging +* max num cycles = open delay + (sample delay + conv time) * averaging * -* num cycles: 152 + (1 + 13) * 16 = 376 +* max num cycles: 262143 + (255 + 13) * 16 = 266431 * * clock frequency: 26MHz / 8 = 3.25MHz * clock period: 1 / 3.25MHz = 308ns * -* processing time: 376 * 308ns = 116us +* max processing time: 266431 * 308ns = 83ms(approx) */ -#define IDLE_TIMEOUT 116/* microsec */ +#define IDLE_TIMEOUT 83/* milliseconds */ #define TSCADC_CELLS 2
Signature · 1 line
2.9.3