2009-01-22 21:31:58

by Pavel Machek

[permalink] [raw]
Subject: HP accelerometer driver: testers wanted



HP accelerometer driver: testers wanted
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

It is in latest -mm. Enable CONFIG_SENSORS_LIS3LV02D,
recompile/reboot. Documentation is in Documentation/hwmon/lis3lv02d
and Documentation/hwmon/hpfall.c is standalone binary that should park
your disk (and light a led) as soon as freefall is detected.

For standalone patch, see

http://www.livejournal.com/~pavelmachek


Pavel
--
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


2009-01-22 22:02:17

by Frans Pop

[permalink] [raw]
Subject: Re: HP accelerometer driver: testers wanted

Hi Pavel,

Pavel Machek wrote:
> It is in latest -mm. Enable CONFIG_SENSORS_LIS3LV02D,
> recompile/reboot. Documentation is in Documentation/hwmon/lis3lv02d
> and Documentation/hwmon/hpfall.c is standalone binary that should park
> your disk (and light a led) as soon as freefall is detected.

My HP 2510p notebook has the device. By chance I activated the driver with
my last few builds and at least the input device works perfectly with
the -rc2 kernel (tested with jstest and Tux Racer).

What are the differences relative to -rc2? Looks like it adds the freefall
device?

Could you please give some additional info what exactly you want tested,
how to test it, and how safe it is to do the test?

I'd be willing to test, but not if to do so I'd have to throw the notebook
out of the window... Or even if there is the slightest risk of somehow
damaging the hard disk.

Cheers,
FJP

2009-01-22 22:17:32

by Pavel Machek

[permalink] [raw]
Subject: Re: HP accelerometer driver: testers wanted

On Thu 2009-01-22 23:01:57, Frans Pop wrote:
> Hi Pavel,
>
> Pavel Machek wrote:
> > It is in latest -mm. Enable CONFIG_SENSORS_LIS3LV02D,
> > recompile/reboot. Documentation is in Documentation/hwmon/lis3lv02d
> > and Documentation/hwmon/hpfall.c is standalone binary that should park
> > your disk (and light a led) as soon as freefall is detected.
>
> My HP 2510p notebook has the device. By chance I activated the driver with
> my last few builds and at least the input device works perfectly with
> the -rc2 kernel (tested with jstest and Tux Racer).
>
> What are the differences relative to -rc2? Looks like it adds the freefall
> device?

Yes.

> Could you please give some additional info what exactly you want tested,
> how to test it, and how safe it is to do the test?

Run hpfall, and see if LED lights and disk parks if you "drop" a
computer. (*)

> I'd be willing to test, but not if to do so I'd have to throw the notebook
> out of the window... Or even if there is the slightest risk of somehow
> damaging the hard disk.

(*) drop: just move it quickly downwards for 5-10cm. Even walking with
the computer usually triggers it for me.

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

2009-01-22 23:11:42

by Frans Pop

[permalink] [raw]
Subject: Re: HP accelerometer driver: testers wanted

Minor issue in the patch: hpfall.c should not be executable:
-rwxr-xr-x 1 fjp fjp 1759 2009-01-22 23:31 hpfall.c

With patch applied:
$ ls -l /dev/freefall
crw-rw---- 1 root root 10, 59 2009-01-22 23:44 /dev/freefall

$ gcc -o hpfall -Os hpfall.c
hpfall.c: In function ‘main’:
hpfall.c:73: warning: passing argument 2 of ‘signal’ from incompatible
pointer type

> Run hpfall, and see if LED lights and disk parks if you "drop" a
> computer. (*)

$ sudo ./hpfall &

The LED lights up yellow, but I have problems telling if the disk gets
parked or not. One time I got a green led and seemingly a fair amount of
activity immediately after getting the yellow led.

After looking at hpfall.c, I checked /sys/block/sda/device/unload_heads
after a drop:
$ cat /sys/block/sda/device/unload_heads
19616
$ cat /sys/block/sda/device/unload_heads
0

The last was at most 2 seconds after the first, certainly not 20...

Wouldn't it be good to have locks/unlocks registered in the logs when
/sys/block/sda/device/unload_heads changes (assuming the actual write will
get delayed until the head is unparked)?

Cheers,
FJP

2009-01-22 23:23:58

by Mariusz Kozlowski

[permalink] [raw]
Subject: Re: HP accelerometer driver: testers wanted

> HP accelerometer driver: testers wanted
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> It is in latest -mm. Enable CONFIG_SENSORS_LIS3LV02D,
> recompile/reboot. Documentation is in Documentation/hwmon/lis3lv02d
> and Documentation/hwmon/hpfall.c is standalone binary that should park
> your disk (and light a led) as soon as freefall is detected.
>
> For standalone patch, see
>
> http://www.livejournal.com/~pavelmachek

Then lets add kernel-testers@ to CC.

Mariusz

2009-01-23 08:59:36

by Frans Pop

[permalink] [raw]
Subject: Re: HP accelerometer driver: testers wanted

On Friday 23 January 2009, Frans Pop wrote:
> The LED lights up yellow, but I have problems telling if the disk gets
> parked or not. One time I got a green led and seemingly a fair amount
> of activity immediately after getting the yellow led.
>
> After looking at hpfall.c, I checked /sys/block/sda/device/unload_heads
> after a drop:
> $ cat /sys/block/sda/device/unload_heads
> 19616
> $ cat /sys/block/sda/device/unload_heads
> 0
>
> The last was at most 2 seconds after the first, certainly not 20...

I've just looked at hpcall.c a bit closer and I guess that's because of
the alarm(2) call? I must admit having some problems reading that code.

2009-01-23 09:14:03

by Pavel Machek

[permalink] [raw]
Subject: Re: HP accelerometer driver: testers wanted

On Fri 2009-01-23 09:59:25, Frans Pop wrote:
> On Friday 23 January 2009, Frans Pop wrote:
> > The LED lights up yellow, but I have problems telling if the disk gets
> > parked or not. One time I got a green led and seemingly a fair amount
> > of activity immediately after getting the yellow led.
> >
> > After looking at hpfall.c, I checked /sys/block/sda/device/unload_heads
> > after a drop:
> > $ cat /sys/block/sda/device/unload_heads
> > 19616
> > $ cat /sys/block/sda/device/unload_heads
> > 0
> >
> > The last was at most 2 seconds after the first, certainly not 20...
>
> I've just looked at hpcall.c a bit closer and I guess that's because of
> the alarm(2) call? I must admit having some problems reading that
> code.

Yes, it works as designed. Change if (1 || into if (0) and you'll get
20 second timeouts.

(It initially asks for 20 seconds to give itself time for those other
calculations.)
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

2009-01-23 15:22:55

by Pavel Machek

[permalink] [raw]
Subject: Re: HP accelerometer driver: testers wanted

Hi!

> Minor issue in the patch: hpfall.c should not be executable:
> -rwxr-xr-x 1 fjp fjp 1759 2009-01-22 23:31 hpfall.c

Hmm, fixed in my local tree, but will have to think about how to make
it into patch.

> > Run hpfall, and see if LED lights and disk parks if you "drop" a
> > computer. (*)
>
> $ sudo ./hpfall &
>
> The LED lights up yellow, but I have problems telling if the disk gets
> parked or not. One time I got a green led and seemingly a fair amount of
> activity immediately after getting the yellow led.
>
> After looking at hpfall.c, I checked /sys/block/sda/device/unload_heads
> after a drop:
> $ cat /sys/block/sda/device/unload_heads
> 19616
> $ cat /sys/block/sda/device/unload_heads
> 0

Ok, so drop detection works for you; good. I could see disk activity
stopping during find / ...

> Wouldn't it be good to have locks/unlocks registered in the logs when
> /sys/block/sda/device/unload_heads changes (assuming the actual write will
> get delayed until the head is unparked)?

That would fill the logs rather quickly, right?
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html