This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Process going in un-interruptible sleep when polling on internal ADC channel of am335x

Hi,

In my application, I am polling on AM335x internal ADC channel 5,6 every second.

All I do is simply open fd on following and read every second

/sys/bus/iio/devices/iio:device0/in_voltage5_raw
/sys/bus/iio/devices/iio:device0/in_voltage6_raw

I observed that some times my application goes in un-interruptible sleep. top commands reports state of my application as 'D'.

Upon further debugging, I found that application is stuck because of following kernel function

cat /proc/<pid>/wchan
am335x_tsc_se_set_once

am335x_tsc_se_set_once() is defined in drivers/mfd/ti_am335x_tsadc.c

So I have to 2 concerns here:

1) What wrong am I doing in my implementation ? What is the recommended way of polling on internal ADC channels from user space

2) I am not using AM335x TSC. How can I decouple TSC with normal ADC ? I have following in my dts

tscadc: tscadc@44e0d000 {
	compatible = "ti,am3359-tscadc";
	reg = <0x44e0d000 0x1000>;
	interrupt-parent = <&intc>;
	interrupts = <16>;
	ti,hwmods = "adc_tsc";
	status = "okay";

	tsc {
		compatible = "ti,am3359-tsc";
	};
	am335x_adc: adc {
		#io-channel-cells = <1>;
		compatible = "ti,am3359-adc";
		ti,adc-channels = <0 1 2 3 4 5 6 7>;
	};
};

Is there a way of using only adc without tsc ?

thanks

Ankur