Bug 50351 - hdaps driver emits udev event before full initialization is complete
Summary: hdaps driver emits udev event before full initialization is complete
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: Platform_x86 (show other bugs)
Hardware: All Linux
: P1 low
Assignee: drivers_platform_x86@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-10 14:13 UTC by Stefan Jensen
Modified: 2014-01-12 16:48 UTC (History)
4 users (show)

See Also:
Kernel Version: 3.6.6-1.fc17.i686.PAE
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Stefan Jensen 2012-11-10 14:13:21 UTC
Distribution: Fedora 17
Hardware Environment: Lenovo Thinkpad X60s

# sudo systemctl status hdapsd@sda.service

hdapsd@sda.service - sda shock protection daemon
     Loaded: loaded (/usr/lib/systemd/system/hdapsd@.service; static)
     Active: failed (Result: exit-code) since Sat, 13 Oct 2012 18:05:20 +0200; 1min 32s ago
    Process: 763 ExecStart=/usr/sbin/hdapsd -d %I $HDAPSD_OPTIONS (code=exited, status=1/FAILURE)
     CGroup: name=systemd:/system/hdapsd@.service/sda

hdapsd(sda)[763]: Sat Oct 13 18:05:20 2012: Could not read from /sys/devices/platform/hdaps/position device busy
hpapsd(sda)[763]: Sat Oct 13 18:05:20 2012: Could not read position from sysfs.
hdapsd(sda)[763]: Sat Oct 13 18:05:20 2012: Starting hdapsd
hdapsd(sda)[763]: Sat Oct 13 18:05:20 2012: Selected interface: HDAPS
hdapsd(sda)[763]: Sat Oct 13 18:05:20 2012: Selected HDAPS input device: /dev/input/event9

Please see: https://bugzilla.redhat.com/show_bug.cgi?id=866734

Sticking "ExecStartPre=/usr/bin/sleep 1" in unit file helps, but true fix should be done in kernel, according to:

https://bugzilla.redhat.com/show_bug.cgi?id=866734#c1

best regards
Comment 1 Evgeni Golov 2013-12-25 21:29:53 UTC
Hey Stefan,

just stumbled over your report and have a few questions:
- is this the in-kernel hdaps.ko? I wonder because I thought it does not have the event-interface, which tp_smapi has.
- do you know if hdaps.ko was already loaded, or was it loaded by hdapsd?
Comment 2 Evgeni Golov 2014-01-04 21:01:00 UTC
Hi again,

I can reproduce this on my X61t, but not on my X201s with the tp_smapi hdaps driver.  The in-kernel hdaps driver behaves fine on both machines.

I reproduce it by calling
 sudo rmmod hdaps; sudo modprobe hdaps; cat /sys/devices/platform/hdaps/position

Can you confirm, that this is a tp_smapi issue? We should move to the proper bug tracker then ;)

Greets
Comment 3 Evgeni Golov 2014-01-04 21:22:21 UTC
Oh, and the same applies to an old X40.
Comment 4 Stefan Jensen 2014-01-07 17:50:30 UTC
Hi,

thank you for looking into this. It seems, that it is indeed related to tp_smapi's hdaps.ko. I totally overlooked, that I'm not using the build in module.

$modinfo hdaps

filename:       /lib/modules/3.11.6-202.fc17.i686.PAE/extra/tp_smapi/hdaps.ko
license:        GPL v2
description:    IBM Hard Drive Active Protection System (HDAPS) driver
author:         Robert Love
depends:        thinkpad_ec
vermagic:       3.11.6-202.fc17.i686.PAE SMP mod_unload 686 
parm:           invert:axis orientation code (uint)

best regards
Comment 5 Evgeni Golov 2014-01-12 16:48:24 UTC
Could you by any chance try pathing hdapsd with this patch and see if it behaves properly after it? https://github.com/evgeni/hdapsd/commit/2658f3510f1a38b6701e5a39d5e5e8c69bc8c77d

On my X61t it results in the "busy" message about 3-4 times and works fine afterwards.

Note You need to log in before you can comment on or make changes to this bug.