From owner-freebsd-hardware Fri Aug 30 23:42:21 2002 Delivered-To: freebsd-hardware@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7746837B400 for ; Fri, 30 Aug 2002 23:41:20 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6CCF143E42 for ; Fri, 30 Aug 2002 23:41:19 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id GAA03180 for ; Sat, 31 Aug 2002 06:41:13 GMT Date: Sat, 31 Aug 2002 16:48:20 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: hardware@freebsd.org Subject: PCI latency timer vs interrupt latency and ISA bus latency Message-ID: <20020831160511.O3960-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hardware@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Debugging of interrupt latency caused by critical_enter() showed that DELAY(2) sometimes delayed for 170 or more usec for an Athlon1600 CPU overclocked on an ASUS A7V266-E motherboard, apparently due to the 3 ISA i/o's done in getit() taking 170+ usec altogether. _Increasing_ the PCI latency timeout significantly reduced the getit() latency. I first increased it from 32 to 64 and then 96 in the BIOS (96 worked significantly better) and then increased it for individual PCI devices using pciconf (increasing it to 96 for fxp0 was enough). Not overclocking helpd a little. I would have thought that increasing the latency timeouts would have increased ISA bus latency. The large ISA latency doesn't seem to occur often. My theory is that it often occurs for fxp because fxp_start() calls DELAY(2) and fxp_start() is called just before fxp DMA completes if fxp's latency timeout is small but not if it is large. The default latency timeout seems to be out of spec for some devices including fxp, especially when everything is overclocked: %%% Copyright (c) 1992-2002 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD 5.0-CURRENT #1653: Wed Aug 28 20:20:38 EST 2002 bde@besplex.bde.org:/c/obj/usr/src/sys/compile/BESPLEX Preloaded elf kernel "kernel" at 0xc0336760. Calibrating clock(s) ... TSC clock: 1532744548 Hz, i8254 clock: 1193120 Hz Press a key on the console to abort clock calibration Calibrating clock(s) ... new getit_delta_max = 3900 nsec new getit_delta_max = 3907 nsec new getit_delta_max = 3912 nsec TSC clock: 1532480726 Hz, i8254 clock: 1193129 Hz Calibrating clock(s) ... TSC clock: 1532744631 Hz, i8254 clock: 1193121 Hz Calibrating clock(s) ... TSC clock: 1532744631 Hz, i8254 clock: 1193121 Hz Calibrating clock(s) ... TSC clock: 1532758743 Hz, i8254 clock: 1193131 Hz Calibrating clock(s) ... TSC clock: 1532744631 Hz, i8254 clock: 1193121 Hz Calibrating clock(s) ... TSC clock: 1532758743 Hz, i8254 clock: 1193131 Hz Calibrating clock(s) ... TSC clock: 1532758743 Hz, i8254 clock: 1193131 Hz Timecounter "i8254" frequency 1193120 Hz Timecounter "TSC" frequency 1532758743 Hz CPU: AMD Athlon(TM) XP1600+ (1532.76-MHz 686-class CPU) Origin = "AuthenticAMD" Id = 0x662 Stepping = 2 Features=0x383f9ff AMD Features=0xffffffffc0480000 Data TLB: 32 entries, fully associative Instruction TLB: 16 entries, fully associative L1 data cache: 64 kbytes, 64 bytes/line, 1 lines/tag, 2-way associative L1 instruction cache: 64 kbytes, 64 bytes/line, 1 lines/tag, 2-way associative L2 internal cache: 256 kbytes, 64 bytes/line, 1 lines/tag, 8-way associative real memory = 536788992 (524208K bytes) Physical memory chunk(s): 0x00001000 - 0x0009ffff, 651264 bytes (159 pages) 0x00419000 - 0x1ffe3fff, 532459520 bytes (129995 pages) avail memory = 516382720 (504280K bytes) bios32: Found BIOS32 Service Directory header at 0xc00f1470 bios32: Entry = 0xf0bf0 (c00f0bf0) Rev = 0 Len = 1 pcibios: PCI BIOS entry at 0xf0000+0xdf0 pnpbios: Found PnP BIOS data at 0xc00fbd70 pnpbios: Entry = f0000:bda0 Rev = 1.0 pnpbios: OEM ID cd041 Other BIOS signatures found: vm_init_limits: 1ec69000 free null: random: mem: Pentium Pro MTRR support enabled pci_open(1): mode 1 addr port (0x0cf8) is 0x80000060 pci_open(1a): mode1res=0x80000000 (0x80000000) pci_cfgcheck: device 0 [class=060000] [hdr=00] is there (id=30991106) Using $PIR table, 10 entries at 0xc00f13a0 new getit_delta_max = 4082 nsec npx0: on motherboard npx0: INT 16 interface pcib0: at pcibus 0 on motherboard pci0: on pcib0 pci0: physical bus=0 map[10]: type 3, range 32, base fc000000, size 25, enabled found-> vendor=0x1106, dev=0x3099, revid=0x00 bus=0, slot=0, func=0 class=06-00-00, hdrtype=0x00, mfdev=0 cmdreg=0x0006, statreg=0x2210, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) powerspec 2 supports D0 D3 current D0 found-> vendor=0x1106, dev=0xb099, revid=0x00 bus=0, slot=1, func=0 class=06-04-00, hdrtype=0x01, mfdev=0 cmdreg=0x0007, statreg=0x2230, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) map[10]: type 1, range 32, base f4000000, size 26, enabled found-> vendor=0x5333, dev=0x5631, revid=0x06 bus=0, slot=12, func=0 class=03-00-00, hdrtype=0x00, mfdev=0 cmdreg=0x0007, statreg=0x0200, cachelnsz=0 (dwords) lattimer=0x40 (1920 ns), mingnt=0x04 (1000 ns), maxlat=0xff (63750 ns) intpin=a, irq=10 map[10]: type 3, range 32, base fb000000, size 12, enabled map[14]: type 4, range 32, base 0000d800, size 5, enabled map[18]: type 1, range 32, base f3800000, size 20, enabled found-> vendor=0x8086, dev=0x1229, revid=0x05 bus=0, slot=13, func=0 class=02-00-00, hdrtype=0x00, mfdev=0 cmdreg=0x0017, statreg=0x0290, cachelnsz=8 (dwords) lattimer=0x40 (1920 ns), mingnt=0x08 (2000 ns), maxlat=0x38 (14000 ns) intpin=a, irq=5 powerspec 1 supports D0 D1 D2 D3 current D0 map[10]: type 1, range 32, base f3000000, size 7, enabled map[14]: type 4, range 32, base 0000d400, size 7, enabled map[18]: type 1, range 20, base 000c8000, size 14, enabled found-> vendor=0x120e, dev=0x0100, revid=0x01 bus=0, slot=14, func=0 class=07-80-00, hdrtype=0x00, mfdev=0 cmdreg=0x0007, statreg=0x0280, cachelnsz=0 (dwords) lattimer=0x40 (1920 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=a, irq=11 found-> vendor=0x1106, dev=0x3074, revid=0x00 bus=0, slot=17, func=0 class=06-01-00, hdrtype=0x00, mfdev=1 cmdreg=0x0087, statreg=0x0210, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) powerspec 2 supports D0 D3 current D0 map[20]: type 4, range 32, base 0000d000, size 4, enabled found-> vendor=0x1106, dev=0x0571, revid=0x06 bus=0, slot=17, func=1 class=01-01-8a, hdrtype=0x00, mfdev=0 cmdreg=0x0087, statreg=0x0290, cachelnsz=0 (dwords) lattimer=0x40 (1920 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=a, irq=255 powerspec 2 supports D0 D3 current D0 pcib1: at device 1.0 on pci0 pcib1: secondary bus 1 pcib1: subordinate bus 1 pcib1: I/O decode 0xe000-0xdfff pcib1: memory decode 0xfae00000-0xfadfffff pcib1: prefetched decode 0xfc000000-0xfbffffff pci1: on pcib1 pci1: physical bus=1 pci0: at device 12.0 (no driver attached) fxp0: port 0xd800-0xd81f mem 0xf3800000-0xf38fffff,0xfb000000-0xfb000fff irq 5 at device 13.0 on pci0 fxp0: using memory space register mapping fxp0: Ethernet address 00:90:27:25:64:ee fxp0: PCI IDs: 8086 1229 8086 0009 0005 fxp0: Dynamic Standby mode is disabled inphy0: on miibus0 inphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto bpf: fxp0 attached cy0: port 0xd400-0xd47f mem 0xc8000-0xcbfff,0xf3000000-0xf300007f irq 11 at device 14.0 on pci0 isab0: at device 17.0 on pci0 isa0: on isab0 atapci0: port 0xd000-0xd00f at device 17.1 on pci0 ata0: iobase=0x01f0 altiobase=0x03f6 bmaddr=0xd000 ata0: mask=03 ostat0=50 ostat2=50 ata0-master: ATAPI 00 00 ata0-slave: ATAPI 14 eb ata0: mask=03 stat0=50 stat1=10 ata0-master: ATA 01 a5 ata0: devices=09 ata0: at 0x1f0 irq 14 on atapci0 ata1: iobase=0x0170 altiobase=0x0376 bmaddr=0xd008 ata1: mask=03 ostat0=50 ostat2=00 ata1-master: ATAPI 00 00 ata1-slave: ATAPI 00 00 ata1: mask=03 stat0=50 stat1=00 ata1-master: ATA 01 a5 ata1: devices=01 ata1: at 0x170 irq 15 on atapci0 pnpbios: 14 devices, largest 114 bytes PNP0401: adding dma mask 0x8 PNP0401: adding irq mask 0x80 PNP0401: adding io range 0x378-0x37f, size=0x8, align=0 PNP0401: adding io range 0x778-0x77f, size=0x8, align=0 pnpbios: handle 1 device ID PNP0401 (0104d041) PNP0501: adding irq mask 0x10 PNP0501: adding io range 0x3f8-0x3ff, size=0x8, align=0 pnpbios: handle 2 device ID PNP0501 (0105d041) PNP0501: adding irq mask 0x8 PNP0501: adding io range 0x2f8-0x2ff, size=0x8, align=0 pnpbios: handle 3 device ID PNP0501 (0105d041) PNP0700: adding irq mask 0x40 PNP0700: adding dma mask 0x4 PNP0700: adding io range 0x3f2-0x3f5, size=0x4, align=0 pnpbios: handle 4 device ID PNP0700 (0007d041) PNP0c01: adding fixed memory32 range 0-0x9ffff, size=0xa0000 PNP0c01: adding fixed memory32 range 0x100000-0x1fffffff, size=0x1ff00000 PNP0c01: adding fixed memory32 range 0xe8000-0xeffff, size=0x8000 PNP0c01: adding fixed memory32 range 0xf0000-0xf3fff, size=0x4000 PNP0c01: adding fixed memory32 range 0xf4000-0xf7fff, size=0x4000 PNP0c01: adding fixed memory32 range 0xf8000-0xfbfff, size=0x4000 PNP0c01: adding fixed memory32 range 0xfc000-0xfffff, size=0x4000 PNP0c01: adding fixed memory32 range 0xfffe0000-0xffffffff, size=0x20000 pnpbios: handle 6 device ID PNP0c01 (010cd041) PNP0000: adding irq mask 0x4 PNP0000: adding io range 0x20-0x21, size=0x2, align=0 PNP0000: adding io range 0xa0-0xa1, size=0x2, align=0 PNP0000: adding io range 0x4d0-0x4d1, size=0x2, align=0 pnpbios: handle 7 device ID PNP0000 (0000d041) PNP0100: adding irq mask 0x1 PNP0100: adding io range 0x40-0x43, size=0x4, align=0 pnpbios: handle 8 device ID PNP0100 (0001d041) PNP0b00: adding irq mask 0x100 PNP0b00: adding io range 0x70-0x75, size=0x6, align=0 pnpbios: handle 9 device ID PNP0b00 (000bd041) PNP0303: adding irq mask 0x2 PNP0303: adding io range 0x60-0x60, size=0x1, align=0 PNP0303: adding io range 0x64-0x64, size=0x1, align=0 pnpbios: handle 10 device ID PNP0303 (0303d041) PNP0c04: adding irq mask 0x2000 PNP0c04: adding io range 0xf0-0xf0, size=0x1, align=0 pnpbios: handle 11 device ID PNP0c04 (040cd041) PNP0200: adding dma mask 0x10 PNP0200: adding io range 0-0xf, size=0x10, align=0 PNP0200: adding io range 0x80-0x90, size=0x11, align=0 PNP0200: adding io range 0x94-0x9f, size=0xc, align=0 PNP0200: adding io range 0xc0-0xde, size=0x1f, align=0 pnpbios: handle 12 device ID PNP0200 (0002d041) PNP0800: adding io range 0x61-0x61, size=0x1, align=0x1 pnpbios: handle 13 device ID PNP0800 (0008d041) PNP0a03: adding io range 0xcf8-0xcff, size=0x8, align=0 pnpbios: handle 14 device ID PNP0a03 (030ad041) PNP0c02: adding io range 0xe400-0xe47f, size=0x80, align=0 PNP0c02: adding io range 0xe800-0xe83f, size=0x40, align=0 pnpbios: handle 15 device ID PNP0c02 (020cd041) cy: cy0 already exists; skipping it Trying Read_Port at 203 Trying Read_Port at 243 Trying Read_Port at 283 Trying Read_Port at 2c3 Trying Read_Port at 303 Trying Read_Port at 343 Trying Read_Port at 383 Trying Read_Port at 3c3 sc: sc0 already exists; skipping it vga: vga0 already exists; skipping it isa_probe_children: disabling PnP devices isa_probe_children: probing non-PnP devices orm0: