Bug 5000

Summary: Domain support does not work for SGI Altix machines
Product: xorg Reporter: Eric Kunze <ekunze>
Component: Server/GeneralAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: high CC: ajax, edwardsg, eich, jes, jlim, mat, sndirsch
Version: 6.8.99.901 (6.9 RC1)   
Hardware: SGI   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Patch to fix PCI domain support for Altix
none
revised PCI domain support patch for Altix
none
Patch for supporting CE-X for altix
none
revised patch to linuxPci.c (PCI domain support for Altix) none

Description Eric Kunze 2005-11-09 15:08:15 UTC
There is partial support in the current head to try to use pci domains on ia64
machines.  While working on an Altix with multiple domains, some problems 
appeared when trying out the support.

I have a patch which allows Altix with domains to work. I'm in the process of
cleaning it up.
Comment 1 Eric Kunze 2005-11-09 15:38:38 UTC
Created attachment 3762 [details] [review]
Patch to fix PCI domain support for Altix

This patch works on Altix, and should fall back correctly on other platforms.
Comment 2 Adam Jackson 2005-12-22 03:41:43 UTC
egbert: any comments on this, or is it okay to apply?
Comment 3 Greg Edwards 2005-12-22 04:02:27 UTC
Created attachment 4139 [details] [review]
revised PCI domain support patch for Altix

This is the revised patch (from Egbert and Andreas) that SUSE took.
Comment 4 Matthias Hopf 2006-10-25 04:59:50 UTC
For X.org after modularization the patches had to be revised and several bugs to
be fixed. Currently this is tracked in Novell's bugzilla under

  https://bugzilla.novell.com/show_bug.cgi?id=197190

I will upstream the patches as soon as I'm confident that we fixed all issues
and do not have any regressions WRT other architectures.
Comment 5 Matthias Hopf 2006-11-09 09:41:22 UTC
Except for a patch for CE bridges that looks too scary to unconditionally check
it in everything is now in git.
Comment 6 Matthias Hopf 2006-11-09 09:49:10 UTC
Created attachment 7713 [details] [review]
Patch for supporting CE-X for altix

This is the patch that looks a bit suspicious.
Comment 7 Adam Jackson 2006-11-13 14:18:07 UTC
The changes to altixPCI.c can, at worst, only break altix, so, okay.

The change to linuxOpenLegacy I'm not sure about.

The change to xf86MapDomainMemory looks plausible.

I have no idea why the change to ia64LinuxFindPciNext should be necessary.  Do
we really not have any generic code for handling that?  Also, are we sure busses
are going to be numbered consecutively, because if not then the pciNumBusses
assignment looks pretty bogus.
Comment 8 Matthias Hopf 2006-11-14 03:05:30 UTC
(In reply to comment #7)
> The change to linuxOpenLegacy I'm not sure about.

Me neither. We're currently in beta phase, so I don't want to apply something
like this to the Xserver unconditionally ATM. Maybe for an alpha of openSUSE, so
it can be tested widely at least for x86 before upstreaming, to approve that it
has no side effect.

> I have no idea why the change to ia64LinuxFindPciNext should be necessary.  Do
> we really not have any generic code for handling that?  Also, are we sure busses
> are going to be numbered consecutively, because if not then the pciNumBusses
> assignment looks pretty bogus.

I have no clue. I think I should ask sgi first whether we have a machine
in-house, and test the Xserver w/o this part of the patch first. Though I guess
it is necessary. It should probably be more robust before upstreaming.
Comment 9 Daniel Stone 2007-02-27 01:28:40 UTC
Sorry about the phenomenal bug spam, guys.  Adding xorg-team@ to the QA contact so bugs don't get lost in future.
Comment 10 Jonathan Lim 2007-03-26 16:11:15 UTC
(In reply to comment #7)
> The change to linuxOpenLegacy I'm not sure about.

If you mean this change:

-       pBusInfo = pciBusInfo[bus];
+       pBusInfo = pciBusInfo[PCI_BUS_FROM_TAG(Tag)];

where bus = PCI_BUS_NO_DOMAIN(PCI_BUS_FROM_TAG(Tag))

I'm guessing it's because in getnextbus(), pciBusInfo[] is indexed using
dombus = PCI_MAKE_BUS(*domain, *bus), and in ia64linuxPciFindNext(), it's
indexed using sec_bus = PCI_SECONDARY_BUS_EXTRACT(bridge_reg, pciDeviceTag);
both account for the domain.

> I have no idea why the change to ia64LinuxFindPciNext should be necessary.
> Do we really not have any generic code for handling that?

That change is very similar to the PCI_BRIDGE_SUPPORT section in Pci.c; seems
that it could easily be copied over to linuxPci.c.
Comment 11 Jonathan Lim 2007-05-10 14:14:48 UTC
Created attachment 9918 [details] [review]
revised patch to linuxPci.c (PCI domain support for Altix)

Note that the change to ia64linuxPciFindNext() is basically what's
in the PCI_BRIDGE_SUPPORT ifdef in pciGenFindNext() in Pci.c.
Comment 12 Jonathan Lim 2007-05-10 14:19:35 UTC
(In reply to comment #11)
> Created an attachment (id=9918) [details]
> revised patch to linuxPci.c (PCI domain support for Altix)

The diff above is based on the latest revision in the git tree as of today.
I've tested it on Altix 450 and 4700 with the ATI FireMV 2200 graphics card
in the base IO blade.
Comment 13 Adam Jackson 2007-05-29 06:50:08 UTC
(In reply to comment #12)
> (In reply to comment #11)
> > Created an attachment (id=9918) [details] [details]
> > revised patch to linuxPci.c (PCI domain support for Altix)
> 
> The diff above is based on the latest revision in the git tree as of today.
> I've tested it on Altix 450 and 4700 with the ATI FireMV 2200 graphics card
> in the base IO blade.

This looks fine to me.  Matthias or Egbert, any comment?
Comment 14 Stefan Dirsch 2007-05-29 07:03:30 UTC
Matthias is on LinuxTag this week.
Comment 15 Matthias Hopf 2007-06-05 08:12:57 UTC
Looks good. The bridge code argument is reasonable as well.

Comment 16 Matthias Hopf 2007-07-04 11:13:12 UTC
No more complaints -> finally pushed into git.

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.