analogdevicesinc / libiio

A cross platform library for interfacing with local and remote Linux IIO devices
http://analogdevicesinc.github.io/libiio/
GNU Lesser General Public License v2.1
471 stars 309 forks source link

iio_info -S triggers "musb_bus_suspend 2527: trying to suspend as a_wait_vrise while active" on arm64 A64-Olinuxino #1134

Open ilario opened 5 months ago

ilario commented 5 months ago

Initially reported here: https://www.olimex.com/forum/index.php?topic=9350.0

I tested this on an ARM64 A64-OLinuXino-2Ge8G-IND running Debian Bullseye (oldstable, kernel 5.10.180-olimex) installing libiio-utils 0.21 and confirmed compiling a minimal version of libiio v1 from the main branch compiled today at 1af94f2 (still running it on Debian oldstable).

What happens is that if I run iio_info -S I get the logs flooded with messages like:

musb_bus_suspend 2527: trying to suspend as a_wait_vrise while active

even if the output of the command looks good. Due to the udev rule defined in this file, https://github.com/analogdevicesinc/libiio/blob/d397c403d684b786444e2d1b8b5f28155fcc45a8/libiio.rules.cmakein, the flooding starts at each boot, with a pace of thousands of identical error messages per second, quickly filling the SD card memory. In this case, the error message looks like this:

musb_bus_suspend 2528: trying to suspend as a_wait_bcon while active

and the error refers to this line: https://github.com/torvalds/linux/blob/41bccc98fb7931d63d03f326a746ac4d429c1dd3/drivers/usb/musb/musb_host.c#L2527-L2530

No idea if this is a bug on the MUSB driver side or on the iio_info -S side.

If you guide me, I can run more tests. Up to now, what I did was: clone this repository, build with

# mkdir build
# cd build
# cmake ../ -DCCP_BINDINGS=OFF -DPYTHON_BINDINGS=OFF -DWITH_USB_BACKEND=ON -DWITH_AIO=OFF -DWITH_XML_BACKEND=ON -DHAVE_DNS_SD=OFF -DWITH_HWMON=OFF -DWITH_NETWORK_BACKEND=OFF -DENABLE_IPV6=OFF -DWITH_ZSTD=OFF -DWITH_LOCAL_MMAP_API=OFF -DWITH_LOCAL_DMABUF_API=OFF -DWITH_IIOD_V0_COMPAT=OFF -DWITH_LOCAL_BACKEND=OFF -DWITH_IIOD=OFF
# make
# make install
# iio_info -S
No IIO context found.
# dmesg | tail
[  874.146356] musb_bus_suspend 2528: trying to suspend as a_wait_vrise while active
[  874.146426] musb_bus_suspend 2528: trying to suspend as a_wait_vrise while active
[  874.146480] musb_bus_suspend 2528: trying to suspend as a_wait_vrise while active
[  874.146533] musb_bus_suspend 2528: trying to suspend as a_wait_vrise while active
[  874.146589] musb_bus_suspend 2528: trying to suspend as a_wait_vrise while active
[  874.146641] musb_bus_suspend 2528: trying to suspend as a_wait_vrise while active
[  874.146694] musb_bus_suspend 2528: trying to suspend as a_wait_vrise while active
[  874.146750] musb_bus_suspend 2528: trying to suspend as a_wait_vrise while active
[  874.146802] musb_bus_suspend 2528: trying to suspend as a_wait_vrise while active
[  874.146855] musb_bus_suspend 2528: trying to suspend as a_wait_vrise while active
pcercuei commented 5 months ago

Hi @ilario,

Libiio just uses libusb, if it triggers issues like that, it's definitely a kernel driver issue. Maybe try with a newer kernel if you have the possibility.