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

Re: Kernel 2.6.x breaks X on blade 100



On Wed, 2004-05-19 at 09:49 +0200, Admar Schoonen wrote:
> On Wed, May 19, 2004 at 08:53:04AM +0200, Elie De Brauwer wrote:
> > I've been trying to install 2.6.6 (and 2.6.5) on my Sun Blade 100,
> > everything boots well but X won't work, in my 2.4.x I got a working 
> 
> You'll have to apply a small patch for 2.6 kernels:
> http://lists.debian.org/debian-sparc/2004/02/msg00013.html

Or, you could fix X. Patch attached (originally done by the Gentoo SPARC
folks).

~spot
---
Tom "spot" Callaway <tcallawa(a)redhat*com> LCA, RHCE 
Red Hat Sales Engineer || Aurora SPARC Linux Project Leader

"If you are going through hell, keep going."
- Sir Winston Churchill

--- xc/programs/Xserver/hw/xfree86/os-support/bus/linuxPci.c.BAD	2004-04-09 14:50:59.000000000 -0500
+++ xc/programs/Xserver/hw/xfree86/os-support/bus/linuxPci.c	2004-04-09 14:54:14.000000000 -0500
@@ -104,6 +104,7 @@
 	static int	lbus,ldev,lfunc,fd = -1;
 	int		bus, dev, func;
 	char		file[32];
+	struct stat	ignored;
 
 	bus  = PCI_BUS_FROM_TAG(tag);
 	dev  = PCI_DEV_FROM_TAG(tag);
@@ -111,12 +112,21 @@
 	if (fd == -1 || bus != lbus || dev != ldev || func != lfunc) {
 		if (fd != -1)
 			close(fd);
-		if (bus < 256)
-			sprintf(file, "/proc/bus/pci/%02x/%02x.%1x",
-				bus, dev, func);
-		else
-			sprintf(file, "/proc/bus/pci/%04x/%02x.%1x",
-				bus, dev, func);
+		if (bus < 256) {
+			if (stat("/proc/bus/pci/00", &ignored) < 0)
+				sprintf(file, "/proc/bus/pci/0000:%02x/%02x.%1x",
+					bus, dev, func);
+			else
+				sprintf(file, "/proc/bus/pci/%02x/%02x.%1x",
+					bus, dev, func);
+		} else {
+			if (stat("/proc/bus/pci/00", &ignored) < 0)
+				sprintf(file, "/proc/bus/pci/0000:%04x/%02x.%1x",
+					bus, dev, func);
+			else
+				sprintf(file, "/proc/bus/pci/%04x/%02x.%1x",
+					bus, dev, func);
+		}
 		fd = open(file,O_RDWR);
 		lbus  = bus;
 		ldev  = dev;

Reply to: