Comment # 65 on bug 907393 from
Working around a slow down on an accelerometer by disabling it through a script
is not ideal because:

a) You are disabling it
b) Scripts change as the distribution evolves

The described device, the LIS3LV02DL accelerometer, seems to have a respective
device driver, the "STMicroelectronics accelerometers 3-Axis Driver" enabled
via IIO_ST_ACCEL_3AXIS which is the st_accel device driver. If this device
driver is taking long and you want to enable it and avoid this long delay on
boot, one way is to enable asynchronous probe one the device driver, its
exactly what another vendor used to help avoid delay on boots on some device
drivers. Asynchronous probe is now upstream. I've described how this
functionality came about and future prospects for us here:

http://www.do-not-panic.com/2015/12/linux-asynchronous-probe.html

Can someone confirm if the st_accel device driver is what takes for ever to
load? Also did disabling the udev script disable loading the driver? If not
what did it exactly do to help?

Seems this driver has an i2c and spi interface:

drivers/iio/accel/st_accel_i2c.c:       err = st_accel_common_probe(indio_dev);
drivers/iio/accel/st_accel_spi.c:       err = st_accel_common_probe(indio_dev);

The LIS3LV02DL device seems to be controlled through the i2c bus:

drivers/iio/accel/st_accel_i2c.c:               .data =
LIS3LV02DL_ACCEL_DEV_NAME,

To use async probe we'll need to ensure upstream commit
4355efbd80482a961cae849281a8ef866e53d55c has already been merged on the
Tumbleweed's kernel.

Anyway, if we want to try if this helps we can patch up the kernel as follows:

--- a/drivers/iio/accel/st_accel_i2c.c
+++ b/drivers/iio/accel/st_accel_i2c.c
@@ -134,6 +134,7 @@ static struct i2c_driver st_accel_driver = {
        .driver = {
                .name = "st-accel-i2c",
                .of_match_table = of_match_ptr(st_accel_of_match),
+               .probe_type = PROBE_PREFER_ASYNCHRONOUS,
        },
        .probe = st_accel_i2c_probe,
        .remove = st_accel_i2c_remove,

This would be useful if the issue is just this device and we want to generalize
a solution. If it does help it would be useful to understand later why the
delay occurs for these devices and see if it makes sense to just enable for all
such type of devices. Likewise systemd can now also just make use of the async
probe for all modules provided commit 4355efbd80482a961cae849281a8ef866e53d55c
is merged (or we just wait for the next release that has this fix merged and
use it as of then.


You are receiving this mail because: