applesmc: about polling device and interrupt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I've recently get a macbook pro and I'm running a Fedora 22 (kernel
4.0.8-300.fc22.x86_64) on it.

I'm looking to improve the power consumption, and I've found that
applesmc continuously use 5% of CPU (and a bit less than a 1W).

After investigation, it seems that the problem come from the motion
sensor polling (at 50 ms interval) (see applesmc_idev_poll function)

The sensor functionality is primarily intend to detect laptop fall and
shutdown HDD before the shock.

Matthew Garret sent a patch in 2011
(http://thread.gmane.org/gmane.linux.drivers.sensors/26911/focus=26960)
to use interrupt to get free fall/high acceleration/shock information.
This patch has been rejected cause a lack of use case for them. Shutting
down the HDD could be a use case.

This is already in use through /dev/freefall. (see
Documentation/laptops/freefall.c for use case and
drivers/platform/x86/dell-smo8800.c for a implementation)

I understand that we may need polling the device to get motion input,
but I don't use motion in user space and I prefer not using my CPU for
nothing.

Maybe it would be useful to separate the motion sensor code in a
different module (or using a dynamic configuration) to be able to have
this functionality only when we want it.


I'm ready to make patches to add /dev/freefall handling base on Matthew
Garret patch and move sensor detection to another module (or make it
deactivable). But I would like to see with you before if you are ok with
my proposition.


Regards,
Matthieu Gautier.

PS, I'm pretty (totally) new into kernel patching. I understand quickly
but you may have to explain longer :)


Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
lm-sensors mailing list
lm-sensors@xxxxxxxxxxxxxx
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux