* Re: PCI-PCI bridges mess in 2.4.x [not found] ` <20001103011640.A20494@twiddle.net> @ 2000-11-06 16:29 ` Ivan Kokshaysky 2000-11-07 1:03 ` Michal Jaegermann ` (2 more replies) 0 siblings, 3 replies; 16+ messages in thread From: Ivan Kokshaysky @ 2000-11-06 16:29 UTC (permalink / raw) To: Richard Henderson; +Cc: axp-list [-- Attachment #1: Type: text/plain, Size: 1211 bytes --] Cc'ed to axp-list in a hope that people could test this on alphas with pci-pci bridges - ruffians, noritakes etc. On Fri, Nov 03, 2000 at 01:16:40AM -0800, Richard Henderson wrote: > On Fri, Nov 03, 2000 at 11:16:47AM +0300, Ivan Kokshaysky wrote: > > I'll be gone for two or three days, so hopefully I'll have > > something for public review next week. > > I'll look forward to trying it on the rawhide. Quite likely there are some bugs in the patch - changes are large... Some details of this implementation: allocation of io/mem ranges starts from the root bus to child buses - reversed to the order you supposed, but technically it makes no difference. Almost everything is done in a single pass walking the bus tree - allocating device's resources, setting up bus ranges and initializing bridge's hardware. It turned out that except alpha, only arm and mips/ddb5074 are using support functions from drivers/pci/setup-xxx.c. This patch shouldn't break these platforms in a single-bus configuration, but to work with bridges they need additional fixes in the pcibios_fixup_bus()... Also cy82c693 code cleaned up a bit - moved to quirks and better documented. And compile fix for CLOCKS_PER_SEC. Ivan. [-- Attachment #2: bridges-2.4.0t10.gz --] [-- Type: application/x-gzip, Size: 7365 bytes --] ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: PCI-PCI bridges mess in 2.4.x 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 9:39 ` Richard Henderson 2000-11-09 4:45 ` Stephen Degler 2 siblings, 1 reply; 16+ messages in thread From: Michal Jaegermann @ 2000-11-07 1:03 UTC (permalink / raw) To: Ivan Kokshaysky; +Cc: Richard Henderson, axp-list On Mon, Nov 06, 2000 at 07:29:30PM +0300, Ivan Kokshaysky wrote: > Cc'ed to axp-list in a hope that people could test this > on alphas with pci-pci bridges - ruffians, noritakes etc. I am afraid that something is still missing. My machine is Ruffian (UX) with the following layout of PCI busses: -+-[10]-+-0a.0 Trident Microsystems 4DWave DX | \-0d.0 Symbios Logic Inc. (formerly NCR) 53c875 \-[00]-+-0d.0-[10-01]-- +-0e.0 Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II] +-0e.1 Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II] +-0f.0 Digital Equipment Corporation DECchip 21142/43 \-11.0 Texas Instruments TVP4020 [Permedia 2] and it works without any real troubles (minus this Trident soundcard) with current 2.2 kernels. When I am trying to boot 2.4.0-test10 kernel patched with your patch I see, among other things which look ok, these (a manual transcript from a screen): pci: cia revision 1 (pyxis) .......... pci: passed tb register update test pci: passed sg loopback i/o read test pci: passed tbia test pci: passed pte write cache snoop test pci: failed valid tag invalid pte reload test (mcheck; workaround available) pci: passed pci machine check test PCI: Bus 1, bridge: Digital Equipement Corporation DECchip 21052 IO window: 9000-9fff MEM window: 0a100000-0a1fffff Activating ISA DMA workarounds ......... hda: IBM-DJNA-370910, ATA DISK drive ide0 at 0x1f0-0x1f7,0x3f6 on irq 14 hda: 17893440 sectors (9115 MB) w/1966KiB Cache, CHS=17662/16/63,(U)DMA Partition check: hda: unknown partition table ......... sym53c876-0: on-chip RAM at 0xa101000 CACHE TEST FAILED: script execution failed. start=4fe38dd8, pc=ffffffff, end=4fe38df8 CACHE INCORRECTLY CONFIGURED. sym53c876-0: giving up ... .......... Kernel panic: VFS: Unable to mount root fs on 08:02 Apart of inability to mount a root file system things which stand out are a misdetection of a SCSI controller (it _is_ sym53c875, as reported by 'lspci' above, and not sym53c876) and "unknown partition table" on hda. The later implies that even if I would arrange for a root file system on some partition of hda I would likely also fail to boot. In case somebody wonders, yes, I do have in my .config CONFIG_OSF_PARTITION=y but 'hda' does not even have a partioning of that type but a plain FAT partition table. I am not that far yet to worry about this point. I did not try this kernel without "bridges" patch but my attempts to boot in the past looked similar. Michal ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: PCI-PCI bridges mess in 2.4.x 2000-11-07 1:03 ` Michal Jaegermann @ 2000-11-07 13:12 ` Ivan Kokshaysky 2000-11-08 1:32 ` Michal Jaegermann 0 siblings, 1 reply; 16+ messages in thread From: Ivan Kokshaysky @ 2000-11-07 13:12 UTC (permalink / raw) To: Michal Jaegermann; +Cc: Richard Henderson, axp-list On Mon, Nov 06, 2000 at 06:03:32PM -0700, Michal Jaegermann wrote: > PCI: Bus 1, bridge: Digital Equipement Corporation DECchip 21052 > IO window: 9000-9fff > MEM window: 0a100000-0a1fffff This looks ok. > In case somebody wonders, yes, I do have in my .config > CONFIG_OSF_PARTITION=y > but 'hda' does not even have a partioning of that type but a plain > FAT partition table. In this case you should also have CONFIG_MSDOS_PARTITION=y For now I don't know what's wrong with scsi controller. It would be great if you could boot from the ide disk and see whether other devices behind the bridge are working. Thanks for testing. Ivan. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: PCI-PCI bridges mess in 2.4.x 2000-11-07 13:12 ` Ivan Kokshaysky @ 2000-11-08 1:32 ` Michal Jaegermann 0 siblings, 0 replies; 16+ messages in thread From: Michal Jaegermann @ 2000-11-08 1:32 UTC (permalink / raw) To: Ivan Kokshaysky; +Cc: Richard Henderson, axp-list [-- Attachment #1: Type: text/plain, Size: 4139 bytes --] OK, so I booted after all UX with 2.4.0-test10, patched with a patch from Ivan - of course, but mounting things only from an IDE disk and not SCSI (a used kernel still resided on a SCSI device as it was read only by milo :-). Here are some pieces of boot messages (reformatted). The complete record is attached below: Linux version 2.4.0-test10 (root@toaster.home.front) (gcc version 2.95.2 19991024 (release)) #7 Tue Nov 7 08:24:49 MST 2000 Booting GENERIC on Ruffian using machine vector Ruffian from MILO Command line: bootdevice=sda2 bootfile=/vml240t10.gz root=/dev/hda2 sym53c8xx=safe:y ¸« .... PIIX3: not 100% native mode: will probe irqs later ide0: BM-DMA at 0x8080-0x8087, BIOS settings: hda:DMA, hdb:DMA hda: IBM-DJNA-370910, ATA DISK drive ide0 at 0x1f0-0x1f7,0x3f6 on irq 14 hda: 17803440 sectors (9115 MB) w/1966KiB Cache, CHS=17662/16/63, (U)DMA Partition check: hda: hda1 hda2 hda3 hda4 ... SCSI subsystem driver Revision: 1.00 sym53c8xx: setup=disc:n,specf:0,ultra:0,tags:0,sync:255,burst:255, wide:n,diff:1,revprob:n,buschk:0x1 sym53c8xx: setup=mpar:n,spar:y,fsn=n,verb:2,debug:0x0,led:n,settle:10, irqm:0x1,nvram:0x1,pcifix:0x0 sym53c8xx: at PCI bus 1, device 13, function 0 sym53c8xx: 53c875 detected sym53c875-0: rev 0x3 on pci bus 1 device 13 function 0 irq 20 sym53c875-0: clock multiplier found sym53c875-0: ID 7, Fast-10, Parity Checking, Differential sym53c875-0: initial SCNTL3/DMODE/DCNTL/CTEST3/4/5 = (hex) 07/ce/a8/01/80/24 sym53c875-0: final SCNTL3/DMODE/DCNTL/CTEST3/4/5 = (hex) 05/00/08/00/80/00 CACHE TEST FAILED: script execution failed. start=4fe34dd8, pc=ffffffff, end=4fe34df8 CACHE INCORRECTLY CONFIGURED. sym53c875-0: giving up ... This time sym53c875 was correctly detected (with rev 0x3) but on other occasion I managed to boot as well and then I got (rev 0xff this time): sym53c8xx: at PCI bus 1, device 13, function 0 sym53c8xx: 53c876 detected sym53c876-0: rev 0xff on pci bus 1 device 13 function 0 irq 20 sym53c876-0: clock multiplier found sym53c876-0: ID 7, Fast-10, Parity Checking, Differential sym53c876-0: initial SCNTL3/DMODE/DCNTL/CTEST3/4/5 = (hex) 07/ce/a8/01/80/24 sym53c876-0: final SCNTL3/DMODE/DCNTL/CTEST3/4/5 = (hex) 05/00/08/00/80/00 CACHE TEST FAILED: script execution failed. start=4fe34dd8, pc=ffffffff, end=4fe34df8 CACHE INCORRECTLY CONFIGURED. sym53c876-0: giving up ... so the correct detection is not a requirement or a solution. First for good news. Once booted other PCI devices show up correctly -[00]-+-0d.0-[01]--+-0a.0 Trident Microsystems 4DWave DX | \-0d.0 Symbios Logic Inc. (formerly NCR) 53c875 +-0e.0 Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II] +-0e.1 Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II] +-0f.0 Digital Equipment Corporation DECchip 21142/43 \-11.0 Texas Instruments TVP4020 [Permedia 2] and, in particular a network card on 00:0f.0 works, can be configured, and communicates. And not so good news. You notice 'sym53c8xx=safe:y ¸«'. The garbage at the end of this string is not typed by me but inserted by kernel. Some problems with a parsing of a command line. 'sym53c8xx=safe:y' seems to be essential. Without this argument I did not manage to boot even once. It looks like that something is stomping heavily on a memory. In particular I did not manage to boot _once_ on the first try from a power-up or after a reset. Usually it was possible to boot on the second try. Third and fourth were causing either "abort/reset" cycle from a SCSI controller trying to configure itself or machine lockups either immediately after this line sym53c875-0: rev 0x3 on pci bus 1 device 13 function 0 irq 20 or a bit later. Some lockups were accompanied by a video corruption with patterns of rectangles in various colours at the bottom of my screen. Without 'sym53c8xx=safe:y' I had always either "abort/reset" loop or a lockup in some moment. If you would like to look at details I attach below full dmesg output from one succesful boot, and output from 'lspci -vvx', listing of /proc/bus and results of 'cat /proc/bus/pci/devices'. Michal [-- Attachment #2: dmesg.gz --] [-- Type: application/x-gunzip, Size: 2287 bytes --] [-- Attachment #3: pcibus.long.gz --] [-- Type: application/x-gunzip, Size: 1342 bytes --] [-- Attachment #4: proc.bus.gz --] [-- Type: application/x-gunzip, Size: 93 bytes --] [-- Attachment #5: proc.devices.gz --] [-- Type: application/x-gunzip, Size: 240 bytes --] ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: PCI-PCI bridges mess in 2.4.x 2000-11-06 16:29 ` PCI-PCI bridges mess in 2.4.x Ivan Kokshaysky 2000-11-07 1:03 ` Michal Jaegermann @ 2000-11-08 9:39 ` Richard Henderson 2000-11-08 11:25 ` Ivan Kokshaysky [not found] ` <3A0977A7.53641C52@mandrakesoft.com> 2000-11-09 4:45 ` Stephen Degler 2 siblings, 2 replies; 16+ messages in thread From: Richard Henderson @ 2000-11-08 9:39 UTC (permalink / raw) To: Ivan Kokshaysky; +Cc: axp-list, linux-kernel [-- 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 --] ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: PCI-PCI bridges mess in 2.4.x 2000-11-08 9:39 ` Richard Henderson @ 2000-11-08 11:25 ` Ivan Kokshaysky 2000-11-08 17:37 ` Richard Henderson [not found] ` <3A0977A7.53641C52@mandrakesoft.com> 1 sibling, 1 reply; 16+ messages in thread From: Ivan Kokshaysky @ 2000-11-08 11:25 UTC (permalink / raw) To: Richard Henderson; +Cc: axp-list, linux-kernel On Wed, Nov 08, 2000 at 01:39:31AM -0800, Richard Henderson wrote: > * Replace cropped found_vga detection code. I wonder where could I lose this, it was in place initially :-) > + /* ??? 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. */ I relied on DEC^WIntel 21153 datasheet which says that to turn off io/mem window this bridge must be programmed with base > limit values (and the code actually did that). But this could be wrong for other bridges. OTOH, we turn off prefetchable memory range this way in 2.2, and it works... Thanks for the patch, Ivan. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: PCI-PCI bridges mess in 2.4.x 2000-11-08 11:25 ` Ivan Kokshaysky @ 2000-11-08 17:37 ` Richard Henderson 2000-11-08 22:03 ` Ivan Kokshaysky 0 siblings, 1 reply; 16+ messages in thread From: Richard Henderson @ 2000-11-08 17:37 UTC (permalink / raw) To: Ivan Kokshaysky; +Cc: axp-list, linux-kernel On Wed, Nov 08, 2000 at 02:25:13PM +0300, Ivan Kokshaysky wrote: > I relied on DEC^WIntel 21153 datasheet which says that to turn off > io/mem window this bridge must be programmed with base > limit > values (and the code actually did that). Interesting. I hadn't known that. It didn't actually fail with the ALI bridge, I just assumed it was a mistake. Can anyone with docs on non-DEC bridges confirm that this is a common thing? Certainly the fact should be commented if the old code goes back in to avoid disruption by helpful folks like myself. :-) r~ ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: PCI-PCI bridges mess in 2.4.x 2000-11-08 17:37 ` Richard Henderson @ 2000-11-08 22:03 ` Ivan Kokshaysky 2000-11-08 23:48 ` Richard Henderson [not found] ` <3A09D72A.C2730D0@mandrakesoft.com> 0 siblings, 2 replies; 16+ messages in thread From: Ivan Kokshaysky @ 2000-11-08 22:03 UTC (permalink / raw) To: Richard Henderson; +Cc: axp-list, linux-kernel On Wed, Nov 08, 2000 at 09:37:44AM -0800, Richard Henderson wrote: > Interesting. I hadn't known that. It didn't actually fail with > the ALI bridge, I just assumed it was a mistake. Can anyone with > docs on non-DEC bridges confirm that this is a common thing? It would be better if someone who has "PCI-to-PCI Bridge Architecture Specification" handy could confirm this. Non-conforming hardware must live in quirks/fixups etc. ;-) I've found some interesting info today - application note on programming the DEC 21052 bridge (ruffian has this chip, btw): http://download.sourceforge.net/mirrors/NetBSD/misc/dec-docs/ec-qlzba-te.ps.gz Particularly, there are examples for setting up that bridge for IO or MEM only configurations. For example, with IO disabled: 1. Set IO base = 0xffff, limit = 0 2. Set command register = PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER > Certainly the fact should be commented if the old code goes back > in to avoid disruption by helpful folks like myself. :-) That change wasn't bad at all - at least it's 100% safe :-) But of course, it would be better to have unused regions disabled in a clean way. But actually I'm concerned that all this code doesn't work at all - see reports from Michal Jaegermann (the bridge acts as if it drops config space transactions randomly). I have a lot of suggestions, but it's a pain to debug something without access to real hardware - just a waste of the precious time of everyone who is involved... So I would probably wait a week or two until I'll have something with bridges:-( Ivan. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: PCI-PCI bridges mess in 2.4.x 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] ` <3A09D72A.C2730D0@mandrakesoft.com> 1 sibling, 2 replies; 16+ messages in thread From: Richard Henderson @ 2000-11-08 23:48 UTC (permalink / raw) To: Ivan Kokshaysky; +Cc: axp-list, linux-kernel On Thu, Nov 09, 2000 at 01:03:36AM +0300, Ivan Kokshaysky wrote: > But actually I'm concerned that all this code doesn't work at all - > see reports from Michal Jaegermann (the bridge acts as if it drops > config space transactions randomly). I have no idea what Michal is seeing. It does, however, work just dandy on my rawhide: -+-[01]-+-01.0 | +-02.0-[02]----00.0 | +-04.0 | \-04.1 \-[00]-+-01.0 +-02.0 \-05.0 01:02.0 PCI bridge: Digital Equipment Corporation DECchip 21050 (rev 02) \ (prog-if 00 [Normal decode]) Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- \ Stepping- SERR- FastB2B- Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- \ <TAbort- <MAbort- >SERR- <PERR- Latency: 248, cache line size 10 Bus: primary=01, secondary=02, subordinate=02, sec-latency=0 I/O behind bridge: 00009000-00009fff Memory behind bridge: 02300000-023fffff BridgeCtl: Parity- SERR- NoISA+ VGA- MAbort- >Reset- FastB2B- 02:00.0 SCSI storage controller: Q Logic ISP1020 (rev 02) Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr+ \ Stepping- SERR+ FastB2B- Status: Cap- 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- \ <TAbort- <MAbort- >SERR- <PERR- Latency: 248, cache line size 10 Interrupt: pin A routed to IRQ 40 Region 0: I/O ports at 200009000 [size=256] Region 1: Memory at 0000000202310000 (32-bit, non-prefetchable) [size=4K] Expansion ROM at 0000000202300000 [disabled] [size=64K] Whee! We're back in Bootsville. r~ ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: PCI-PCI bridges mess in 2.4.x 2000-11-08 23:48 ` Richard Henderson @ 2000-11-09 0:44 ` Michal Jaegermann 2000-11-09 14:39 ` Ivan Kokshaysky 1 sibling, 0 replies; 16+ messages in thread From: Michal Jaegermann @ 2000-11-09 0:44 UTC (permalink / raw) To: axp-list On Wed, Nov 08, 2000 at 03:48:11PM -0800, Richard Henderson wrote: > On Thu, Nov 09, 2000 at 01:03:36AM +0300, Ivan Kokshaysky wrote: > > But actually I'm concerned that all this code doesn't work at all - > > see reports from Michal Jaegermann (the bridge acts as if it drops > > config space transactions randomly). > > I have no idea what Michal is seeing. Nothing particularly exciting. :-) I will send you few samples not through the list. > It does, however, work > just dandy on my rawhide: It works just fine on my box as well - the catch is that with 2.2 kernels and not with 2.4. Michal ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: PCI-PCI bridges mess in 2.4.x 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> 1 sibling, 1 reply; 16+ messages in thread From: Ivan Kokshaysky @ 2000-11-09 14:39 UTC (permalink / raw) To: Richard Henderson; +Cc: axp-list, linux-kernel On Wed, Nov 08, 2000 at 03:48:11PM -0800, Richard Henderson wrote: > Whee! We're back in Bootsville. Cool! Meanwhile this base/limit stuff got confirmation :-) Here is a patch against bridges-2.4.0t11-rth. Ivan. --- 2.4.0t11p1/drivers/pci/setup-bus.c Wed Nov 8 19:44:42 2000 +++ linux/drivers/pci/setup-bus.c Thu Nov 9 15:11:01 2000 @@ -88,14 +88,14 @@ pbus_assign_resources_sorted(struct pci_ 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; + /* Interesting case is when, say, io_end == io_start, i.e. + there is no I/O behind the bridge at all. We initialize + the bridge with base=io_start and limit=io_end-1, so + in this case we'll have base > limit. According to + the `PCI-to-PCI Bridge Architecture Specification', this + means that the bridge will not forward any I/O transactions + from the primary bus to the secondary bus and will forward + all I/O transactions upstream. Exactly what we want. */ ranges->io_end = ROUND_UP(ranges->io_end, 4*1024); ranges->mem_end = ROUND_UP(ranges->mem_end, 1024*1024); ^ permalink raw reply [flat|nested] 16+ messages in thread
[parent not found: <Pine.LNX.4.10.10011092123320.1438-100000@linux.local>]
* Re: PCI-PCI bridges mess in 2.4.x [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> 0 siblings, 1 reply; 16+ messages in thread From: Ivan Kokshaysky @ 2000-11-09 23:17 UTC (permalink / raw) To: Gerard Roudier; +Cc: Richard Henderson, axp-list, linux-kernel On Thu, Nov 09, 2000 at 09:37:41PM +0100, Gerard Roudier wrote: > Hmmm... > The PCI spec. says that Limit registers define the top addresses > _inclusive_. Correct. > The spec. does not seem to imagine that a Limit register lower than the > corresponding Base register will ever exist anywhere, in my opinion. :-) Not correct. Here's a quote from `PCI-to-PCI Bridge Architecture Specification rev 1.1': The Memory Limit register _must_ be programmed to a smaller value than the Memory Base if there are no memory-mapped I/O addresses on the secondary side of the bridge. I/O is slightly different because it's optional for the bridge - but if it's implemented same rules apply. > This let me think that trying to be clever here is probably a very bad > idea. What is so catastrophic of having 1 to 4 bytes of addresses and no > more being possibly in a forwardable range? > Huh. 1 to 4 bytes? 4K for I/O and 1M for memory. And it's not trying to be clever (anymore :-) - just strictly following the Specs. I understand your point very well, btw. I asked similar questions to myself until I've had the docs. Ivan. ^ permalink raw reply [flat|nested] 16+ messages in thread
[parent not found: <Pine.LNX.4.10.10011101929190.1448-100000@linux.local>]
* Re: PCI-PCI bridges mess in 2.4.x [not found] ` <Pine.LNX.4.10.10011101929190.1448-100000@linux.local> @ 2000-11-10 21:29 ` Ivan Kokshaysky 0 siblings, 0 replies; 16+ messages in thread From: Ivan Kokshaysky @ 2000-11-10 21:29 UTC (permalink / raw) To: Gerard Roudier; +Cc: Richard Henderson, axp-list, linux-kernel On Fri, Nov 10, 2000 at 07:35:41PM +0100, Gerard Roudier wrote: > I only have spec 1.0 on paper. I should have checked 1.1. Anyway, it may > still exist bridges that have been designed prior to spec. 1.1. Yes, DEC 2105x bridges, for example. The only update listed in revision history is "Update to include target initial latency requirements", so this (base > limit) stuff must be in rev. 1.0 as well. Please check chapters 3.2.5.[6,8,9]. > > > I/O is slightly different because it's optional for the bridge - > > but if it's implemented same rules apply. > > Will also check the spec. on this point. :) Also, according the spec, we need some paranoia checks ;-) 1. check if the bridge has an I/O window not implemented 2. if the bridge has regular BARs, allocate them properly on the primary bus. Ivan. ^ permalink raw reply [flat|nested] 16+ messages in thread
[parent not found: <3A09D72A.C2730D0@mandrakesoft.com>]
* Re: PCI-PCI bridges mess in 2.4.x [not found] ` <3A09D72A.C2730D0@mandrakesoft.com> @ 2000-11-08 23:49 ` Richard Henderson 0 siblings, 0 replies; 16+ messages in thread From: Richard Henderson @ 2000-11-08 23:49 UTC (permalink / raw) To: Jeff Garzik; +Cc: Ivan Kokshaysky, axp-list, linux-kernel On Wed, Nov 08, 2000 at 05:43:54PM -0500, Jeff Garzik wrote: > FWIW, I just tested rth's update of your path on my x86 SMP box, and a > laptop with two CardBus bridges (two CardBus slots). Both worked > fine... x86 doesn't use this code at all. Only alpha, arm, and mips. r~ ^ permalink raw reply [flat|nested] 16+ messages in thread
[parent not found: <3A0977A7.53641C52@mandrakesoft.com>]
* Re: PCI-PCI bridges mess in 2.4.x [not found] ` <3A0977A7.53641C52@mandrakesoft.com> @ 2000-11-08 17:20 ` Richard Henderson 0 siblings, 0 replies; 16+ messages in thread From: Richard Henderson @ 2000-11-08 17:20 UTC (permalink / raw) To: Jeff Garzik; +Cc: Ivan Kokshaysky, axp-list, linux-kernel On Wed, Nov 08, 2000 at 10:56:23AM -0500, Jeff Garzik wrote: > Setting bit 1 in dev->resource[x].start, below, seems incorrect. Should > you be programming the PCI BAR directly, instead? No, that's the reason this is a quirk. The hardware is already only responding to one and only one address. The old code did exactly the same thing, only not inside the quirk framework, which made it kinda harder to figure out what was going on. > I wonder about this code: > > > + /* ??? Reserve some resources for CardBus */ > > + if (dev->class >> 8 == PCI_CLASS_BRIDGE_CARDBUS) { > > + io_reserved += 8*1024; > > + mem_reserved += 32*1024*1024; > > + continue; > > + } Got a better suggestion? It does seem completely reasonable to reserve some address space for a CardBus bridge if we find one. r~ ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: PCI-PCI bridges mess in 2.4.x 2000-11-06 16:29 ` PCI-PCI bridges mess in 2.4.x Ivan Kokshaysky 2000-11-07 1:03 ` Michal Jaegermann 2000-11-08 9:39 ` Richard Henderson @ 2000-11-09 4:45 ` Stephen Degler 2 siblings, 0 replies; 16+ messages in thread From: Stephen Degler @ 2000-11-09 4:45 UTC (permalink / raw) To: axp-list Hi, I have a Miata and did not have a problem with 2.4.0-test10. I applied your patch and things still seem stable. % /sbin/lspci -tv -[00]-+-03.0 Digital Equipment Corporation DECchip 21142/43 +-04.0 CMD Technology Inc PCI0646 +-07.0 Intel Corporation 82378IB [SIO ISA Bridge] +-08.0-[01-02]--+-09.0-[02]--+-04.0 Digital Equipment Corporation DECchip 21142/43 | | +-05.0 Digital Equipment Corporation DECchip 21142/43 | | +-06.0 Digital Equipment Corporation DECchip 21142/43 | | \-07.0 Digital Equipment Corporation DECchip 21142/43 | +-0a.0 Symbios Logic Inc. (formerly NCR) 53c896 | \-0a.1 Symbios Logic Inc. (formerly NCR) 53c896 \-0b.0 Matrox Graphics, Inc. MGA 2164W [Millennium II] OTOH, the tulip driver in 2.4.0-test10 is completely toxic for me. It seems to mess with other resources such that I drop into the ">>> prompt" if I generate an interrupt on the pc keyboard or ide cdrom. The tulip driver works fine though if I don't generate one of those interrupts ??!! The de4x5 driver works fine except that I haven't been able to convince it to go full duplex. Hope this helps, skd ^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2000-11-10 21:34 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[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
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
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox