Created attachment 22539 [details] strace of failing mmap() Debian kernels recently changed to have CONFIG_X86_PAT=y. Since then, we are seeing a problem with bogl-term. Confirmed with 2.6.30 and 2.6.31-rc3. The problem goes away when PAT is disabled (nopat boot option). We managed to narrow it down to a failing mmap(): 814 mmap2(NULL, 65536, PROT_READ|PROT_WRITE, MAP_SHARED, 4, 0) = -1 EAGAIN (Resource temporarily unavailable) 814 write(2, "bogl: mmaping /dev/fb0: Resource temporarily unavailable\n", 57) = 57 814 exit_group(1) = ? The respective code in bogl-term is in bogl-0.1.18/bogl.c: bogl_frame_mapped = mmap (NULL, bogl_frame_len, PROT_READ | PROT_WRITE, MAP_SHARED, fb, 0); Further information: - complete strace output attached - bogl source: http://ftp.debian.org/debian/pool/main/b/bogl/bogl_0.1.18-3.tar.gz - http://bugs.debian.org/538159 "CONFIG_X86_PAT=y breaks bogl-bterm, d-i"
I assume that bogl-term used to work, so I'll mark this as a regression, thanks.
Do you see any errors in 'dmesg' when you see the above failure? Can you attach the output of /debug/x86/pat_memtype_list
There is an error in dmesg: [ 802.000124] bterm:814 map pfn expected mapping type uncached-minus for a0000-b0000, got write-back I will try to get the output of /debug/x86/pat_memtype_list this weekend (not as easy for me to reproduce as for the original bug reporter). Systems on which this problem has been verified: - qemu - virtualbox - Compaq DC9600 (user report)
Writeback for the VGA range would definitely be bad. VGA should technically even be write-combining, although Linux probably can get away with WC. Either which way, I suspect the legacy-region MTRRs force it to UC anyway.
Ok. As the failure is in ISA range, /debug/x86/pat_memtype_list will not give any new info. So, forget about pat_memtype_list for now. Looking at the code we know why this is failing. Suresh and I are thinking about best way to make this work, without breaking other users. Will get back. btw, what fb driver is getting used here?
(In reply to comment #5) > btw, what fb driver is getting used here? vga16fb, according to http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=538159#15
Thanks Venkatesh. Did you find a non-intrusive way to make it work? I would be happy to help testing or finding more details, even if the problem itself is well above my head. :-)
Created attachment 22720 [details] Test patch Max, can you please check if the attached patch fixes the issue? If it works, we will post the patch with changelog etc to lkml on monday. Thanks.
Venkatesh, your patch fixes the issue. Confirmed in vmware and qemu. Thanks a lot!
The commit fixing this problem is in 2.6.31-rc8: commit 1adcaafe7414c5731f758b158aa0525057225deb Author: Suresh Siddha <suresh.b.siddha@intel.com> Date: Mon Aug 17 13:23:50 2009 -0700 So I think the bug can be closed. Thanks!