Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: axp-list@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: PCI-PCI bridges mess in 2.4.x
Date: Wed, 8 Nov 2000 01:39:31 -0800	[thread overview]
Message-ID: <20001108013931.A26972@twiddle.net> (raw)
In-Reply-To: <20001106192930.A837@jurassic.park.msu.ru>

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

[ For l-k, the issue is that pci-pci bridges and the devices behind
  them are not initialized properly.  There are a number of Alphas
  whose built-in scsi controlers are behind such a bridge preventing
  these machines from booting at all.  Ivan provided an initial 
  patch to solve this issue.  ]

I've not gotten a chance to try this on the rawhide yet,
but I did give it a whirl on my up1000, which does have
an agp bridge that acts like a pci bridge.

Notable changes from your patch:

  * Use kmalloc, not vmalloc.  (ouch!)
  * Replace cropped found_vga detection code.
  * Handle bridges with empty I/O (or MEM) ranges.
  * Collect the proper width of the bus range.


r~

[-- Attachment #2: diff vs bridges-2.4.0t10 --]
[-- Type: text/plain, Size: 2676 bytes --]

diff -rup linux/drivers/pci/setup-bus.c 2.4.0-11-1/drivers/pci/setup-bus.c
--- linux/drivers/pci/setup-bus.c	Wed Nov  8 01:24:16 2000
+++ 2.4.0-11-1/drivers/pci/setup-bus.c	Wed Nov  8 01:04:17 2000
@@ -20,7 +20,7 @@
 #include <linux/errno.h>
 #include <linux/ioport.h>
 #include <linux/cache.h>
-#include <linux/vmalloc.h>
+#include <linux/slab.h>
 
 
 #define DEBUG_CONFIG 1
@@ -56,31 +56,50 @@ pbus_assign_resources_sorted(struct pci_
 			mem_reserved += 32*1024*1024;
 			continue;
 		}
+
+		if (dev->class >> 8 == PCI_CLASS_DISPLAY_VGA)
+			found_vga = 1;
+
 		pdev_sort_resources(dev, &head_io, IORESOURCE_IO);
 		pdev_sort_resources(dev, &head_mem, IORESOURCE_MEM);
 	}
+
 	for (list = head_io.next; list;) {
 		res = list->res;
 		idx = res - &list->dev->resource[0];
-		if (pci_assign_resource(list->dev, idx) == 0)
+		if (pci_assign_resource(list->dev, idx) == 0
+		    && ranges->io_end < res->end)
 			ranges->io_end = res->end;
 		tmp = list;
 		list = list->next;
-		vfree(tmp);
+		kfree(tmp);
 	}
 	for (list = head_mem.next; list;) {
 		res = list->res;
 		idx = res - &list->dev->resource[0];
-		if (pci_assign_resource(list->dev, idx) == 0)
+		if (pci_assign_resource(list->dev, idx) == 0
+		    && ranges->mem_end < res->end)
 			ranges->mem_end = res->end;
 		tmp = list;
 		list = list->next;
-		vfree(tmp);
+		kfree(tmp);
 	}
+
 	ranges->io_end += io_reserved;
 	ranges->mem_end += mem_reserved;
+
+	/* ??? How to turn off a bus from responding to, say, I/O at
+	   all if there are no I/O ports behind the bus?  Turning off
+	   PCI_COMMAND_IO doesn't seem to do the job.  So we must
+	   allow for at least one unit.  */
+	if (ranges->io_end == ranges->io_start)
+		ranges->io_end += 1;
+	if (ranges->mem_end == ranges->mem_start)
+		ranges->mem_end += 1;
+
 	ranges->io_end = ROUND_UP(ranges->io_end, 4*1024);
 	ranges->mem_end = ROUND_UP(ranges->mem_end, 1024*1024);
+
 	return found_vga;
 }
 
diff -rup linux/drivers/pci/setup-res.c 2.4.0-11-1/drivers/pci/setup-res.c
--- linux/drivers/pci/setup-res.c	Wed Nov  8 01:24:16 2000
+++ 2.4.0-11-1/drivers/pci/setup-res.c	Wed Nov  8 00:21:13 2000
@@ -22,10 +22,10 @@
 #include <linux/errno.h>
 #include <linux/ioport.h>
 #include <linux/cache.h>
-#include <linux/vmalloc.h>
+#include <linux/slab.h>
 
 
-#define DEBUG_CONFIG 0
+#define DEBUG_CONFIG 1
 #if DEBUG_CONFIG
 # define DBGC(args)     printk args
 #else
@@ -146,7 +146,7 @@ pdev_sort_resources(struct pci_dev *dev,
 			if (ln)
 				size = ln->res->end - ln->res->start;
 			if (r->end - r->start > size) {
-				tmp = vmalloc(sizeof(*tmp));
+				tmp = kmalloc(sizeof(*tmp), GFP_KERNEL);
 				tmp->next = ln;
 				tmp->res = r;
 				tmp->dev = dev;

[-- Attachment #3: diff vs test11-1 --]
[-- Type: application/octet-stream, Size: 7521 bytes --]

  parent reply	other threads:[~2000-11-08  9:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20001101153420.A2823@jurassic.park.msu.ru>
     [not found] ` <20001101093319.A18144@twiddle.net>
     [not found]   ` <20001103111647.A8079@jurassic.park.msu.ru>
     [not found]     ` <20001103011640.A20494@twiddle.net>
2000-11-06 16:29       ` PCI-PCI bridges mess in 2.4.x Ivan Kokshaysky
2000-11-07  1:03         ` Michal Jaegermann
2000-11-07 13:12           ` Ivan Kokshaysky
2000-11-08  1:32             ` Michal Jaegermann
2000-11-08  9:39         ` Richard Henderson [this message]
2000-11-08 11:25           ` Ivan Kokshaysky
2000-11-08 17:37             ` Richard Henderson
2000-11-08 22:03               ` Ivan Kokshaysky
2000-11-08 23:48                 ` Richard Henderson
2000-11-09  0:44                   ` Michal Jaegermann
2000-11-09 14:39                   ` Ivan Kokshaysky
     [not found]                     ` <Pine.LNX.4.10.10011092123320.1438-100000@linux.local>
2000-11-09 23:17                       ` Ivan Kokshaysky
     [not found]                         ` <Pine.LNX.4.10.10011101929190.1448-100000@linux.local>
2000-11-10 21:29                           ` Ivan Kokshaysky
     [not found]                 ` <3A09D72A.C2730D0@mandrakesoft.com>
2000-11-08 23:49                   ` Richard Henderson
     [not found]           ` <3A0977A7.53641C52@mandrakesoft.com>
2000-11-08 17:20             ` Richard Henderson
2000-11-09  4:45         ` Stephen Degler
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox