[Letux-kernel] two accelerometers + iio_bridge considered harmful

H. Nikolaus Schaller hns at goldelico.com
Sun Jul 29 08:48:50 CEST 2018


> Am 28.07.2018 um 22:59 schrieb Andreas Kemnade <andreas at kemnade.info>:
> Hi,
> I found out something strange.
> At least in my gta04a5, there are two accelerometers:
> the bmc150 and the bno055.


> Disabling the bmc150-accel-i2c.ko module
> makes the input bridge work reliably, enabling it again, lets it crash
> again.
> Are both populated on every gta04a5?

Yes. We got the BNO055 as a promotion by Bosch Sensortec - but did initially
have no driver.

We got a driver as a quick hack without warranty from its author.

> And then there is another bug:
> rmmod bno055
> makes the bridge disappear
> modprobe bno055
> does not bring it back

That is probably easy to explain: iio_device_unregister_inputbridge()
does not reduce the number of active channels and therefore a new
modprobe thinks it already knows 3 channels.

The input-bridge driver collects the first three accelerometer
values as X, Y, Z - with a slighty weak assumption that they
belong to the same source. This might race if two accelerometer
drivers probe concurrently. Then, channels are mixed up but
it should not fail.

Maybe you can enable

	printk("iio_device_register_inputbridge(): found an accelerometer\n");

	printk("iio_device_register_inputbridge(): process channel %d\n", channel);

and add a printk to iio_device_unregister_inputbridge


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.goldelico.com/pipermail/letux-kernel/attachments/20180729/2e5151f2/attachment.asc>

More information about the Letux-kernel mailing list