The patch attached below will add PCI domain support to the generic Linux PCI interface and improves handling of PCI domains.
Created attachment 1741 [details] [review] see above.
Created attachment 1744 [details] [review] Cleaned patch I've committed some fixes that I needed to test this code separately and cleaned the diff so that it only contains changes that are relevant to domain support.
I tried your PCI Domain patch listed in fdo bug #2368, and it does indeed find my video card, but it then dies. Glibc detects the bug and aborts ... something about an invalid free() with the next block being too large - I'll get the error exactly next time I run it. It leaves the video card in an unknown state, so my framebuffer ends up being borked. I was wondering if any further work has been done, or if you had some insight on where to look for the bug since I plan on working on this a bit since I think I have an ideal test case. I'm running a Sun E450 / UltraSparc II and a Matrox PCI video card and kernel 2.6.15. Switching to fbdev (at least on the unpatched Xorg, not tried it on the patched) will work, and I get a Gnome desktop. Other people on Sparcs without PCI Domains have used the same card successfully. I think this makes for a combination that makes for a good test. BTW, when I had PCI debugging turned on, it looked like it was testing EVERY PCI domain, instead of just testing the ones I have. I haven't looked into the source for this, but is it incrementing a counter to test each PCI domain, or is it just looping through the entries in /proc/bus/pci ? Xorg (6.8.2) now gets far enough along to detect the card ... (II) MGA: driver for Matrox chipsets: mga2064w, mga1064sg, mga2164w, mga2164w AGP, mgag100, mgag100 PCI, mgag200, mgag200 PCI, mgag400, mgag550 (II) Primary Device is: PCI 00@0005:04:0 X -scanpci and lspci output ... navi ~ # lspci 80:00.0 Host bridge: Sun Microsystems Computer Corp. Psycho PCI Bus Module 0001:00:00.0 Host bridge: Sun Microsystems Computer Corp. Psycho PCI Bus Module 0001:00:01.0 Bridge: Sun Microsystems Computer Corp. EBUS (rev 01) 0001:00:01.1 Ethernet controller: Sun Microsystems Computer Corp. Happy Meal (rev 01) 0001:00:02.0 SCSI storage controller: LSI Logic / Symbios Logic 53c875 (rev 03) 0001:00:03.0 SCSI storage controller: LSI Logic / Symbios Logic 53c875 (rev 03) 0001:00:04.0 SCSI storage controller: LSI Logic / Symbios Logic 53c875 (rev 14) 0001:00:04.1 SCSI storage controller: LSI Logic / Symbios Logic 53c875 (rev 14) 0002:80:00.0 Host bridge: Sun Microsystems Computer Corp. Psycho PCI Bus Module 0003:00:00.0 Host bridge: Sun Microsystems Computer Corp. Psycho PCI Bus Module 0003:00:02.0 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 61) 0003:00:02.1 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 61) 0003:00:02.2 USB Controller: VIA Technologies, Inc. USB 2.0 (rev 63) 0004:80:00.0 Host bridge: Sun Microsystems Computer Corp. Psycho PCI Bus Module 0005:00:00.0 Host bridge: Sun Microsystems Computer Corp. Psycho PCI Bus Module 0005:00:04.0 Display controller: Matrox Graphics, Inc. MGA 2064W [Millennium] (rev 01) navi ~ # X -scanpci Probing for PCI devices (Bus@Domain:Device:Function) (1@0:0:0) Sun Microsystems Computer Corp. Psycho PCI Bus Module (1@1:0:0) Sun Microsystems Computer Corp. Psycho PCI Bus Module (1@1:1:0) Sun Microsystems Computer Corp. EBUS (1@1:1:1) Sun Microsystems Computer Corp. Happy Meal (1@1:2:0) LSI Logic / Symbios Logic 53c875 (1@1:3:0) LSI Logic / Symbios Logic 53c875 (1@1:4:0) unknown card (0x1000/0x1000) using a LSI Logic / Symbios Logic 53c875 (1@1:4:1) unknown card (0x1000/0x1000) using a LSI Logic / Symbios Logic 53c875 (1@2:0:0) Sun Microsystems Computer Corp. Psycho PCI Bus Module (1@3:0:0) Sun Microsystems Computer Corp. Psycho PCI Bus Module (1@3:2:0) unknown card (0x1106/0x3038) using a VIA Technologies, Inc. USB (1@3:2:1) unknown card (0x1106/0x3038) using a VIA Technologies, Inc. USB (1@3:2:2) unknown card (0x1106/0x3104) using a VIA Technologies, Inc. USB 2.0 (1@4:0:0) Sun Microsystems Computer Corp. Psycho PCI Bus Module (1@5:0:0) Sun Microsystems Computer Corp. Psycho PCI Bus Module (1@5:4:0) Matrox Graphics, Inc. MGA 2064W [Millennium]
Here's the exact error message ... (==) Log file: "/var/log/Xorg.0.log", Time: Tue Dec 20 12:46:31 2005 (==) Using config file: "/etc/X11/xorg.conf" Using vt 7 *** glibc detected *** free(): invalid next size (fast): 0x00264b40 *** XIO: fatal IO error 54 (Connection reset by peer) on X server ":0.0" after 0 requests (0 known processed) with 0 events remaining.
Created attachment 4160 [details] [review] further fixes to above patch originally intended to rewrite this from scratch, but added the previous patch when it was appropriate, and basically ended up copying the previous work. All credit goes to previous patch writer. I did not included everything the previous patch includes, just enough to make it work right. This patch fixes a few bugs in the previous one and a fatal crash (sprintf overwriting a static string that was no longer large enough) - compare to previous patch! Please commit this ASAP as my box (Sun E450) runs linux 2.6 and has PCI domains, and Xorg will NOT work without this patch since I can't put my video card into domain 0. I'm using the mga driver, but all drivers should work the same. I'm likely not the only one with this issue!
David S. Miller's recent patch: http://lists.freedesktop.org/archives/xorg/2005-December/011892.html for reference...
*** Bug 3829 has been marked as a duplicate of this bug. ***
*** Bug 827 has been marked as a duplicate of this bug. ***
This is still in assue with xorg-server 1.02. I have managed to retrofit the 6.8.2 patch here ( https://bugs.freedesktop.org/attachment.cgi?id=4160 ) to work with the new server as a temporary workaround on my E250 ( http://forums.gentoo.org/viewtopic-t-442939.html for the 12 ounce epiloge). Thank you for your time, Frank Russo
K, I was a little bit over optimistic with my last comment. Xorg-server 1.0.2 finds the card, but I end up with a blank screen and PCI error messages in dmsg. I posted my work to the thread in my above comment. At this point, I am totally out of time to work on this. I'll see if I can track someone down to get assistance with a new/working patch. The only workaround is to use the 2.4 kernel, which incorrectly assigns PCI IDs on multi domain systems. Frank
Bug Still exists in xorg-server 1.1.0
I will check in a patch loosely based on David S. Miller's patch. Without the dynamic domain test ATM.
Sorry about the phenomenal bug spam, guys. Adding xorg-team@ to the QA contact so bugs don't get lost in future.
I today compiled Xorg from git (Head) and on my E450 sill don't detect video card. Xorg -scanpci only show Sub Psycho bridge. On Xorg wiki I read that problem is solved. Any idea ?
I'm wondering whether the discussion is now obsolete with libpciaccess/pci-rework.
I think that not, I found this in release nores of Xserver 1.4. Bug #7248: Multiple PCI domains no longer work on Linux. This has been present since the 1.3 server, at least. It is expected to be fixed on master (to be server 1.5), and a minimal fix may be backported when that happens.
Date: Thu, 03 Jan 2008 22:17:19 -0800 From: Ian Romanick <idr@us.ibm.com> To: xorg@lists.freedesktop.org Subject: Re: Xorg cannot see secondary or tertiary PCI bus? [...] Those devices are in different PCI domains, and released versions of X.org do not have multi-domain support on PowerPC. However, support has been in git since about the middle of last year. The bad news is that you'll likely have to build it from scratch for yourself. [...]
This is more or less done with pciaccess. Closing.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.