Bug 60699 - [atapicam] DVD Multidrive udma mode autosensed wrong
Summary: [atapicam] DVD Multidrive udma mode autosensed wrong
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 5.1-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-29 18:30 UTC by Jason Bacon
Modified: 2015-11-10 13:41 UTC (History)
1 user (show)

See Also:


Attachments
dmesg.boot (5.55 KB, TEXT/PLAIN; charset=US-ASCII)
2004-09-06 19:31 UTC, Jason Bacon
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Bacon 2003-12-29 18:30:19 UTC
	I installed a new Panasonic DVD Multidrive.  After enabling
	atapi udma in /boot/loader.conf as follows:

	userconfig_script_load="YES"
	hw.ata.atapi_dma="1"

	I see the following in the boot messages:

	acd1: DVD-R <MATSHITADVD-RAM SW-9571> at ata1-slave UDMA66
	(Full dmesg text below)

	The drive does not function in this mode, but produces I/O errors
	for all operations.  It works fine in PIO mode or udma33.  See
	the attached fix.

Copyright (c) 1992-2003 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.1-RELEASE #3: Tue Dec 23 13:05:02 CST 2003
    bacon@bombadil.cellbio.mcw.edu:/usr/obj/usr/src/sys/bombadil
Preloaded elf kernel "/boot/kernel/kernel" at 0xc074f000.
Preloaded elf module "/boot/kernel/acpi.ko" at 0xc074f244.
Timecounter "i8254"  frequency 1193182 Hz
Timecounter "TSC"  frequency 803612252 Hz
CPU: Intel Pentium III (803.61-MHz 686-class CPU)
  Origin = "GenuineIntel"  Id = 0x686  Stepping = 6
  Features=0x383fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR,SSE>
real memory  = 1073725440 (1023 MB)
avail memory = 1035309056 (987 MB)
Pentium Pro MTRR support enabled
npx0: <math processor> on motherboard
npx0: INT 16 interface
acpi0: <ASUS   CUV4X-D > on motherboard
pcibios: BIOS version 2.10
Using $PIR table, 7 entries at 0xc00f12d0
acpi0: power button is handled as a fixed feature programming model.
Timecounter "ACPI-fast"  frequency 3579545 Hz
acpi_timer0: <24-bit timer at 3.579545MHz> port 0xe408-0xe40b on acpi0
acpi_cpu0: <CPU> port 0x530-0x537 on acpi0
acpi_cpu1: <CPU> port 0x530-0x537 on acpi0
acpi_button0: <Power Button> on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
agp0: <VIA 82C691 (Apollo Pro) host to PCI bridge> mem 0xfc000000-0xfdffffff at device 0.0 on pci0
pcib1: <ACPI PCI-PCI bridge> at device 1.0 on pci0
pci1: <ACPI PCI bus> on pcib1
pci1: <display, VGA> at device 0.0 (no driver attached)
isab0: <PCI-ISA bridge> at device 4.0 on pci0
isa0: <ISA bus> on isab0
atapci0: <VIA 82C686B UDMA100 controller> port 0xd800-0xd80f at device 4.1 on pci0
ata0: at 0x1f0 irq 14 on atapci0
ata1: at 0x170 irq 15 on atapci0
uhci0: <VIA 83C572 USB controller> port 0xd400-0xd41f irq 5 at device 4.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 0xd000-0xd01f irq 5 at device 4.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
dc0: <82c169 PNIC 10/100BaseTX> port 0xb800-0xb8ff mem 0xf8000000-0xf80000ff irq 10 at device 11.0 on pci0
dc0: Ethernet address: 00:02:e3:06:9d:a2
miibus0: <MII bus> on dc0
bmtphy0: <BCM5201 10/100baseTX PHY> on miibus0
bmtphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
pcm0: <Creative CT5880-C> port 0xb400-0xb43f irq 11 at device 12.0 on pci0
pcm0: <SigmaTel STAC9721/23 AC97 Codec>
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
ppc0 port 0x778-0x77b,0x378-0x37f irq 7 drq 3 on acpi0
ppc0: SMC-like chipset (ECP/EPP/PS2/NIBBLE) in COMPATIBLE mode
ppc0: FIFO with 16/16/8 bytes threshold
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
sio0 port 0x3f8-0x3ff irq 4 on acpi0
sio0: type 16550A
sio1 port 0x2f8-0x2ff irq 3 on acpi0
sio1: type 16550A
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-0xc7fff on isa0
pmtimer0 on isa0
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
Timecounters tick every 10.000 msec
acpi_cpu: throttling enabled, 16 steps (100% to 6.2%), currently 100.0%
ad0: 73308MB <IBM-DTLA-307075> [148945/16/63] at ata0-master UDMA100
acd0: CDROM <FX4830T> at ata1-master UDMA33
acd1: DVD-R <MATSHITADVD-RAM SW-9571> at ata1-slave UDMA66
Mounting root from ufs:/dev/ad0s1a
cd0 at ata1 bus 0 target 0 lun 0
cd0: <MITSUMI CD-ROM FX4830T!B R02C> 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 1 lun 0
cd1: <MATSHITA DVD-RAM SW-9571 A112> Removable CD-ROM SCSI-0 device 
cd1: 66.000MB/s transfers
cd1: cd present [2236704 x 2048 byte records]
dc0: failed to force tx and rx to idle state
dc0: failed to force tx and rx to idle state
drm0: <Matrox G400/G450 (AGP)> mem 0xf8800000-0xf8ffffff,0xf9000000-0xf9003fff,0xfa000000-0xfbffffff irq 11 at device 0.0 on pci1
info: [drm] AGP at 0xfc000000 32MB
info: [drm] Initialized mga 3.1.0 20021029 on minor 0

Fix: 

Use atacontrol to force the mode of the DVD Multidrive to udma33.
	I activated this at boot time by creating the following script
	in /usr/local/etc/rc.d/dvdram.sh:

#!/bin/sh

# Place me in /usr/local/etc/rc.d to force udma## mode.
# Some DVD Multidrives default to udma66 on 5.1R, which results
# in I/O errors.  

# Examples  ( Type "man atacontrol" for modes )

# Set both channels on controller 0 to udma66
# atacontrol mode 1 udma66 udma66

# Set both channels on controller 1 to udma33
atacontrol mode 1 udma33 udma33

	I presume the same thing could be achieved in device.hints
	as well, but I couldn't find any docs on the proper syntax.
How-To-Repeat: 	See hardware desc.
Comment 1 Jason Bacon 2004-01-08 17:19:07 UTC
I subsequently discovered that udma33 mode causes problems reading CDRs in 
both the CDROM and DVD Multidrive (although it works fine for reading and 
writing DVD RAMs)

Hence, I have replaced:

atacontrol mode 1 udma33 udma33

with

atacontrol mode 1 wdma2 wdma2

Now everything works, and the change had no measurable impact on performance 
or system load.
Comment 2 Tilman Keskinoz freebsd_committer freebsd_triage 2004-09-06 15:19:17 UTC
State Changed
From-To: open->feedback

Is this still a problem with recent versions of 5.x ?
Comment 3 Jason Bacon 2004-09-06 19:31:14 UTC
Yes, the problem still exists on 5.2.1, but as before only with the 9572
model as far as I know.  We have some earlier model drives that detect
correctly.

I've noticed some improvements from 5.1 to 5.2.1, namely an intermittent
problem reading from DVDRAMs has been fixed, and it is no longer necessary
to enable ATAPICAM and use cd0 instead of acd0.

I attached the boot messages from one of the systems with this drive.
You can see that it is detected as UDMA66, which does not work.  All
attempted operations result in I/O errors.  UDMA33 seems to work for this
drive, but I've found that WDMA works better with certain CDROM drives on
the same channel.

Let me know if there is anything I can do to help.

Thanks,

	Jason

-----------------------------------------------------------------------
"Why be a man when you can be a success?"
                -- Bertold Brecht
-----------------------------------------------------------------------

On Mon, 6 Sep 2004, Tilman Linneweh wrote:

> Synopsis: DVD Multidrive udma mode autosensed wrong
>
> State-Changed-From-To: open->feedback
> State-Changed-By: arved
> State-Changed-When: Mon Sep 6 14:19:17 GMT 2004
> State-Changed-Why:
> Is this still a problem with recent versions of 5.x ?
>
> http://www.freebsd.org/cgi/query-pr.cgi?pr=60699
>
Comment 4 Mark Linimon freebsd_committer freebsd_triage 2008-03-01 20:18:56 UTC
State Changed
From-To: feedback->closed

There have been so many changes in the intervening years, that this PR 
probably no longer applies.  To submitter: if you are still seeing this, 
let me know and I will reopen it.
Comment 5 Mark Linimon 2008-03-05 06:28:07 UTC
----- Forwarded message from Jason Bacon <bacon@smithers.neuro.mcw.edu> -----

Almost eerie that you should mention it now.  I was just thinking of 
revisiting this PO yesterday.  I'm in the process of upgrading all my 
older FreeBSD boxes to 6.3-RELEASE, and yes, I'm still seeing the same 
issue.

As a workaround, I'm adding the following to 
/usr/local/etc/rc.d/cdrom.sh on all my systems:

atacontrol mode acd0 wdma2
atacontrol mode acd1 wdma2

Fortunately, the newer atacontrol lets you address specific device names 
instead of channels, so I just set all my CD/DVD drives to wdma2 by 
default.  So far, this hasn't caused any problems.

   Jason

----- End forwarded message -----
Comment 6 Mark Linimon freebsd_committer freebsd_triage 2008-03-05 06:28:14 UTC
State Changed
From-To: closed->open

Reopened due to followup.
Comment 7 Enji Cooper freebsd_committer freebsd_triage 2015-11-10 13:41:07 UTC
atapicam is no more after FreeBSD 9.x. Long live atacam and friends.