I tried to enable DMA at boot time by adding the line 'hw.ata.atapi_dma=3D"1"' to /boot/loader.conf. Works for hard drives, Plextor Plexwriter Premium and LiteOn LDW-811S, but only works for my LiteOn LTR-48125W, if a disc is loaded. If no disc is loaded, BIOSPIO is used instead. Relevant part of dmesg output without disc in drive LiteOn LTR-48125W: acd0: CDRW <LITE-ON DVDRW LDW-811S> at ata0-master UDMA33 GEOM: create disk ad1 dp=3D0xc484c960 ad1: 76319MB <WDC WD800BB-00CAA1> [155061/16/63] at ata0-slave UDMA100 ata1-master: FAILURE - SETFEATURES SET TRANSFER MODE no interrupt ata1-master: FAILURE - SETFEATURES SET TRANSFER MODE no interrupt acd1: CDRW <LITE-ON LTR-48125W> at ata1-master BIOSPIO acd2: CDRW <PLEXTOR CD-R PREMIUM> at ata1-slave UDMA33 GEOM: create disk ad4 dp=3D0xc48e4d60 ad4: 114498MB <SAMSUNG SV1204H> [232632/16/63] at ata2-master UDMA100 GEOM: create disk ad5 dp=3D0xc48e5460 ad5: 76319MB <ST380020A> [155061/16/63] at ata2-slave UDMA100 GEOM: create disk cd0 dp=3D0xc47fc600 GEOM: create disk cd1 dp=3D0xc47fce00 GEOM: create disk cd2 dp=3D0xc47ffe00 cd0 at ata0 bus 0 target 0 lun 0 cd0: <LITE-ON DVDRW LDW-811S HS0Q> Removable CD-ROM SCSI-0 device cd0: 33.000MB/s transfers cd0: Attempt to query device size failed: NOT READY, Medium not present cd1 at ata1 bus 0 target 0 lun 0 cd1: <LITE-ON LTR-48125W VS0D> Removable CD-ROM SCSI-0 device cd1: 3.300MB/s transfers cd1: Attempt to query device size failed: NOT READY, Medium not present cd2 at ata1 bus 0 target 1 lun 0 cd2: <PLEXTOR CD-R PREMIUM 1.05> Removable CD-ROM SCSI-0 device cd2: 33.000MB/s transfers cd2: Attempt to query device size failed: NOT READY, Medium not present = - tray closed Relevant part of dmesg output with disc in drive LiteOn LTR-48125W (note= that cd1 comes before cd0): acd0: CDRW <LITE-ON DVDRW LDW-811S> at ata0-master UDMA33 GEOM: create disk ad1 dp=3D0xc484c960 ad1: 76319MB <WDC WD800BB-00CAA1> [155061/16/63] at ata0-slave UDMA100 acd1: CDRW <LITE-ON LTR-48125W> at ata1-master UDMA33 acd2: CDRW <PLEXTOR CD-R PREMIUM> at ata1-slave UDMA33 GEOM: create disk ad4 dp=3D0xc48e7860 ad4: 114498MB <SAMSUNG SV1204H> [232632/16/63] at ata2-master UDMA100 GEOM: create disk ad5 dp=3D0xc48e7260 ad5: 76319MB <ST380020A> [155061/16/63] at ata2-slave UDMA100 GEOM: create disk cd0 dp=3D0xc47f9e00 GEOM: create disk cd1 dp=3D0xc47fae00 GEOM: create disk cd2 dp=3D0xc47fb600 cd1 at ata1 bus 0 target 0 lun 0 cd1: <LITE-ON LTR-48125W VS0D> Removable CD-ROM SCSI-0 device cd1: 33.000MB/s transfers cd1: cd present [1 x 2048 byte records] cd0 at ata0 bus 0 target 0 lun 0 cd0: <LITE-ON DVDRW LDW-811S HS0Q> Removable CD-ROM SCSI-0 device cd0: 33.000MB/s transfers cd0: Attempt to query device size failed: NOT READY, Medium not present cd2 at ata1 bus 0 target 1 lun 0 cd2: <PLEXTOR CD-R PREMIUM 1.05> Removable CD-ROM SCSI-0 device cd2: 33.000MB/s transfers cd2: Attempt to query device size failed: NOT READY, Medium not present = - tray closed Whole dmesg output: Copyright (c) 1992-2004 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.2.1-RELEASE #2: Mon Jul 5 15:02:33 CEST 2004 root@freebsd.W62:/usr/src/sys/i386/compile/VERSUCH2 Preloaded elf kernel "/boot/kernel/kernel" at 0xc0815000. Preloaded elf module "/boot/kernel/acpi.ko" at 0xc08151f4. Timecounter "i8254" frequency 1193182 Hz quality 0 CPU: AMD Athlon(tm) XP 1700+ (1470.01-MHz 686-class CPU) Origin =3D "AuthenticAMD" Id =3D 0x662 Stepping =3D 2 Features=3D0x383f9ff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA= ,CMOV,PAT,PSE36,MMX,FXSR,SSE> AMD Features=3D0xc0480000<MP,AMIE,DSP,3DNow!> real memory =3D 536805376 (511 MB) avail memory =3D 511770624 (488 MB) Pentium Pro MTRR support enabled npx0: [FAST] npx0: <math processor> on motherboard npx0: INT 16 interface acpi0: <VIA694 AWRDACPI> on motherboard pcibios: BIOS version 2.10 Using $PIR table, 9 entries at 0xc00fded0 acpi0: Power Button (fixed) Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000 acpi_timer0: <24-bit timer at 3.579545MHz> port 0x4008-0x400b on acpi0 acpi_cpu0: <CPU> port 0x530-0x537 on acpi0 acpi_tz0: <Thermal Zone> port 0x530-0x537 on acpi0 acpi_button0: <Power Button> on acpi0 acpi_button1: <Sleep Button> on acpi0 pcib0: <ACPI Host-PCI bridge> port 0x5000-0x500f,0x4080-0x40ff,0x4000-0x= 407f,0xcf8-0xcff on acpi0 pci0: <ACPI PCI bus> on pcib0 pcib0: slot 11 INTA is routed to irq 11 pcib0: slot 13 INTA is routed to irq 11 pcib0: slot 14 INTA is routed to irq 10 pcib0: slot 17 INTD is routed to irq 11 pcib0: slot 17 INTD is routed to irq 11 agp0: <VIA Generic host to PCI bridge> mem 0xd0000000-0xd7ffffff at devi= ce 0.0 on pci0 pcib1: <PCI-PCI bridge> at device 1.0 on pci0 pci1: <PCI bus> on pcib1 pcib0: slot 1 INTA is routed to irq 11 pcib1: slot 0 INTA is routed to irq 11 pci1: <display, VGA> at device 0.0 (no driver attached) pcm0: <Creative EMU10K1> port 0xc000-0xc01f irq 11 at device 11.0 on pci0 pcm0: <SigmaTel STAC9708/11 AC97 Codec> rl0: <RealTek 8139 10/100BaseTX> port 0xc800-0xc8ff mem 0xeb000000-0xeb0= 000ff irq 11 at device 13.0 on pci0 rl0: Ethernet address: 00:02:44:3c:cd:34 miibus0: <MII bus> on rl0 rlphy0: <RealTek internal media interface> on miibus0 rlphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto atapci0: <HighPoint HPT372 UDMA133 controller> port 0xdc00-0xdcff,0xd800= -0xd803,0xd400-0xd407,0xd000-0xd003,0xcc00-0xcc07 irq 10 at device 14.0 on = pci0 atapci0: [MPSAFE] ata2: at 0xcc00 on atapci0 ata2: [MPSAFE] ata3: at 0xd400 on atapci0 ata3: [MPSAFE] isab0: <PCI-ISA bridge> at device 17.0 on pci0 isa0: <ISA bus> on isab0 atapci1: <VIA 8233A UDMA133 controller> port 0xe000-0xe00f at device 17.= 1 on pci0 ata0: at 0x1f0 irq 14 on atapci1 ata0: [MPSAFE] ata1: at 0x170 irq 15 on atapci1 ata1: [MPSAFE] uhci0: <VIA 83C572 USB controller> port 0xe400-0xe41f irq 11 at device 1= 7.2 on pci0 usb0: <VIA 83C572 USB controller> on uhci0 usb0: USB revision 1.0 uhub0: VIA UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub0: 2 ports with 2 removable, self powered uhci1: <VIA 83C572 USB controller> port 0xe800-0xe81f irq 11 at device 1= 7.3 on pci0 usb1: <VIA 83C572 USB controller> on uhci1 usb1: USB revision 1.0 uhub1: VIA UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub1: 2 ports with 2 removable, self powered fdc0: <Enhanced floppy controller (i82077, NE72065 or clone)> port 0x3f7= ,0x3f2-0x3f5 irq 6 drq 2 on acpi0 fdc0: FIFO enabled, 8 bytes threshold fd0: <1440-KB 3.5" drive> on fdc0 drive 0 sio0 port 0x3f8-0x3ff irq 4 on acpi0 sio0: type 16550A sio1 port 0x2f8-0x2ff irq 3 on acpi0 sio1: type 16550A ppc0 port 0x778-0x77b,0x378-0x37f irq 7 on acpi0 ppc0: Generic chipset (NIBBLE-only) in COMPATIBLE mode ppbus0: <Parallel port bus> on ppc0 plip0: <PLIP network interface> on ppbus0 lpt0: <Printer> on ppbus0 lpt0: Interrupt-driven port ppi0: <Parallel I/O> on ppbus0 atkbdc0: <Keyboard controller (i8042)> port 0x64,0x60 irq 1 on acpi0 atkbd0: <AT Keyboard> flags 0x1 irq 1 on atkbdc0 kbd0 at atkbd0 psm0: <PS/2 Mouse> irq 12 on atkbdc0 psm0: model IntelliMouse, device ID 3 orm0: <Option ROM> at iomem 0xc0000-0xcefff on isa0 sc0: <System console> at flags 0x100 on isa0 sc0: VGA <16 virtual consoles, flags=3D0x300> vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 Timecounter "TSC" frequency 1470007408 Hz quality 800 Timecounters tick every 10.000 msec acpi_cpu: throttling enabled, 2 steps (100% to 50.0%), currently 100.0% acd0: CDRW <LITE-ON DVDRW LDW-811S> at ata0-master UDMA33 GEOM: create disk ad1 dp=3D0xc484c960 ad1: 76319MB <WDC WD800BB-00CAA1> [155061/16/63] at ata0-slave UDMA100 ata1-master: FAILURE - SETFEATURES SET TRANSFER MODE no interrupt ata1-master: FAILURE - SETFEATURES SET TRANSFER MODE no interrupt acd1: CDRW <LITE-ON LTR-48125W> at ata1-master BIOSPIO acd2: CDRW <PLEXTOR CD-R PREMIUM> at ata1-slave UDMA33 GEOM: create disk ad4 dp=3D0xc48e4d60 ad4: 114498MB <SAMSUNG SV1204H> [232632/16/63] at ata2-master UDMA100 GEOM: create disk ad5 dp=3D0xc48e5460 ad5: 76319MB <ST380020A> [155061/16/63] at ata2-slave UDMA100 GEOM: create disk cd0 dp=3D0xc47fc600 GEOM: create disk cd1 dp=3D0xc47fce00 GEOM: create disk cd2 dp=3D0xc47ffe00 cd0 at ata0 bus 0 target 0 lun 0 cd0: <LITE-ON DVDRW LDW-811S HS0Q> Removable CD-ROM SCSI-0 device cd0: 33.000MB/s transfers cd0: Attempt to query device size failed: NOT READY, Medium not present cd1 at ata1 bus 0 target 0 lun 0 cd1: <LITE-ON LTR-48125W VS0D> Removable CD-ROM SCSI-0 device cd1: 3.300MB/s transfers cd1: Attempt to query device size failed: NOT READY, Medium not present cd2 at ata1 bus 0 target 1 lun 0 cd2: <PLEXTOR CD-R PREMIUM 1.05> Removable CD-ROM SCSI-0 device cd2: 33.000MB/s transfers cd2: Attempt to query device size failed: NOT READY, Medium not present = - tray closed Mounting root from ufs:/dev/ad1s3a Fix: No fix but a workaround: enable DMA with atacontrol. It doesn't matter whether a disc is in drive LiteOn LTR-48125W or not. /root/#atacontrol list ATA channel 0: Master: acd0 <LITE-ON DVDRW LDW-811S/HS0Q> ATA/ATAPI rev 5 Slave: ad1 <WDC WD800BB-00CAA1/17.07W17> ATA/ATAPI rev 5 ATA channel 1: Master: acd1 <LITE-ON LTR-48125W/VS0D> ATA/ATAPI rev 0 Slave: acd2 <PLEXTOR CD-R PREMIUM/1.05> ATA/ATAPI rev 0 ATA channel 2: Master: ad4 <SAMSUNG SV1204H/RK100-15> ATA/ATAPI rev 6 Slave: ad5 <ST380020A/3.39> ATA/ATAPI rev 6 ATA channel 3: Master: no device present Slave: no device present /root/#atacontrol mode 1 Master =3D BIOSPIO Slave =3D UDMA33 /root/#atacontrol mode 1 UDMA2 UDMA2 Master =3D UDMA33 Slave =3D UDMA33 Proof that it's real DMA and not the pseudo-DMA known from Linux with the so called ide-scsi-emulation (makes problems if "unusual" blocksizes are used): /root/#cdrecord dev=3D1,0,0 driveropts=3Dburnfree -raw tsize=3D359000s -= dummy -v /dev/random Cdrecord-Clone 2.01a32 (i386-unknown-freebsd5.2.1) Copyright (C) 1995-20= 04 J=F6rg Schilling TOC Type: 1 =3D CD-ROM scsidev: '1,0,0' scsibus: 1 target: 0 lun: 0 Using libscg version 'schily-0.8'. Driveropts: 'burnfree' SCSI buffer size: 64512 atapi: 0 Device type : Removable CD-ROM Version : 0 Response Format: 2 Capabilities : Vendor_info : 'LITE-ON ' Identifikation : 'LTR-48125W ' Revision : 'VS0D' Device seems to be: Generic mmc CD-RW. Current: 0x0009 Profile: 0x000A Profile: 0x0009 (current) Profile: 0x0008 Profile: 0x0002 (current) Using generic SCSI-3/mmc CD-R/CD-RW driver (mmc_cdr). Driver flags : MMC-3 SWABAUDIO BURNFREE FORCESPEED Supported modes: TAO PACKET SAO SAO/R96P SAO/R96R RAW/R16 RAW/R96P RAW/R= 96R Drive buf size : 1422080 =3D 1388 KB FIFO size : 4194304 =3D 4096 KB Encoding speed : 429x (32138 sectors/s) for libedc from Heiko Ei=DFfeldt Track 01: data 701 MB Total size: 805 MB (79:46.66) =3D 359000 sectors Lout start: 805 MB (79:48/50) =3D 359000 sectors Current Secsize: 2048 ATIP info from disk: Indicated writing power: 4 Is not unrestricted Is not erasable Disk sub type: Medium Type A, low Beta category (A-) (2) ATIP start of lead in: -12508 (97:15/17) ATIP start of lead out: 359845 (79:59/70) Disk type: Short strategy type (Phthalocyanine or similar) Manuf. index: 22 Manufacturer: Ritek Co. Blocks total: 359845 Blocks current: 359845 Blocks remaining: 845 Forcespeed is OFF. Starting to write CD/DVD at speed 48 in dummy RAW/RAW96R mode for single= session. Last chance to quit, starting dummy write 0 seconds. Operation starts. Waiting for reader process to fill input buffer ... input buffer ready. BURN-Free is ON. cdrecord: WARNING: Drive returns wrong startsec (0) using -12508 from AT= IP Writing lead-in at sector -12508 Lead-in write time: 14.807s Writing pregap for track 1 at -150 Starting new track at sector: 0 Track 01: 838 of 838 MB written (fifo 100%) [buf 98%] 51.1x. Track 01: Total bytes read/written: 878832000/878832000 (359000 sectors). Writing time: 151.753s Average write speed 35.0x. Min drive buffer fill was 92% Writing Leadout... Fixating... WARNING: Some drives don't like fixation in dummy mode. Fixating time: 7.848s BURN-Free was never needed. cdrecord: fifo had 13808 puts and 13808 gets. cdrecord: fifo was 0 times empty and 3905 times full, min fill was 89%. Script to do "the work" after booting: #!/bin/sh # Place in /usr/local/etc/rc.d to enjoy DMA with LiteOn LTR-48125W, # even if no disc is loaded at boot time. # See "man atacontrol" to make this script fit your needs. case "$1" in start) echo 'Enabling DMA' # Set both channels on controller 1 to UDMA33 atacontrol mode 1 UDMA33 UDMA33 ;; stop) #Nothing to do ;; *) echo "Usage: `basename $0` start" >&2 exit 64 ;; esac exit 0 How-To-Repeat: Boot without disc in drive LiteOn LTR-48125W.
Responsible Changed From-To: gnats-admin->freebsd-bugs Reassign misfiled PR.
Responsible Changed From-To: freebsd-bugs->sos Over to ATA Maintainer
State Changed From-To: open->closed This is fixed in -current and should be in 5.3 when released.