2015-12-17 23:38:25

by Nish Aravamudan

[permalink] [raw]
Subject: iio/hid-sensor-accel-3d: no output from /dev/iio:device*?

[Starting a new thread from https://lkml.org/lkml/2015/12/15/663, as
now my laptop is displaying values in the sysfs *raw* files.]

So I'm trying to understand exactly how the hid-sensor-accel-3d driver works.

If I turn up debugging, when I `cat
/sys/bus/iio/devices/device*/*raw*`, I see "iio iio:device3:
accel_3d_proc_event" and I think that means that
hid_sensor_push_data() is getting called.

But read()'s on /dev/iio:device3 never produces anything, which is
what iio-sensor-proxy uses to translate events to dbus.

Is it expected that the dev-node is "silent"? Just trying to
understand if an extension to the driver to support a chardev based
output is appropriate, or if iio-sensor-proxy needs to be changed to
handle this device.

-Nish


2015-12-18 00:52:59

by srinivas pandruvada

[permalink] [raw]
Subject: Re: iio/hid-sensor-accel-3d: no output from /dev/iio:device*?

On Thu, 2015-12-17 at 15:38 -0800, Nish Aravamudan wrote:
> [Starting a new thread from https://lkml.org/lkml/2015/12/15/663, as
> now my laptop is displaying values in the sysfs *raw* files.]
>
> So I'm trying to understand exactly how the hid-sensor-accel-3d
> driver works.
>
> If I turn up debugging, when I `cat
> /sys/bus/iio/devices/device*/*raw*`, I see "iio iio:device3:
> accel_3d_proc_event" and I think that means that
> hid_sensor_push_data() is getting called.
>
> But read()'s on /dev/iio:device3 never produces anything, which is
> what iio-sensor-proxy uses to translate events to dbus.
>
> Is it expected that the dev-node is "silent"? Just trying to
> understand if an extension to the driver to support a chardev based
> output is appropriate, or if iio-sensor-proxy needs to be changed to
> handle this device.

You are saying there is some regression. This used to work and now it
doesn't work. Is raw values are displayed correctly, when you do "cat"?
If cat of raw values is working then power on of sensors is working.

Turn on HID debug prints. If it is regression we can do git bisect.
Any ACPI or PM changes can break this. Usually there will be GPIOs
which will be involved in power on, where ACPI comes into play. This
will be done by i2c-hid. There are some prints in i2c-hid which can be
enabled also.

Thanks,
Srinivas

>
> -Nish

2015-12-18 01:00:36

by Pandruvada, Srinivas

[permalink] [raw]
Subject: Re: iio/hid-sensor-accel-3d: no output from /dev/iio:device*?

Hi Andy,

As per Nish these patches are impacting sensors on Yoga.
https://lkml.org/lkml/2015/11/30/441

Can you help?

Thanks,
Srinivas

On Thu, 2015-12-17 at 16:51 -0800, Srinivas Pandruvada wrote:
> On Thu, 2015-12-17 at 15:38 -0800, Nish Aravamudan wrote:
> > [Starting a new thread from https://lkml.org/lkml/2015/12/15/663,
> > as
> > now my laptop is displaying values in the sysfs *raw* files.]
> >
> > So I'm trying to understand exactly how the hid-sensor-accel-3d
> > driver works.
> >
> > If I turn up debugging, when I `cat
> > /sys/bus/iio/devices/device*/*raw*`, I see "iio iio:device3:
> > accel_3d_proc_event" and I think that means that
> > hid_sensor_push_data() is getting called.
> >
> > But read()'s on /dev/iio:device3 never produces anything, which is
> > what iio-sensor-proxy uses to translate events to dbus.
> >
> > Is it expected that the dev-node is "silent"? Just trying to
> > understand if an extension to the driver to support a chardev based
> > output is appropriate, or if iio-sensor-proxy needs to be changed
> > to
> > handle this device.
>
> You are saying there is some regression. This used to work and now it
> doesn't work. Is raw values are displayed correctly, when you do
> "cat"?
> If cat of raw values is working then power on of sensors is working.
>
> Turn on HID debug prints. If it is regression we can do git bisect.
> Any ACPI or PM changes can break this. Usually there will be GPIOs
> which will be involved in power on, where ACPI comes into play. This
> will be done by i2c-hid. There are some prints in i2c-hid which can
> be
> enabled also.
>
> Thanks,
> Srinivas
>
> > ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?

2015-12-18 01:07:07

by Nish Aravamudan

[permalink] [raw]
Subject: Re: iio/hid-sensor-accel-3d: no output from /dev/iio:device*?

On Thu, Dec 17, 2015 at 4:51 PM, Srinivas Pandruvada
<[email protected]> wrote:
> On Thu, 2015-12-17 at 15:38 -0800, Nish Aravamudan wrote:
>> [Starting a new thread from https://lkml.org/lkml/2015/12/15/663, as
>> now my laptop is displaying values in the sysfs *raw* files.]
>>
>> So I'm trying to understand exactly how the hid-sensor-accel-3d
>> driver works.
>>
>> If I turn up debugging, when I `cat
>> /sys/bus/iio/devices/device*/*raw*`, I see "iio iio:device3:
>> accel_3d_proc_event" and I think that means that
>> hid_sensor_push_data() is getting called.
>>
>> But read()'s on /dev/iio:device3 never produces anything, which is
>> what iio-sensor-proxy uses to translate events to dbus.
>>
>> Is it expected that the dev-node is "silent"? Just trying to
>> understand if an extension to the driver to support a chardev based
>> output is appropriate, or if iio-sensor-proxy needs to be changed to
>> handle this device.
>
> You are saying there is some regression. This used to work and now it
> doesn't work. Is raw values are displayed correctly, when you do "cat"?
> If cat of raw values is working then power on of sensors is working.

Sorry, I was unclear. I don't know if this is a regression. I can try
going back to an older kernel to see if the /dev/iio:device* files
produced any output.

Yes, the *raw* files in sysfs are producing output, that is changing
as I move the laptop around. But the /dev/ nodes seem to produce no
output (I'm still reading through the driver code to understand where
that data should be coming from.

> Turn on HID debug prints. If it is regression we can do git bisect.
> Any ACPI or PM changes can break this. Usually there will be GPIOs
> which will be involved in power on, where ACPI comes into play. This
> will be done by i2c-hid. There are some prints in i2c-hid which can be
> enabled also.

Ok, I will try this, as well.

-Nish

2015-12-18 01:08:43

by Nish Aravamudan

[permalink] [raw]
Subject: Re: iio/hid-sensor-accel-3d: no output from /dev/iio:device*?

On Thu, Dec 17, 2015 at 5:00 PM, Pandruvada, Srinivas
<[email protected]> wrote:
> Hi Andy,
>
> As per Nish these patches are impacting sensors on Yoga.
> https://lkml.org/lkml/2015/11/30/441

To be clear, without that series, the touchpad and touchscreen on the
Yoga 900 don't work at all. So they are necessary for functioning. I
don't know (I will test it now), if removing the series makes the IIO
sensors work properly in /dev/.

-Nish

> On Thu, 2015-12-17 at 16:51 -0800, Srinivas Pandruvada wrote:
>> On Thu, 2015-12-17 at 15:38 -0800, Nish Aravamudan wrote:
>> > [Starting a new thread from https://lkml.org/lkml/2015/12/15/663,
>> > as
>> > now my laptop is displaying values in the sysfs *raw* files.]
>> >
>> > So I'm trying to understand exactly how the hid-sensor-accel-3d
>> > driver works.
>> >
>> > If I turn up debugging, when I `cat
>> > /sys/bus/iio/devices/device*/*raw*`, I see "iio iio:device3:
>> > accel_3d_proc_event" and I think that means that
>> > hid_sensor_push_data() is getting called.
>> >
>> > But read()'s on /dev/iio:device3 never produces anything, which is
>> > what iio-sensor-proxy uses to translate events to dbus.
>> >
>> > Is it expected that the dev-node is "silent"? Just trying to
>> > understand if an extension to the driver to support a chardev based
>> > output is appropriate, or if iio-sensor-proxy needs to be changed
>> > to
>> > handle this device.
>>
>> You are saying there is some regression. This used to work and now it
>> doesn't work. Is raw values are displayed correctly, when you do
>> "cat"?
>> If cat of raw values is working then power on of sensors is working.
>>
>> Turn on HID debug prints. If it is regression we can do git bisect.
>> Any ACPI or PM changes can break this. Usually there will be GPIOs
>> which will be involved in power on, where ACPI comes into play. This
>> will be done by i2c-hid. There are some prints in i2c-hid which can
>> be
>> enabled also.
>>
>> Thanks,
>> Srinivas
>>
>> >

2015-12-18 01:11:07

by Pandruvada, Srinivas

[permalink] [raw]
Subject: Re: iio/hid-sensor-accel-3d: no output from /dev/iio:device*?

On Thu, 2015-12-17 at 17:08 -0800, Nish Aravamudan wrote:
> On Thu, Dec 17, 2015 at 5:00 PM, Pandruvada, Srinivas
> <[email protected]> wrote:
> > Hi Andy,
> >
> > As per Nish these patches are impacting sensors on Yoga.
> > https://lkml.org/lkml/2015/11/30/441
>
> To be clear, without that series, the touchpad and touchscreen on the
> Yoga 900 don't work at all. So they are necessary for functioning. I
> don't know (I will test it now), if removing the series makes the IIO
> sensors work properly in /dev/.
This is important to know before we take Andy's time.

Thanks,
Srinivas

>
> -Nish
>
> > On Thu, 2015-12-17 at 16:51 -0800, Srinivas Pandruvada wrote:
> > > On Thu, 2015-12-17 at 15:38 -0800, Nish Aravamudan wrote:
> > > > [Starting a new thread from
> > > > https://lkml.org/lkml/2015/12/15/663,
> > > > as
> > > > now my laptop is displaying values in the sysfs *raw* files.]
> > > >
> > > > So I'm trying to understand exactly how the hid-sensor-accel-3d
> > > > driver works.
> > > >
> > > > If I turn up debugging, when I `cat
> > > > /sys/bus/iio/devices/device*/*raw*`, I see "iio iio:device3:
> > > > accel_3d_proc_event" and I think that means that
> > > > hid_sensor_push_data() is getting called.
> > > >
> > > > But read()'s on /dev/iio:device3 never produces anything, which
> > > > is
> > > > what iio-sensor-proxy uses to translate events to dbus.
> > > >
> > > > Is it expected that the dev-node is "silent"? Just trying to
> > > > understand if an extension to the driver to support a chardev
> > > > based
> > > > output is appropriate, or if iio-sensor-proxy needs to be
> > > > changed
> > > > to
> > > > handle this device.
> > >
> > > You are saying there is some regression. This used to work and
> > > now it
> > > doesn't work. Is raw values are displayed correctly, when you do
> > > "cat"?
> > > If cat of raw values is working then power on of sensors is
> > > working.
> > >
> > > Turn on HID debug prints. If it is regression we can do git
> > > bisect.
> > > Any ACPI or PM changes can break this. Usually there will be
> > > GPIOs
> > > which will be involved in power on, where ACPI comes into play.
> > > This
> > > will be done by i2c-hid. There are some prints in i2c-hid which
> > > can
> > > be
> > > enabled also.
> > >
> > > Thanks,
> > > Srinivas
> > >
> > > > ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?

2015-12-18 01:18:22

by srinivas pandruvada

[permalink] [raw]
Subject: Re: iio/hid-sensor-accel-3d: no output from /dev/iio:device*?

On Thu, 2015-12-17 at 17:07 -0800, Nish Aravamudan wrote:
> On Thu, Dec 17, 2015 at 4:51 PM, Srinivas Pandruvada
> <[email protected]> wrote:
> > On Thu, 2015-12-17 at 15:38 -0800, Nish Aravamudan wrote:
> > > [Starting a new thread from https://lkml.org/lkml/2015/12/15/663,
> > > as
> > > now my laptop is displaying values in the sysfs *raw* files.]
> > >
> > > So I'm trying to understand exactly how the hid-sensor-accel-3d
> > > driver works.
> > >
> > > If I turn up debugging, when I `cat
> > > /sys/bus/iio/devices/device*/*raw*`, I see "iio iio:device3:
> > > accel_3d_proc_event" and I think that means that
> > > hid_sensor_push_data() is getting called.
> > >
> > > But read()'s on /dev/iio:device3 never produces anything, which
> > > is
> > > what iio-sensor-proxy uses to translate events to dbus.
> > >
> > > Is it expected that the dev-node is "silent"? Just trying to
> > > understand if an extension to the driver to support a chardev
> > > based
> > > output is appropriate, or if iio-sensor-proxy needs to be changed
> > > to
> > > handle this device.
> >
> > You are saying there is some regression. This used to work and now
> > it
> > doesn't work. Is raw values are displayed correctly, when you do
> > "cat"?
> > If cat of raw values is working then power on of sensors is
> > working.
>
> Sorry, I was unclear. I don't know if this is a regression. I can try
> going back to an older kernel to see if the /dev/iio:device* files
> produced any output.
>
> Yes, the *raw* files in sysfs are producing output, that is changing
> as I move the laptop around. But the /dev/ nodes seem to produce no
> output (I'm still reading through the driver code to understand where
> that data should be coming from.
>
> > Turn on HID debug prints. If it is regression we can do git bisect.
> > Any ACPI or PM changes can break this. Usually there will be GPIOs
> > which will be involved in power on, where ACPI comes into play.
> > This
> > will be done by i2c-hid. There are some prints in i2c-hid which can
> > be
> > enabled also.
>
> Ok, I will try this, as well.
>

Try increasing in_accel_sampling_frequency
echo 100 > in_accel_sampling_frequency
Adjust hysteresis to a low value
echo 0 > in_accel_hysteresis
These values are very vendor specific.

Thanks,
Srinivas

> -Nish

2015-12-18 01:59:50

by Nish Aravamudan

[permalink] [raw]
Subject: Re: iio/hid-sensor-accel-3d: no output from /dev/iio:device*?

On Thu, Dec 17, 2015 at 5:16 PM, Srinivas Pandruvada
<[email protected]> wrote:
> On Thu, 2015-12-17 at 17:07 -0800, Nish Aravamudan wrote:
>> On Thu, Dec 17, 2015 at 4:51 PM, Srinivas Pandruvada
>> <[email protected]> wrote:
>> > On Thu, 2015-12-17 at 15:38 -0800, Nish Aravamudan wrote:
>> > > [Starting a new thread from https://lkml.org/lkml/2015/12/15/663,
>> > > as
>> > > now my laptop is displaying values in the sysfs *raw* files.]
>> > >
>> > > So I'm trying to understand exactly how the hid-sensor-accel-3d
>> > > driver works.
>> > >
>> > > If I turn up debugging, when I `cat
>> > > /sys/bus/iio/devices/device*/*raw*`, I see "iio iio:device3:
>> > > accel_3d_proc_event" and I think that means that
>> > > hid_sensor_push_data() is getting called.
>> > >
>> > > But read()'s on /dev/iio:device3 never produces anything, which
>> > > is
>> > > what iio-sensor-proxy uses to translate events to dbus.
>> > >
>> > > Is it expected that the dev-node is "silent"? Just trying to
>> > > understand if an extension to the driver to support a chardev
>> > > based
>> > > output is appropriate, or if iio-sensor-proxy needs to be changed
>> > > to
>> > > handle this device.
>> >
>> > You are saying there is some regression. This used to work and now
>> > it
>> > doesn't work. Is raw values are displayed correctly, when you do
>> > "cat"?
>> > If cat of raw values is working then power on of sensors is
>> > working.
>>
>> Sorry, I was unclear. I don't know if this is a regression. I can try
>> going back to an older kernel to see if the /dev/iio:device* files
>> produced any output.
>>
>> Yes, the *raw* files in sysfs are producing output, that is changing
>> as I move the laptop around. But the /dev/ nodes seem to produce no
>> output (I'm still reading through the driver code to understand where
>> that data should be coming from.
>>
>> > Turn on HID debug prints. If it is regression we can do git bisect.
>> > Any ACPI or PM changes can break this. Usually there will be GPIOs
>> > which will be involved in power on, where ACPI comes into play.
>> > This
>> > will be done by i2c-hid. There are some prints in i2c-hid which can
>> > be
>> > enabled also.
>>
>> Ok, I will try this, as well.
>>
>
> Try increasing in_accel_sampling_frequency
> echo 100 > in_accel_sampling_frequency
> Adjust hysteresis to a low value
> echo 0 > in_accel_hysteresis
> These values are very vendor specific.

Adjusting the values in this way didn't seem to make any difference.
Also, `cat in_accel_hysteresis` gave EINVAL, but I was able to echo 0
to it.

-Nish

2015-12-18 02:33:07

by Nish Aravamudan

[permalink] [raw]
Subject: Re: iio/hid-sensor-accel-3d: no output from /dev/iio:device*?

On Thu, Dec 17, 2015 at 5:11 PM, Pandruvada, Srinivas
<[email protected]> wrote:
> On Thu, 2015-12-17 at 17:08 -0800, Nish Aravamudan wrote:
>> On Thu, Dec 17, 2015 at 5:00 PM, Pandruvada, Srinivas
>> <[email protected]> wrote:
>> > Hi Andy,
>> >
>> > As per Nish these patches are impacting sensors on Yoga.
>> > https://lkml.org/lkml/2015/11/30/441
>>
>> To be clear, without that series, the touchpad and touchscreen on the
>> Yoga 900 don't work at all. So they are necessary for functioning. I
>> don't know (I will test it now), if removing the series makes the IIO
>> sensors work properly in /dev/.
> This is important to know before we take Andy's time.

It seems like Andy's patches are not the problem. That is, with stock
4.4-rc5, the accelerommeter /dev files still do not update.

-Nish

2015-12-18 02:50:56

by Pandruvada, Srinivas

[permalink] [raw]
Subject: Re: iio/hid-sensor-accel-3d: no output from /dev/iio:device*?

On Thu, 2015-12-17 at 18:33 -0800, Nish Aravamudan wrote:
> On Thu, Dec 17, 2015 at 5:11 PM, Pandruvada, Srinivas
> <[email protected]> wrote:
> > On Thu, 2015-12-17 at 17:08 -0800, Nish Aravamudan wrote:
> > > On Thu, Dec 17, 2015 at 5:00 PM, Pandruvada, Srinivas
> > > <[email protected]> wrote:
> > > > Hi Andy,
> > > >
> > > > As per Nish these patches are impacting sensors on Yoga.
> > > > https://lkml.org/lkml/2015/11/30/441
> > >
> > > To be clear, without that series, the touchpad and touchscreen on
> > > the
> > > Yoga 900 don't work at all. So they are necessary for
> > > functioning. I
> > > don't know (I will test it now), if removing the series makes the
> > > IIO
> > > sensors work properly in /dev/.
> > This is important to know before we take Andy's time.
>
> It seems like Andy's patches are not the problem. That is, with stock
> 4.4-rc5, the accelerommeter /dev files still do not update.
>
Can you not use raw values by polling from user space? Send me
report description. It should be in
/sys/kernel/debug/hid/ "your device id" /redesc.

Also device id ("your device id") above.

Thanks,
Srinivas


> -Nish????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?

2015-12-18 03:06:26

by Nish Aravamudan

[permalink] [raw]
Subject: Re: iio/hid-sensor-accel-3d: no output from /dev/iio:device*?

On Thu, Dec 17, 2015 at 6:50 PM, Pandruvada, Srinivas
<[email protected]> wrote:
> On Thu, 2015-12-17 at 18:33 -0800, Nish Aravamudan wrote:
>> On Thu, Dec 17, 2015 at 5:11 PM, Pandruvada, Srinivas
>> <[email protected]> wrote:
>> > On Thu, 2015-12-17 at 17:08 -0800, Nish Aravamudan wrote:
>> > > On Thu, Dec 17, 2015 at 5:00 PM, Pandruvada, Srinivas
>> > > <[email protected]> wrote:
>> > > > Hi Andy,
>> > > >
>> > > > As per Nish these patches are impacting sensors on Yoga.
>> > > > https://lkml.org/lkml/2015/11/30/441
>> > >
>> > > To be clear, without that series, the touchpad and touchscreen on
>> > > the
>> > > Yoga 900 don't work at all. So they are necessary for
>> > > functioning. I
>> > > don't know (I will test it now), if removing the series makes the
>> > > IIO
>> > > sensors work properly in /dev/.
>> > This is important to know before we take Andy's time.
>>
>> It seems like Andy's patches are not the problem. That is, with stock
>> 4.4-rc5, the accelerommeter /dev files still do not update.
>>
> Can you not use raw values by polling from user space? Send me
> report description. It should be in
> /sys/kernel/debug/hid/ "your device id" /redesc.

The underlying issue is that iio-sensor-proxy relies on values from
the corresponding /dev nodes to automatically rotate the screen, etc.
in the desktop environment.

Attached due to its size.

> Also device id ("your device id") above.

0018:048D:8396.0002

-Nish


Attachments:
rdesc (50.39 kB)

2015-12-18 16:58:57

by Pandruvada, Srinivas

[permalink] [raw]
Subject: Re: iio/hid-sensor-accel-3d: no output from /dev/iio:device*?

On Thu, 2015-12-17 at 19:06 -0800, Nish Aravamudan wrote:
> On Thu, Dec 17, 2015 at 6:50 PM, Pandruvada, Srinivas
> <[email protected]> wrote:
> > On Thu, 2015-12-17 at 18:33 -0800, Nish Aravamudan wrote:
> > > On Thu, Dec 17, 2015 at 5:11 PM, Pandruvada, Srinivas
> > > <[email protected]> wrote:
> > > > On Thu, 2015-12-17 at 17:08 -0800, Nish Aravamudan wrote:
> > > > > On Thu, Dec 17, 2015 at 5:00 PM, Pandruvada, Srinivas
> > > > > <[email protected]> wrote:
> > > > > > Hi Andy,
> > > > > >
> > > > > > As per Nish these patches are impacting sensors on Yoga.
> > > > > > https://lkml.org/lkml/2015/11/30/441
> > > > >
> > > > > To be clear, without that series, the touchpad and
> > > > > touchscreen on
> > > > > the
> > > > > Yoga 900 don't work at all. So they are necessary for
> > > > > functioning. I
> > > > > don't know (I will test it now), if removing the series makes
> > > > > the
> > > > > IIO
> > > > > sensors work properly in /dev/.
> > > > This is important to know before we take Andy's time.
> > >
> > > It seems like Andy's patches are not the problem. That is, with
> > > stock
> > > 4.4-rc5, the accelerommeter /dev files still do not update.
> > >
> > Can you not use raw values by polling from user space? Send me
> > report description. It should be in
> > /sys/kernel/debug/hid/ "your device id" /redesc.
>
> The underlying issue is that iio-sensor-proxy relies on values from
> the corresponding /dev nodes to automatically rotate the screen, etc.
> in the desktop environment.
>
> Attached due to its size.
>
> > Also device id ("your device id") above.
>
> 0018:048D:8396.0002
Sent a patch, try and see if this works.

Thanks,
Srinivas

>
> -Nish????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?