Latest working kernel version:2.6.25.9 Earliest failing kernel version:2.6.23.* Distribution: Gentoo / homebrowen kernel Hardware Environment: MacBook Pro 4.1 of Feb. 2008 Software Environment: Gentoo Stage 3 environment Problem Description: On boot all MBP features (backlight control, temperature sensors, ...) are recogized correctly EXCEPT the sudden motion sensor. However as another user descibes: This only occurs if I hard boot to linux. If I first boot to osx, and then soft boot (restart) to linux, the motion sensor works as expected. Now, I don't know how the kernel developer of the module came up with the init magic, but I am of course ready to supply any debugging/system information available. Steps to reproduce: mainstream kernel 2.6.25.9 on loading the applesmc driver: applesmc: Apple MacBook Pro detected: applesmc: - Model with accelerometer applesmc: - Model with light sensors and backlight applesmc: - Model with 12 temperature sensors applesmc: wait status failed: c != 8 applesmc: wait status failed: c != 8 applesmc: wait status failed: c != 8 ... (endless same lines) mactel patched kernel 2.6.25.9 on loading the applesmc driver: applesmc: Cannot set motion sensor. might not receive some interrupts.
Created attachment 16885 [details] applesmc-accel-create-check.patch
This patch should fix the problem. It disables the accelerometer input device if the accelerometer cannot be calibrated during initialization (if it fails the first time it is read, it is likely to fail again later). I am not so clear about why it froze your system though (I guess it is related to input-polldev somehow...). And it is obviously not an optimal fix since we would like to have support for the accelerometer on newer Apple devices, but there isn't much I can do with having one of these Macs...
Created attachment 16889 [details] test suite
In order to contribute some information from a MacBook Pro 4.1 I c&p this c-file with code from applesmc module. The while (__wait_status(0x0c)) hack works great, but doesn't solve the problem. The coordinates remain "0,0" despite moving or swinging around the macbook. So... I am still convinced there is a "secret" initalization sequence on start up of the MacOs which hasn't been reverse engineered yet. I know of this page by Johannes Berg about the Apple Motion Sensor Specification. But it doesn't say much about how he did reverse engineere the driver. If someone could point me in the right direction, maybe I would be able to do it myself and commit the results.
Have you tried the patch I attached here? There are 2 issues in this bug report: 1. The system freezes when applesmc is loaded. 2. The accelerometer is not recognized. 1. is a severe issue, which we need to fix ASAP, if my patch works, I will send it upstream (since the system freezes I think it is a candidate for 2.6.26.x). 2. is a potential improvement, and I would be glad to talk with you about it, but I think it is better to do it on mactel-linux devel list (or privately) rather than on this bug tracking system...
Just realised you never stated your system freezes (don't know where I got that idea from...). Anyway, sending tons of messages to the kernel log is not great either .-)
Nicolas, any progress on this?
I can confirm that the problem is solved for MBP4.1 with newer Kernels (probably >=2.6.28)