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: <20001101153420.A2823@jurassic.park.msu.ru> <20001101093319.A18144@twiddle.net> <20001103111647.A8079@jurassic.park.msu.ru> <20001103011640.A20494@twiddle.net> <20001106192930.A837@jurassic.park.msu.ru>
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 --]
next parent reply other threads:[~2000-11-08 9:40 UTC|newest]
Thread overview: 22+ 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>
[not found] ` <20001106192930.A837@jurassic.park.msu.ru>
2000-11-08 9:39 ` Richard Henderson [this message]
2000-11-08 10:19 ` PCI-PCI bridges mess in 2.4.x Sean Hunter
2000-11-08 11:25 ` Ivan Kokshaysky
2000-11-08 17:37 ` Richard Henderson
2000-11-08 22:03 ` Ivan Kokshaysky
2000-11-08 22:43 ` Jeff Garzik
2000-11-08 23:49 ` Richard Henderson
2000-11-09 14:41 ` Ivan Kokshaysky
2000-11-08 23:48 ` Richard Henderson
2000-11-09 14:39 ` Ivan Kokshaysky
2000-11-09 20:37 ` Gérard Roudier
2000-11-09 23:17 ` Ivan Kokshaysky
2000-11-10 18:35 ` Gérard Roudier
2000-11-10 21:29 ` Ivan Kokshaysky
2000-11-10 21:26 ` Gérard Roudier
2000-11-08 15:56 ` Jeff Garzik
2000-11-08 17:20 ` Richard Henderson
[not found] ` <20001108113859.A10997@animx.eu.org>
[not found] ` <3A098594.A85DFE0D@mandrakesoft.com>
[not found] ` <20001108122306.A11107@animx.eu.org>
[not found] ` <3A0989CC.2537FCEA@mandrakesoft.com>
2000-11-09 16:33 ` Wakko Warner
2000-11-09 23:31 ` Michal Jaegermann
2000-11-10 10:52 ` Sean Hunter
2000-11-08 18:22 Dunlap, Randy
-- strict thread matches above, loose matches on Subject: below --
2000-11-09 16:36 Wakko Warner
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=20001108013931.A26972@twiddle.net \
--to=rth@twiddle.net \
--cc=axp-list@redhat.com \
--cc=ink@jurassic.park.msu.ru \
--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 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.