Bug 426903

Summary: System crashes upon inserting media into CD/DVD-ROM drive
Product: [Fedora] Fedora Reporter: Joachim Frieben <jfrieben>
Component: kernelAssignee: Kernel Maintainer List <kernel-maint>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: low    
Version: 8   
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-02-05 14:37:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Output of dmesg for kernel 2.6.23.12-99.fc8
none
Excerpt from messages log file for kernel 2.6.23.12-99.fc8 none

Description Joachim Frieben 2007-12-28 09:12:04 UTC
Description of problem:
Upon inserting a CD or a DVD into the DVD-ROM drive, the latter shows
some activity druring a couple od seconds. Then, the screen turns blank
and the system restarts.

Version-Release number of selected component (if applicable):
kernel-2.6.23.12-99.fc8

How reproducible:
Always.

Steps to Reproduce:
1. Boot Fedora 8.
2. Login to GNOME desktop.
3. Insert media into DVD-ROM drive.
  
Actual results:
System crashes and reboots.

Expected results:
Media gets mounted and nautilus opens up a new window.

Additional info:
- No problems under Windows 2000 Professional .
- Both x86 and x86_64 versions of the F8 rescue CD boot correctly.
- Problem seems to be a generic x86_64 one. When I boot current
  Ubuntu 8.04 AMD64 live CD, it aborts similarly during start-up
  whereas the x86 version boots correctly.
- The board is of type Tyan S2865AG2NRF sporting an NForce4 Ultra
  chipset, and both DVD-ROM drive and system hard disk are
  connected by means of IDE channels.

Comment 1 Joachim Frieben 2007-12-28 09:12:04 UTC
Created attachment 290484 [details]
Output of dmesg for kernel 2.6.23.12-99.fc8

Comment 2 Joachim Frieben 2007-12-28 09:31:44 UTC
Created attachment 290485 [details]
Excerpt from messages log file for kernel 2.6.23.12-99.fc8

Comment 3 Chuck Ebbert 2008-01-03 00:19:42 UTC
Does disabling DMA for the CD/DVD drive help?

Try adding this line to /etc/modprobe.conf:

  options libata dma=1

Then either rebuild the initrd or uninstall/reinstall the kernel to get an
updated initrd.


Comment 4 Joachim Frieben 2008-01-03 19:08:59 UTC
I have tried adding "[options] libata dma=0/1" to both modprobe.conf and
the kernel boot options [even adding "ide=nodma", too]. It looks as if
for kernel 2.6.23.12-99.fc8 [on system otherwise upgraded to "rawhide"]
has no effect [the original report was for F8 with updates].
For both hard disk and DVD drive, 'hdparm -d /dev/..' returns nil,
and 'hdparm -t /dev/sda' reports about 60 MB/s which seems to indicate
operation in UDMA/133 mode which should have been disabled though.
The system still crashes when inserting a disk media. When booting with
an already inserted media, it's usually at the point of starting the
'hal' daemon that the system aborts. Even without any media inserted, it
aborts about 1 out of 2 times after entering the "udev" start-up section
and before loading the default keymap.
The Ubuntu 8.04 problem has turned out to be related to "usplash" and
not to the present issue. After removing "splash" from the boot options,
the live CD successfully boots into the desktop environment.

Comment 5 Joachim Frieben 2008-01-03 23:35:25 UTC
The problem seems to be due to the "pata_amd" module [v0.3.9] which
handles both ATA drives. For this module, it's impossible to display
or change the DMA settings:

 "hdparm -d0 /dev/sda/dev/sda:
   setting using_dma to 0 (off)
   HDIO_SET_DMA failed: Inappropriate ioctl for device"

for both kernel-2.6.23.12-99.fc8 and kernel-2.6.24-0.133.rc6.git8.fc9.

For the current Ubuntu 8.04 AMD64 live CD mentioned above, things work
as expected, but in contrast with Fedora, a different module named
"pata_acpi" and absent from the Fedora kernels is loaded. In turn, the
Ubuntu kernel does not include "pata_amd".

Comment 6 Joachim Frieben 2008-01-04 00:17:32 UTC
(In reply to comment #3)
Following the prescription of comment #3, the DVD drive is now controlled
without using DMA:

  ata2.00: ATAPI: SONY DVD-ROM DDU1612, DYS3, max UDMA/33
  ata2.00: configured for PIO4

and booting the system with inserted media or inserting a media within a
GNOME session works essentially correctly, in particular, without causing
the crashes reported earlier.

Comment 7 Chuck Ebbert 2008-01-04 23:18:18 UTC
So it reboots right after printing these messages when DMA is enabled, right?

 ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
 ata1.00: cmd a0/00:00:00:00:20/00:00:00:00:00/a0 tag 0 cdb 0x0 data 0 
          res 00/01:01:01:14:eb/00:00:00:00:00/a0 Emask 0x2 (HSM violation)
 ata1: soft resetting port
 ata1.00: configured for UDMA/33
 ata1: EH complete


Comment 8 Joachim Frieben 2008-01-05 10:14:47 UTC
Actually no but these were the last lines in "messages" with a leading
"kernel: ata1" before the crash. Operation went on for a while with a
mixed DVD/network yum transaction during which all of a sudden the
system started over.
Note that this infamous "HSM violation" complaint also appears
occasionally when the DVD drive has been configured for PIO4 operation.
Anyway, "rawhide" is moving pretty fast, and from what appears today
it looks as if this crash is less likely to happen than some days ago.
Also annoying is that I cannot even print out basic DVD drive
information since this is what I obtain from 'hdparm -I /dev/sr0'

 /dev/sr0:
  HDIO_DRIVE_CMD(identify) failed: Input/output error

Comment 9 Joachim Frieben 2008-01-06 14:29:44 UTC
Upgrading to kernel-2.6.24-0.136.rc6.git12.fc9 improves the situation
significantly. Both drives are using DMA again, and in general, media
are mounted correctly. I happened to trigger a crash once by 'hdparm -t
/dev/sr0' but afterwards, benchmarking succeeded a couple of times
without incident. Note that with the current "rawhide" kernel, it's
possible again to retrieve drive information by means of 'hdparm -I
/dev/sr0' in contrast with earlier results reported in comment #8:

hdparm -I /dev/sr0

/dev/sr0:

ATAPI CD-ROM, with removable media
	Model Number:       SONY DVD-ROM DDU1612                    
	Serial Number:      
	Firmware Revision:  DYS3    
Standards:
	Used: ATAPI for CD-ROMs, SFF-8020i, r2.5
	Supported: CD-ROM ATAPI-2 
Configuration:
	DRQ response: 50us.
	Packet size: 12 bytes
Capabilities:
	LBA, IORDY(cannot be disabled)
	DMA: mdma0 mdma1 mdma2 udma0 udma1 *udma2 
	     Cycle time: min=120ns recommended=120ns
	PIO: pio0 pio1 pio2 pio3 pio4 
	     Cycle time: no flow control=227ns  IORDY flow control=120ns

However, it's still impossible to change the DMA setting on the fly:

hdparm -d1 /dev/sr0

/dev/sr0:
 setting using_dma to 1 (on)
 HDIO_SET_DMA failed: Inappropriate ioctl for device

Comment 10 Joachim Frieben 2008-02-05 14:37:38 UTC
Issue has completely disappeared for current "rawhide".