public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] linux-patches r1506 - genpatches-2.6/trunk/2.6.28
@ 2009-03-11 15:10 George Kadianakis (asn)
  0 siblings, 0 replies; only message in thread
From: George Kadianakis (asn) @ 2009-03-11 15:10 UTC (permalink / raw
  To: gentoo-commits

Author: asn
Date: 2009-03-11 15:10:19 +0000 (Wed, 11 Mar 2009)
New Revision: 1506

Added:
   genpatches-2.6/trunk/2.6.28/2300_ppc-legacymem-anon-memory.patch
Modified:
   genpatches-2.6/trunk/2.6.28/0000_README
Log:
Fix launching of X.org on some PPC platforms

Modified: genpatches-2.6/trunk/2.6.28/0000_README
===================================================================
--- genpatches-2.6/trunk/2.6.28/0000_README	2009-03-07 19:52:39 UTC (rev 1505)
+++ genpatches-2.6/trunk/2.6.28/0000_README	2009-03-11 15:10:19 UTC (rev 1506)
@@ -79,6 +79,10 @@
 From:	http://bugs.gentoo.org/show_bug.cgi?id=257738
 Desc:	Fix return value of journal_start_commit()
 
+Patch	2300_ppc-legacymem-anon-memory.patch
+From:	https://bugs.gentoo.org/253149
+Desc:	Fix launching of X.org on some PPC platforms
+
 Patch:	2305_uninline-pci-ioremap-bar.patch
 From:	http://bugs.gentoo.org/252488
 Desc:	Move some PCI code around to fix compilation on alpha
@@ -97,7 +101,7 @@
 
 Patch:	2705_i915-no-vblank-on-disabled-pipe.patch
 From:	http://bugs.gentoo.org/253813
-Desc:	Fix crash with GEM + compiz
+ppDesc:	Fix crash with GEM + compiz
 
 Patch:	2710_i915-set-vblank-flag-correctly.patch
 From;	http://bugs.gentoo.org/253813

Added: genpatches-2.6/trunk/2.6.28/2300_ppc-legacymem-anon-memory.patch
===================================================================
--- genpatches-2.6/trunk/2.6.28/2300_ppc-legacymem-anon-memory.patch	                        (rev 0)
+++ genpatches-2.6/trunk/2.6.28/2300_ppc-legacymem-anon-memory.patch	2009-03-11 15:10:19 UTC (rev 1506)
@@ -0,0 +1,51 @@
+From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+Date: Sun, 8 Feb 2009 14:27:21 +0000 (+0000)
+Subject: powerpc/pci: mmap anonymous memory when legacy_mem doesn't exist
+X-Git-Tag: v2.6.29-rc5~40^2~1
+X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=5b11abfdb572bf9284e596dd198ac2aaf95b6616
+
+powerpc/pci: mmap anonymous memory when legacy_mem doesn't exist
+
+The new legacy_mem file in sysfs is causing problems with X on machines
+that don't support legacy memory access. The way I initially implemented
+it, we would fail with -ENXIO when trying to mmap it, thus exposing to
+X that we do support the API but there is no legacy memory.
+
+Unfortunately, X poor error handling is causing it to fail to start when
+it gets this error.
+
+This implements a workaround hack that instead maps anonymous memory
+instead (using shmem if VM_SHARED is set, just like /dev/zero does).
+
+Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+---
+
+diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
+index 19b12d2..0f41812 100644
+--- a/arch/powerpc/kernel/pci-common.c
++++ b/arch/powerpc/kernel/pci-common.c
+@@ -561,8 +561,21 @@ int pci_mmap_legacy_page_range(struct pci_bus *bus,
+ 		 (unsigned long long)(offset + size - 1));
+ 
+ 	if (mmap_state == pci_mmap_mem) {
+-		if ((offset + size) > hose->isa_mem_size)
+-			return -ENXIO;
++		/* Hack alert !
++		 *
++		 * Because X is lame and can fail starting if it gets an error trying
++		 * to mmap legacy_mem (instead of just moving on without legacy memory
++		 * access) we fake it here by giving it anonymous memory, effectively
++		 * behaving just like /dev/zero
++		 */
++		if ((offset + size) > hose->isa_mem_size) {
++			printk(KERN_DEBUG
++			       "Process %s (pid:%d) mapped non-existing PCI legacy memory for 0%04x:%02x\n",
++			       current->comm, current->pid, pci_domain_nr(bus), bus->number);
++			if (vma->vm_flags & VM_SHARED)
++				return shmem_zero_setup(vma);
++			return 0;
++		}
+ 		offset += hose->isa_mem_phys;
+ 	} else {
+ 		unsigned long io_offset = (unsigned long)hose->io_base_virt - _IO_BASE;
+




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-03-11 15:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-11 15:10 [gentoo-commits] linux-patches r1506 - genpatches-2.6/trunk/2.6.28 George Kadianakis (asn)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox