Bug 2368 - Adding PCI domain support to Linux PCI code/ improve PCI domain handling
Summary: Adding PCI domain support to Linux PCI code/ improve PCI domain handling
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/DDX/Xorg (show other bugs)
Version: git
Hardware: Other Linux (All)
: high normal
Assignee: Egbert Eich
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
: 827 3829 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-01-24 07:12 UTC by Egbert Eich
Modified: 2008-06-23 10:12 UTC (History)
7 users (show)

See Also:
i915 platform:
i915 features:


Attachments
see above. (25.39 KB, patch)
2005-01-24 07:13 UTC, Egbert Eich
no flags Details | Splinter Review
Cleaned patch (21.25 KB, patch)
2005-01-24 10:34 UTC, Egbert Eich
no flags Details | Splinter Review
further fixes to above patch (14.24 KB, patch)
2005-12-25 18:12 UTC, Evan Langlois
no flags Details | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Egbert Eich 2005-01-24 07:12:50 UTC
The patch attached below will add PCI domain support to the generic Linux PCI
interface and improves handling of PCI domains.
Comment 1 Egbert Eich 2005-01-24 07:13:55 UTC
Created attachment 1741 [details] [review]
see above.
Comment 2 Egbert Eich 2005-01-24 10:34:21 UTC
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.
Comment 3 Evan Langlois 2005-12-21 03:08:41 UTC
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]
Comment 4 Evan Langlois 2005-12-21 05:44:24 UTC
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.
Comment 5 Evan Langlois 2005-12-25 18:12:44 UTC
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!
Comment 6 Alex Deucher 2005-12-29 17:03:00 UTC
David S. Miller's recent patch:
http://lists.freedesktop.org/archives/xorg/2005-December/011892.html
for reference...
Comment 7 Alex Deucher 2005-12-29 17:04:06 UTC
*** Bug 3829 has been marked as a duplicate of this bug. ***
Comment 8 Alex Deucher 2005-12-29 17:05:59 UTC
*** Bug 827 has been marked as a duplicate of this bug. ***
Comment 9 Frank Russo 2006-03-28 06:17:38 UTC
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
Comment 10 Frank Russo 2006-03-31 05:13:34 UTC
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
Comment 11 Frank Russo 2006-06-05 12:51:04 UTC
Bug Still exists in xorg-server 1.1.0
Comment 12 Matthias Hopf 2006-11-02 09:49:57 UTC
I will check in a patch loosely based on David S. Miller's patch. Without the
dynamic domain test ATM.
Comment 13 Daniel Stone 2007-02-27 01:25:14 UTC
Sorry about the phenomenal bug spam, guys.  Adding xorg-team@ to the QA contact so bugs don't get lost in future.
Comment 14 Dan Smolik 2007-03-11 11:02:55 UTC
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 ?
Comment 15 Stefan Dirsch 2007-11-04 08:56:40 UTC
I'm wondering whether the discussion is now obsolete with libpciaccess/pci-rework.
Comment 16 Dan Smolik 2007-11-04 11:11:22 UTC
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.
Comment 17 Stefan Dirsch 2008-01-04 01:54:04 UTC
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.
[...]
Comment 18 Adam Jackson 2008-06-23 10:12:09 UTC
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.