linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: Fix something
@ 2008-12-29  0:12 Paul Mackerras
  2008-12-29  0:15 ` Paul Mackerras
  2008-12-29  1:25 ` Benjamin Herrenschmidt
  0 siblings, 2 replies; 3+ messages in thread
From: Paul Mackerras @ 2008-12-29  0:12 UTC (permalink / raw)
  To: linuxppc-dev

X has been failing to start on my quad G5 powermac since commit
1fd0f52583a85b21a394201b007bc1ee104b235d ("powerpc: Fix domain numbers
in /proc on 64-bit") went in.  The reason is that the change allows X
to see the PCI-PCI bridge above the video card (previously it was
obscured by the fact that there were two "00" directories in
/proc/bus/pci), and the pciconfig_iobase system call on the bridge is
failing because of a hack that we have to return information about the
AGP bus when X asks about bus 0.  This machine doesn't have an AGP bus
(it has PCI Express) and so the pciconfig_iobase call is returning -1,
which ultimately causes X to fail to start.

This fixes it by checking that we have an AGP bridge before
redirecting the pciconfig_iobase call to return information about the
AGP bus.  With this, X starts successfully both on a quad G5 with
PCI Express and on an older dual G5 with AGP.

Signed-off-by: Paul Mackerras <paulus@samba.org>
---

diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index 39fadc6..586962f 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -560,9 +560,14 @@ long sys_pciconfig_iobase(long which, unsigned long in_bus,
 	 * G5 machines... So when something asks for bus 0 io base
 	 * (bus 0 is HT root), we return the AGP one instead.
 	 */
-	if (machine_is_compatible("MacRISC4"))
-		if (in_bus == 0)
+	if (in_bus == 0 && machine_is_compatible("MacRISC4")) {
+		struct device_node *agp;
+
+		agp = of_find_compatible_node(NULL, NULL, "u3-agp");
+		if (agp)
 			in_bus = 0xf0;
+		of_node_put(agp);
+	}
 
 	/* That syscall isn't quite compatible with PCI domains, but it's
 	 * used on pre-domains setup. We return the first match

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] powerpc: Fix something
  2008-12-29  0:12 [PATCH] powerpc: Fix something Paul Mackerras
@ 2008-12-29  0:15 ` Paul Mackerras
  2008-12-29  1:25 ` Benjamin Herrenschmidt
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Mackerras @ 2008-12-29  0:15 UTC (permalink / raw)
  To: linuxppc-dev

Oops... obviously the subject line wasn't fully baked.  How about

[PATCH] powerpc: Fix pciconfig_iobase system call on PCI-Express powermac

Paul.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] powerpc: Fix something
  2008-12-29  0:12 [PATCH] powerpc: Fix something Paul Mackerras
  2008-12-29  0:15 ` Paul Mackerras
@ 2008-12-29  1:25 ` Benjamin Herrenschmidt
  1 sibling, 0 replies; 3+ messages in thread
From: Benjamin Herrenschmidt @ 2008-12-29  1:25 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev

On Mon, 2008-12-29 at 11:12 +1100, Paul Mackerras wrote:
> X has been failing to start on my quad G5 powermac since commit
> 1fd0f52583a85b21a394201b007bc1ee104b235d ("powerpc: Fix domain numbers
> in /proc on 64-bit") went in.  The reason is that the change allows X
> to see the PCI-PCI bridge above the video card (previously it was
> obscured by the fact that there were two "00" directories in
> /proc/bus/pci), and the pciconfig_iobase system call on the bridge is
> failing because of a hack that we have to return information about the
> AGP bus when X asks about bus 0.  This machine doesn't have an AGP bus
> (it has PCI Express) and so the pciconfig_iobase call is returning -1,
> which ultimately causes X to fail to start.
> 
> This fixes it by checking that we have an AGP bridge before
> redirecting the pciconfig_iobase call to return information about the
> AGP bus.  With this, X starts successfully both on a quad G5 with
> PCI Express and on an older dual G5 with AGP.
> 
> Signed-off-by: Paul Mackerras <paulus@samba.org>

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

(With fixed subject of course :-)

Cheers,
Ben.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-12-29  1:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-29  0:12 [PATCH] powerpc: Fix something Paul Mackerras
2008-12-29  0:15 ` Paul Mackerras
2008-12-29  1:25 ` Benjamin Herrenschmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).