mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
To: Grant Grundler <grundler@dsl2.external.hp.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Linux kernel mailing list <linux-kernel@vger.kernel.org>,
	Jeff Garzik <jgarzik@mandrakesoft.com>,
	"David S. Miller" <davem@redhat.com>
Subject: Re: PCI<->PCI bridges, transparent resource fix
Date: Thu, 8 Aug 2002 15:30:42 +0400	[thread overview]
Message-ID: <20020808153042.B14158@jurassic.park.msu.ru> (raw)
In-Reply-To: <20020807183025.BCB65482A@dsl2.external.hp.com>; from grundler@dsl2.external.hp.com on Wed, Aug 07, 2002 at 12:30:25PM -0600

On Wed, Aug 07, 2002 at 12:30:25PM -0600, Grant Grundler wrote:
> Send me a patch for 2.4.19 and I'll try it on the laptop.

Appended - please do.

> Ivan wrote:
> | ...subtractive decoding bridge _MUST_ have bit 0 in the ProgIf set to 1.
> 
> It sounds easy to check at the top and in that case DTRT.
> The "else" parts of later resource checks can go away.

Exactly.

> What you suggest implies the bridge waits for someone else to "claim"
> the transaction and I'm not convinced PCI spec would allow that.

It allows that as a matter of fact.

> Performance would certainly suffer if that were the case.

Sure, performance sucks, and there are other bad side effects,
like impossibility of the peer-to-peer DMA behind such bridge.

Ivan.

--- linux/drivers/pci/pci.c~	Fri Jun 28 14:46:21 2002
+++ linux/drivers/pci/pci.c	Thu Aug  8 14:57:25 2002
@@ -1073,6 +1073,14 @@ void __devinit pci_read_bridge_bases(str
 	if (!dev)		/* It's a host bus, nothing to read */
 		return;
 
+	if (dev->class & 1) {
+		printk("Subtractive decoding bridge %s -"
+			" assuming transparent\n", dev->name);
+		for(i = 0; i < 3; i++)
+			child->resource[i] = child->parent->resource[i];
+		return;
+	}
+
 	for(i=0; i<3; i++)
 		child->resource[i] = &dev->resource[PCI_BRIDGE_RESOURCES+i];
 
@@ -1095,13 +1103,6 @@ void __devinit pci_read_bridge_bases(str
 		res->start = base;
 		res->end = limit + 0xfff;
 		res->name = child->name;
-	} else {
-		/*
-		 * Ugh. We don't know enough about this bridge. Just assume
-		 * that it's entirely transparent.
-		 */
-		printk(KERN_ERR "Unknown bridge resource %d: assuming transparent\n", 0);
-		child->resource[0] = child->parent->resource[0];
 	}
 
 	res = child->resource[1];
@@ -1114,10 +1115,6 @@ void __devinit pci_read_bridge_bases(str
 		res->start = base;
 		res->end = limit + 0xfffff;
 		res->name = child->name;
-	} else {
-		/* See comment above. Same thing */
-		printk(KERN_ERR "Unknown bridge resource %d: assuming transparent\n", 1);
-		child->resource[1] = child->parent->resource[1];
 	}
 
 	res = child->resource[2];
@@ -1145,10 +1142,6 @@ void __devinit pci_read_bridge_bases(str
 		res->start = base;
 		res->end = limit + 0xfffff;
 		res->name = child->name;
-	} else {
-		/* See comments above */
-		printk(KERN_ERR "Unknown bridge resource %d: assuming transparent\n", 2);
-		child->resource[2] = child->parent->resource[2];
 	}
 }
 

  reply	other threads:[~2002-08-08 11:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20020806192951.7E6B44829@dsl2.external.hp.com>
2002-08-06 19:20 ` Benjamin Herrenschmidt
2002-08-07  5:54   ` Grant Grundler
2002-08-06 21:02     ` Benjamin Herrenschmidt
2002-08-07 18:30       ` Grant Grundler
2002-08-08 11:30         ` Ivan Kokshaysky [this message]
2002-08-09  7:07           ` Grant Grundler
2002-08-09  8:06           ` Benjamin Herrenschmidt
2002-08-09 17:16             ` Ivan Kokshaysky
     [not found] <20020807042402.A4840@jurassic.park.msu.ru>
2002-08-06 20:31 ` Benjamin Herrenschmidt
2002-08-07 16:03   ` Ivan Kokshaysky
2002-08-08  8:20     ` Benjamin Herrenschmidt
2002-08-08 13:21       ` Ivan Kokshaysky
2002-08-09  6:29         ` Benjamin Herrenschmidt
2002-08-09 17:01           ` Ivan Kokshaysky
2002-08-09 21:14             ` Benjamin Herrenschmidt
2002-08-06 18:44 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=20020808153042.B14158@jurassic.park.msu.ru \
    --to=ink@jurassic.park.msu.ru \
    --cc=benh@kernel.crashing.org \
    --cc=davem@redhat.com \
    --cc=grundler@dsl2.external.hp.com \
    --cc=jgarzik@mandrakesoft.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

all inboxes | Powered by JetHome®