From owner-freebsd-hardware Sat Jun 15 4:15: 4 2002 Delivered-To: freebsd-hardware@freebsd.org Received: from polaris.we.lc.ehu.es (polaris.we.lc.ehu.es [158.227.6.43]) by hub.freebsd.org (Postfix) with ESMTP id 1094A37B414 for ; Sat, 15 Jun 2002 04:14:55 -0700 (PDT) Received: from v-ger.we.lc.ehu.es (lxpx149.lx.ehu.es [158.227.26.49]) by polaris.we.lc.ehu.es (8.11.6/8.11.6) with ESMTP id g5FBEpn10713 for ; Sat, 15 Jun 2002 13:14:52 +0200 (MET DST) Received: from v-ger.we.lc.ehu.es (localhost [127.0.0.1]) by v-ger.we.lc.ehu.es (8.12.3/8.12.3) with ESMTP id g5FBEsWx000372 for ; Sat, 15 Jun 2002 13:14:54 +0200 (CEST) (envelope-from jose@v-ger.we.lc.ehu.es) Received: (from jose@localhost) by v-ger.we.lc.ehu.es (8.12.3/8.12.3/Submit) id g5FBEqm4000371 for hardware@FreeBSD.org; Sat, 15 Jun 2002 13:14:52 +0200 (CEST) Date: Sat, 15 Jun 2002 13:14:52 +0200 From: "Jose M. Alcaide" To: hardware@FreeBSD.org Subject: ATAPI CDROM does not work in DMA mode, but it works with NetBSD Message-ID: <20020615131452.A267@v-ger.we.lc.ehu.es> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i X-Operating-System: FreeBSD 4.6-RELEASE 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 [I am sorry for the long message.] The machine is a Dell Inspiron 3700. FreeBSD was *never* able to put its ATAPI CD-ROM in DMA mode, including 4.6-RELEASE and 5.0-CURRENT. However, the CD-ROM does work fine with DMA using NetBSD 1.5.2. Here are the most relevant boot messages: -------------------------------------------------------------------------- atapci0: port 0x860-0x86f at device 7.1 on pci0 [...] ata1: iobase=0x0170 altiobase=0x0376 bmaddr=0x0868 ata1: mask=03 ostat0=50 ostat2=00 ata1-master: ATAPI 14 eb ata1-slave: ATAPI 7f 7f ata1: mask=03 stat0=00 stat1=00 ata1: devices=04 ata1: at 0x170 irq 15 on atapci0 [...] ata1-master: piomode=4 dmamode=2 udmamode=-1 dmaflag=1 ata1-master: success setting PIO4 on generic chip acd0: CDROM drive at ata1 as master -------------------------------------------------------------------------- Here is the atacontrol output: -------------------------------------------------------------------------- # atacontrol info 1 Master: acd0 ATA/ATAPI rev 0 Slave: no device present # atacontrol cap 1 0 ATA channel 1, Master, device acd0: ATA/ATAPI revision 0 device model TOSHIBA CD-ROM XM-1902B firmware revision 1A15 cylinders 0 heads 0 sectors/track 0 lba supported lba48 not supported dma supported overlap not supported Feature Support Enable Value Vendor write cache no no read ahead no no dma queued no no 0/00 SMART no no microcode download no no security no no power management no no advanced power management no no 0/00 automatic acoustic management no no 0/00 0/00 -------------------------------------------------------------------------- And I am not a fool ;-) : -------------------------------------------------------------------------- # sysctl hw.ata hw.ata.ata_dma: 1 hw.ata.wc: 1 hw.ata.tags: 0 hw.ata.atapi_dma: 1 -------------------------------------------------------------------------- I can force WDMA2 mode using atacontrol, but then the data transfers with the CD-ROM do not work, and after some resets of the ATA channel it falls back to PIO4. Given that the CD-ROM works in DMA mode with NetBSD (and I tested it, achieving a noticeably higher data throughput and slower CPU consumption compared with those obtained using FreeBSD), I guess that this CD-ROM is not one of those ATAPI devices with broken DMA support. After reading /sys/dev/ata/atapi-all.c and ata-dma.c, I deduced that the following condition (in atapi_attach()) is true: atadev->param->drq_type == ATAPI_DRQT_INTR which prevents setting the CD-ROM in DMA mode. Of course, I removed that test and then the CD-ROM was put in WDMA2 mode, but it did not worked anyway. I wonder why NetBSD does not bother about drq_type being ATAPI_DRQT_INTR. Cheers, JMA -- ****** Jose M. Alcaide // jose@we.lc.ehu.es // jmas@FreeBSD.org ****** ** "Beware of Programmers who carry screwdrivers" -- Leonard Brandwein ** To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hardware" in the body of the message