A year ago I posted "Lock-up reading AM335x ADC on 3.14.35 kernel".
Now I'm updating to the 4.4.12 kernel using the latest linux-ti-staging in the meta-ti layer for Yocto builds. I'm again finding problems with ADC lock-ups.
I have two drivers that regularly read ADCs. Plus a third driver that does just one read at start-up. Either one of the drivers running by itself is okay, unless I manually do a read of /sys/bus/iio/devices/iio:device0/in_voltageX_input, after which my driver locks up. My two drivers running together lock up. I am left with a couple of kworker processes stuck in the D state.
I wonder if there may be a similar root cause. But the patch that fixed it in the 3.14.x kernel doesn't seem applicable in the 4.4.x kernel.
I've found it's not so easy to demonstrate the lock-up just on the command line for 4.4.x kernel. It seems that reads through /sys/bus/iio/devices/iio:device0/in_voltageX_input work okay (unlike in the 3.14.x kernel case), but kernel driver reads through the iio_read_channel_processed() function lock up. The function call uses a mutex which the sysfs attribute read doesn't have.
However, when reading from /sys/bus/iio/devices/iio:device0/in_voltageX_input I am seeing occasional "Resource temporarily unavailable" error messages (errno EAGAIN), which is a bug I think which may be related.