linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* pmac serial_pci_guess_board problem
@ 2005-11-04 21:27 Geoff Levand
  2005-11-04 21:47 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 4+ messages in thread
From: Geoff Levand @ 2005-11-04 21:27 UTC (permalink / raw)
  To: rmk+serial; +Cc: linux-serial, Benjamin Herrenschmidt

Russell,

I found that the serial port probe code in drivers/serial/8250_pci.c 
no longer works properly for PowerMac G5 in 2.6.14.  It seems some new
code now takes the PCI device info directly from the G5's Open 
Firmware.  The trouble is that OF sets the address length to 16 bytes, 
not the expected 8 bytes.

Here's a fix, but I'd be interested to hear your comments.

-Geoff


Index: linux-2.6.14/drivers/serial/8250_pci.c
===================================================================
--- linux-2.6.14.orig/drivers/serial/8250_pci.c	2005-11-04 11:41:09.000000000 -0800
+++ linux-2.6.14/drivers/serial/8250_pci.c	2005-11-04 11:44:21.000000000 -0800
@@ -1478,7 +1478,11 @@
 	num_port = 0;
 	for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) {
 		if (pci_resource_flags(dev, i) & IORESOURCE_IO &&
+#if defined(CONFIG_PPC_PMAC64)
+		    pci_resource_len(dev, i) == 16 &&
+#else
 		    pci_resource_len(dev, i) == 8 &&
+#endif
 		    (first_port == -1 || (first_port + num_port) == i)) {
 			num_port++;
 			if (first_port == -1)



-------- Original Message --------
Subject: Re: pci_resource_end() changed problem with 2.6.14
Date: Fri, 04 Nov 2005 17:56:09 +1100
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Geoff Levand <geoffrey.levand@am.sony.com>
CC: linuxppc64-dev@ozlabs.org
References: <436ADBA7.7030706@am.sony.com>

On Thu, 2005-11-03 at 19:55 -0800, Geoff Levand wrote:
> I found that the serial port probe code in drivers/serial/8250_pci.c 
> no longer works properly for ppc64 in 2.6.14.  It seems the value 
> returned by pci_resource_len() on ppc64 changed from 8 to 16 since 
> 2.6.13.  I tested on a PC and pci_resource_len() returns 8 as 
> expected.
> 
> Any help on on where to look for the problem would be appreciated.
> 
> Here's the code that hits the problem:
> 
> 		if (pci_resource_flags(dev, i) & IORESOURCE_IO &&
> 		    pci_resource_len(dev, i) == 8 &&
> 
> And here are some test results:

Interesting... What does an lspci -vv shows for the BARs of the PCI
card ? Also, what do you have in /proc/device-tree  ? What is the
machine precisely ?

2.6.14 now uses the OF device-tree to generate the linux PCI tree
instead of going directly to PCI probing. It's possible that this is
causing your problem if for some reason, the BAR sizing done by OF ends
up being different than what the kernel does ...

Ben.







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

end of thread, other threads:[~2005-11-04 22:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-04 21:27 pmac serial_pci_guess_board problem Geoff Levand
2005-11-04 21:47 ` Benjamin Herrenschmidt
2005-11-04 22:50   ` Russell King
2005-11-04 22:53     ` 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).