All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geoff Levand <geoffrey.levand@am.sony.com>
To: rmk+serial@arm.linux.org.uk
Cc: linux-serial@vger.kernel.org,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>
Subject: pmac serial_pci_guess_board problem
Date: Fri, 04 Nov 2005 13:27:05 -0800	[thread overview]
Message-ID: <436BD229.3090401@am.sony.com> (raw)

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.







             reply	other threads:[~2005-11-04 21:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-04 21:27 Geoff Levand [this message]
2005-11-04 21:47 ` pmac serial_pci_guess_board problem Benjamin Herrenschmidt
2005-11-04 22:50   ` Russell King
2005-11-04 22:53     ` Benjamin Herrenschmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=436BD229.3090401@am.sony.com \
    --to=geoffrey.levand@am.sony.com \
    --cc=benh@kernel.crashing.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=rmk+serial@arm.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.