Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on Macbook Air -08 "Could not map GMA950/GMA965 memory" #8

Open
JKAbrams opened this issue May 7, 2013 · 10 comments
Open

Crash on Macbook Air -08 "Could not map GMA950/GMA965 memory" #8

JKAbrams opened this issue May 7, 2013 · 10 comments

Comments

@JKAbrams
Copy link

JKAbrams commented May 7, 2013

Debug output: http://pastebin.com/1xwMwe59

The relevant error:
E: mmap failed: Resource temporarily unavailable
E: Could not map GMA950/GMA965 memory
E: LCD backlight probe failed, check debug output

Running on Linux 3.8.11, (Arch Linux with systemd).

It used to work a few months ago when I last used linux on this machine, but I could not say which version.

Also tried the pommed arch packages pommed and pommed-git, but they give the same error.

@bytbox
Copy link
Owner

bytbox commented May 7, 2013

This is most likely a change in the kernel, since I haven't made any significant changes in the last few months. (Not that there aren't any that should be made, but I'm too lazy.) Thanks for the bug report - I'll get on it in a few days most likely.

@JKAbrams
Copy link
Author

Yeah, a kernel change is my suspicion too as it crashes in the same way in the original version of pommed.
Let me know if I can be of any assistance, with logs or testing or the sort.
(I could also try my hand at the code if you give me a few pointers as to were to look.)

@JKAbrams
Copy link
Author

Possibly related (from dmesg):
[ 32.623787] pommed:227 conflicting memory types 90000000-90100000 uncached-minus<->write-combining
[ 32.623793] reserve_memtype failed [mem 0x90000000-0x900fffff], track uncached-minus, req uncached-minus

@JKAbrams
Copy link
Author

JKAbrams commented Jun 8, 2013

The error is generated on line 138 in the file gma950_backlight.c the offending line:
memory = mmap(NULL, length, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);

The error from mmap, "Resource temporarily unavailable", I think is EAGAIN, which according to the manpage (http://man7.org/linux/man-pages/man2/mmap.2.html) has two causes:

  1. The file has been locked
  2. Too much memory has been locked (see setrlimit(2)).
    I tried to run the command
    ulimit -l unlimited
    before running pommed-light to get around no 2 but that did not work, which leaves me to think it is no 1 that is at fault, the memory is locked. Now what could be locking the memory? As it turns out, the backlight controls does already work on never kernels, without pommed, so my thinking is that it is this new driver that locks the memory. If so, a workaround to the problem would be to simply drop the backlight-feature of pommed for GMA950.

@JKAbrams
Copy link
Author

JKAbrams commented Jun 8, 2013

Ok, tried it now and it works fine, what I did was essentially blank gma950_backlight.c (http://pastebin.com/J2CRqMzG).
From reading pommed.conf.mactel it sounds to me that it is supposed to work even if the kernel is taking control of the lcd-backlight, is the bug than that it doesn't fail gracefully?
Give me a shout if you want help in testing any real solution. For now I'm just happy to have me F-keys back and the keyboard backlight working again!

@bytbox
Copy link
Owner

bytbox commented Jun 8, 2013

The error message reported above happened even when pommed was started manually, rather than from systemd on boot, right? (The bug reported by rekoil would be related if not, so just making sure.)

@JKAbrams
Copy link
Author

bytebox: Yes it happens every time no matter how it is started, so not a systemd issue.
(Sorry about the slow reply, being on the road internet access is a bit spurious.)

@JKAbrams
Copy link
Author

JKAbrams commented Sep 6, 2014

This came back to bite me on 1.47.
However, I found that now (at least for this machine, a trusty early 2008 Macbook Air with KDE 4.14 on Linux 3.16.1), the Linux driver support is now complete:

  • screen backlight
  • keyboard backlight
  • keyboard *
  • not sure about the beeping as I've never used it

So instead of messing with the sourcecode of pommed-light, I find that I no longer need it.
Thanks for providing me with a solution until the Linux drivers came up to speed.

*FN-keys can be switched to function-keys (F1-F12) by adding this line to /etc/modprobe.d/hid_apple.conf:

options hid_apple fnmode=2

@JKAbrams
Copy link
Author

I'm back to using Pommed-light since I found the long term support kernel (version 3.14.51) dont have such severe sleeping problems with the Macbook Air.
As the driver provides /sys/class/backlight/intel_backlight/brightness i rewrote gma950_backlight.c to use that interface in place of the direct memory acces that does not work.
Here it is: http://pastebin.com/y07uArZu

I've tested it and it works on my system.
What would be needed for a proper solution would be a test to select the right method. I guess that test should test for old versions of the graphic driver.

@cockroach
Copy link

I had the same issue on a first-gen Macbook Air with kernel 4.5.0 and the patch seems to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants