From owner-freebsd-scsi Tue May 1 19:34:46 2001 Delivered-To: freebsd-scsi@freebsd.org Received: from arjun.niksun.com (gwnew.niksun.com [63.148.27.34]) by hub.freebsd.org (Postfix) with ESMTP id CB05B37B423; Tue, 1 May 2001 19:34:41 -0700 (PDT) (envelope-from ath@niksun.com) Received: from stiegl.niksun.com (stiegl.niksun.com [10.0.0.44]) by arjun.niksun.com (8.9.3/8.9.3) with ESMTP id WAA22111; Tue, 1 May 2001 22:34:41 -0400 (EDT) (envelope-from ath@stiegl.niksun.com) Received: from stiegl.niksun.com (localhost.niksun.com [127.0.0.1]) by stiegl.niksun.com (8.9.2/8.8.7) with ESMTP id WAA11069; Tue, 1 May 2001 22:34:41 -0400 (EDT) (envelope-from ath@stiegl.niksun.com) Message-Id: <200105020234.WAA11069@stiegl.niksun.com> From: Andrew Heybey To: msmith@freebsd.org Cc: freebsd-scsi@freebsd.org Subject: AMI MegaRAID on 4.2-RELEASE and bus_dmamap_load errors Mime-Version: 1.0 (generated by tm-edit 7.108) Content-Type: text/plain; charset=US-ASCII Date: Tue, 01 May 2001 22:34:41 -0400 Sender: owner-freebsd-scsi@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org When running rawio on an (unmounted) partition, the kernel starts logging many messages of the form: Apr 23 11:00:03 raid /kernel: bus_dmamap_load: Too many segs! buf_len = 0x900 Apr 23 11:00:03 raid /kernel: bus_dmamap_load: Too many segs! buf_len = 0x100 Apr 23 11:00:03 raid /kernel: bus_dmamap_load: Too many segs! buf_len = 0xf00 Apr 23 11:00:03 raid last message repeated 4 times Relevant boot messages: amr0: mem 0xf8000000-0xfbffffff irq 11 at device 0.0 on pci4 amr0: Firmware l148, BIOS 3.11, 64MB RAM amrd0: on amr0 amrd0: 140008MB (286736384 sectors) RAID 5 (optimal) amrd1: on amr0 amrd1: 140008MB (286736384 sectors) RAID 5 (optimal) System is an Intel L440GX+, 512MB RAM. It is currently set up to stripe (using ccd) across the two RAID 5 arrays. The rawio is run on /dev/rccd0c. I found an exchange on freebsd-scsi in January about a similar problem with Mylex controllers: > > If you need someone to do testing of FreeBSD patches, revisions, etc for > > these controllers, the RAID cards and PC in question is just a > > play-around with PC and doesn't hold any critical data. I can > > format/destroy/reload stuff at will with no problems. Just let me know. > > I'll keep you on file. 8) If you have any C hacking experience, I > *really* need to know why the 'too many segs' error is being thrown. All > the indications I've received so far are that the region in question > shouldn't have "too many" segments, so I'm a bit confused. I added the following to sys/i386/i386/busdma_machdep.c: @@ -470,8 +470,13 @@ } while (buflen > 0); if (buflen != 0) { - printf("bus_dmamap_load: Too many segs! buf_len = 0x%lx\n", - (u_long)buflen); + int i; + printf("bus_dmamap_load: Too many segs! buf_len = 0x%lx, seg = %d, nseg = %d\n", + (u_long)buflen, seg, dmat->nsegments); + for (i = 0; i < dmat->nsegments; i++) + printf("bus_dmamap_load: seg %d addr 0x%lx len %d\n", + i, (u_long)dm_segments[i].ds_addr, + dm_segments[i].ds_len); error = EFBIG; } Then I get: bus_dmamap_load: Too many segs! buf_len = 0xea0, seg = 17, nseg = 16 bus_dmamap_load: seg 0 addr 0x8dabea0 len 352 bus_dmamap_load: seg 1 addr 0x8f8c000 len 4096 bus_dmamap_load: seg 2 addr 0x8f6d000 len 4096 bus_dmamap_load: seg 3 addr 0x8dae000 len 4096 bus_dmamap_load: seg 4 addr 0x8b0f000 len 4096 bus_dmamap_load: seg 5 addr 0x8c30000 len 4096 bus_dmamap_load: seg 6 addr 0x8e31000 len 4096 bus_dmamap_load: seg 7 addr 0x8b12000 len 4096 bus_dmamap_load: seg 8 addr 0x8cb3000 len 4096 bus_dmamap_load: seg 9 addr 0x8954000 len 4096 bus_dmamap_load: seg 10 addr 0x8ad5000 len 4096 bus_dmamap_load: seg 11 addr 0x8ab6000 len 4096 bus_dmamap_load: seg 12 addr 0x8bd7000 len 4096 bus_dmamap_load: seg 13 addr 0x8af8000 len 4096 bus_dmamap_load: seg 14 addr 0x8b79000 len 4096 bus_dmamap_load: seg 15 addr 0x7b7a000 len 4096 Someone is trying to do a 64k DMA to a non-page-aligned address. This requires 17 segments, but there are only 16 available. Any suggestions? thanks, andrew To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-scsi" in the body of the message