public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: pat@computer-refuge.org
Cc: rdreier@cisco.com, sparclinux@vger.kernel.org,
	linux-rdma@vger.kernel.org
Subject: Re: Sun V880 + Infiniband?
Date: Wed, 09 Dec 2009 01:39:55 -0800 (PST)	[thread overview]
Message-ID: <20091209.013955.262196704.davem@davemloft.net> (raw)
In-Reply-To: <200912030144.18971.pat@computer-refuge.org>

From: Patrick Finnegan <pat@computer-refuge.org>
Date: Thu, 3 Dec 2009 01:44:18 -0500

> On Wednesday 02 December 2009, David Miller wrote:
>> If there's something Linux isn't doing right, those dumps will help
>> me spot it.
> 
> Thanks again!

Please give this patch a try:

sparc64: Fix overly strict range type matching for PCI devices.

When we are trying to see if a range property entry applies
to a given address, we are overly strict about the type.

We should only allow I/O ranges for I/O addresses, and only allow
CONFIG space ranges for CONFIG space address.

However for MEM ranges, they come in 32-bit and 64-bit flavors.
And a lack of an exact match is OK if the range is 32-bit and
the address is 64-bit.  We can assign a 64-bit address properly
into a 32-bit parent range just fine.

So allow it.

Reported-by: Patrick Finnegan <pat@computer-refuge.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
 arch/sparc/kernel/of_device_64.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/arch/sparc/kernel/of_device_64.c b/arch/sparc/kernel/of_device_64.c
index 881947e..0a6f2d1 100644
--- a/arch/sparc/kernel/of_device_64.c
+++ b/arch/sparc/kernel/of_device_64.c
@@ -104,9 +104,19 @@ static int of_bus_pci_map(u32 *addr, const u32 *range,
 	int i;
 
 	/* Check address type match */
-	if ((addr[0] ^ range[0]) & 0x03000000)
-		return -EINVAL;
+	if (!((addr[0] ^ range[0]) & 0x03000000))
+		goto type_match;
+
+	/* Special exception, we can map a 64-bit address into
+	 * a 32-bit range.
+	 */
+	if ((addr[0] & 0x03000000) == 0x03000000 &&
+	    (range[0] & 0x03000000) == 0x02000000)
+		goto type_match;
+
+	return -EINVAL;
 
+type_match:
 	if (of_out_of_range(addr + 1, range + 1, range + na + pna,
 			    na - 1, ns))
 		return -EINVAL;
-- 
1.6.5


  parent reply	other threads:[~2009-12-09  9:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-02 15:45 Sun V880 + Infiniband? Patrick Finnegan
     [not found] ` <200912021045.02970.pat-bdq14YP6qtQCo4FBHZViTkB+6BGkLq7r@public.gmane.org>
2009-12-02 17:55   ` Roland Dreier
2009-12-02 22:42     ` David Miller
     [not found]       ` <20091202.144255.137848873.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2009-12-03  6:44         ` Patrick Finnegan
     [not found]           ` <4B177A9F.8010909@Sun.COM>
     [not found]             ` <4B177A9F.8010909-UdXhSnd/wVw@public.gmane.org>
2009-12-03  9:17               ` David Miller
2009-12-09  9:39           ` David Miller [this message]
     [not found]             ` <20091209.013955.262196704.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2009-12-09 19:29               ` Patrick Finnegan
     [not found]                 ` <200912091429.56117.pat-bdq14YP6qtQCo4FBHZViTkB+6BGkLq7r@public.gmane.org>
2009-12-10  1:20                   ` David Miller

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=20091209.013955.262196704.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=linux-rdma@vger.kernel.org \
    --cc=pat@computer-refuge.org \
    --cc=rdreier@cisco.com \
    --cc=sparclinux@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