public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: yadviga <yadviga@ru.mvista.com>
To: Linux Kernel ML <linux-kernel@vger.kernel.org>
Subject: [PATCH] large pci adress space in pci/probe.c for linux-2.6.18
Date: Mon, 20 Nov 2006 18:38:33 +0300	[thread overview]
Message-ID: <4561CBF9.CA21F786@ru.mvista.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 647 bytes --]

This is a request from Cisco to update pci address space for 64-bit mips
Cavium Octeon.

The size returned by a 4GB or greater sized BAR register returns zero
which made the algorithm in pci_read_bases() hit a continue instead of
continuing to read the upper 32-bits of the address space. I needed to
add the code to check if it was a 64-bit memory space by checking the
relevant lower bits, in which case the lower 32-bits of the size are
0xffffffff by the way they calculate size. As far as I can tell this has
still not been fixed in the latest release of Linux which is 2.6.18. I
guess no one has
encountered such a large BAR register yet.




[-- Attachment #2: pci_probe_2.6.18.2.patch --]
[-- Type: text/plain, Size: 781 bytes --]

--- linux/drivers/pci/probe.c	Sat Nov  4 04:33:58 2006
+++ linux-2.6.18.2/drivers/pci/probe.c	Fri Nov 17 19:13:31 2006
@@ -165,8 +165,18 @@
 			l = 0;
 		if ((l & PCI_BASE_ADDRESS_SPACE) == PCI_BASE_ADDRESS_SPACE_MEMORY) {
 			sz = pci_size(l, sz, (u32)PCI_BASE_ADDRESS_MEM_MASK);
-			if (!sz)
-				continue;
+			if (!sz) {
+				/* if BAR space is over 4GB we need to make sure that
+				   we don't bail out if the size is zero */
+				if ((l &
+				    (PCI_BASE_ADDRESS_SPACE | PCI_BASE_ADDRESS_MEM_TYPE_MASK))
+				    == (PCI_BASE_ADDRESS_SPACE_MEMORY |
+				    PCI_BASE_ADDRESS_MEM_TYPE_64)) {
+					    sz = 0xffffffff;
+				} else {
+					continue;
+				}
+			}
 			res->start = l & PCI_BASE_ADDRESS_MEM_MASK;
 			res->flags |= l & ~PCI_BASE_ADDRESS_MEM_MASK;
 		} else {

             reply	other threads:[~2006-11-20 15:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-20 15:38 yadviga [this message]
2006-11-20 15:59 ` [PATCH] large pci adress space in pci/probe.c for linux-2.6.18 Yinghai Lu

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=4561CBF9.CA21F786@ru.mvista.com \
    --to=yadviga@ru.mvista.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox