In addition to CONTROL_HD_POWERMGMT, there are two other hdparm settings that may be set: CONTROL_HD_IDLE_TIMEOUT and CONTROL_HD_WRITECACHE, and of these, CONTROL_HD_IDLE_TIMEOUT is also set by default. I don't think this problem is limited only to APM calls, but that any hdparm calls contribute to triggering it.
You shouldn't need to patch your kernel to get a trace of apm calls, though; a simple wrapper script should do the job:
In addition to CONTROL_ HD_POWERMGMT, there are two other hdparm settings that may be set: CONTROL_ HD_IDLE_ TIMEOUT and CONTROL_ HD_WRITECACHE, and of these, CONTROL_ HD_IDLE_ TIMEOUT is also set by default. I don't think this problem is limited only to APM calls, but that any hdparm calls contribute to triggering it.
You shouldn't need to patch your kernel to get a trace of apm calls, though; a simple wrapper script should do the job:
$ sudo dpkg-divert --add --local --rename /sbin/hdparm
$ cat | sudo tee /sbin/hdparm
#!/bin/sh
echo "called with args: $@" >> /var/log/hdparm.log distrib "$@"
exec /sbin/hdparm.
^D
$ sudo chmod a+x /sbin/hdparm
$
This should give you a log in /var/log/hdparm.log showing every invocation of hdparm on the system.