[Letux-kernel] accelerometer bridge madness

Andreas Kemnade andreas at kemnade.info
Fri Jul 27 21:49:23 CEST 2018


On Fri, 27 Jul 2018 21:40:10 +0200
"H. Nikolaus Schaller" <hns at goldelico.com> wrote:

> > Am 27.07.2018 um 19:49 schrieb Andreas Kemnade <andreas at kemnade.info>:
> > 
> > On Fri, 27 Jul 2018 19:19:43 +0200
> > "H. Nikolaus Schaller" <hns at goldelico.com> wrote:
> >   
> >>> Am 27.07.2018 um 19:08 schrieb H. Nikolaus Schaller <hns at goldelico.com>:
> >>> 
> >>> Hi,
> >>>   
> >>>> Am 27.07.2018 um 18:49 schrieb Andreas Kemnade <andreas at kemnade.info>:
> >>>> 
> >>>> Hi,
> >>>> 
> >>>> On Fri, 27 Jul 2018 16:58:08 +0200
> >>>> "H. Nikolaus Schaller" <hns at goldelico.com> wrote:
> >>>>   
> >>>>>> 
> >>>>>> But I will first check how often open() is called.  
> >>>>> 
> >>>>> Yes, that is the important thing. And when it is called. You might add some
> >>>>> printk to the probe function to identify the sequence.
> >>>>>   
> >>>> only one time! I moved away that /lib/udev/accelerometer thing
> >>>> and did xxd /dev/input/eventX after the boot fully finished.
> >>>> No accel_open() caused by udev anymore!
> >>>> So this is definitively not a race condition regarding the work struct
> >>>> (but of course that should be fixed).
> >>>> 
> >>>> I tested
> >>>> diff --git a/drivers/iio/industrialio-inputbridge.c b/drivers/iio/industrialio-inputbridge.c
> >>>> index bd5807f31767..77bd9bb352f7 100644
> >>>> --- a/drivers/iio/industrialio-inputbridge.c
> >>>> +++ b/drivers/iio/industrialio-inputbridge.c
> >>>> @@ -89,7 +89,7 @@ static int accel_open(struct input_dev *input)
> >>>> {
> >>>>      struct iio_dev *iiodev = input_get_drvdata(input);
> >>>> 
> >>>> -#if 0
> >>>> +#if 1
> >>>> printk("accel_open()\n");
> >>>> #endif
> >>>> 
> >>>> @@ -98,7 +98,7 @@ printk("accel_open()\n");
> >>>> 
> >>>> #if POLLING
> >>>>      schedule_delayed_work(&input_work,
> >>>> -               msecs_to_jiffies(0));   // start now
> >>>> +               msecs_to_jiffies(100)); // start now
> >>>> #else
> >>>>      int iio_channel_start_all_cb(struct iio_cb_buffer *cb_buff);
> >>>> #endif
> >>>> 
> >>>> 
> >>>> having the 100 there at least causes at least the cpu usage to be sane.  
> >>> 
> >>> Ah, that could be part of the problem.
> >>> 
> >>> I have studied https://github.com/lu-zero/udev/blob/master/src/accelerometer/accelerometer.c
> >>> again and it looks as if it can even be called from the command-line...  
> >> 
> >> I tried to cross-check if that is the real source code. It is.
> >> 
> >> I have found it here:
> >> 
> >> 	https://packages.debian.org/wheezy/udev
> >>   
> >> => download the source from  
> >> 
> >> 	http://http.debian.net/debian/pool/main/u/udev/udev_175.orig.tar.bz2
> >>   
> >> => and navigate to udev-175/extras/accelerometer)  
> >> 
> >> Interestingly, /lib/udev/accelerometer only exists in Wheezy! Not in Jessie or Stretch. Or did I miss something?
> >>   
> > wrong,
> > udev is part of systemd on jessie.  
> 
> Well, I have a jessie with no systemd. But still the tool exists.

Well, the udev package is build from systemd sources, so even if you
have no systemd installed, you still have the udev from systemd.

Just to know if we want to understand and analyze udev problems in
future.

Regards,
Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.goldelico.com/pipermail/letux-kernel/attachments/20180727/f1f91f2c/attachment.asc>


More information about the Letux-kernel mailing list