DVD playback jerky due to ata_generic module disabling DMA

Bug #175022 reported by Tzadik Vanderhoof on 2007-12-09
24
This bug affects 2 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Undecided
Unassigned
linux-source-2.6.22 (Ubuntu)
Undecided
Unassigned

Bug Description

I have Ubuntu Dapper and Gutsy on my machine. It has a Sony DVD drive that works great under Dapper, but under every Ubuntu version after Dapper it has problems. I could not get it to work at all under Feisty, and under Gutsy, I can only get it to work by adding the "all-generic-ide" boot parameter. However, DVD movies play choppy under Gutsy (again, fine on Dapper).

I noticed that the DVD mounts as /dev/hdd under Dapper but /dev/scd1 under Feisty. I tried using hdparm to turn on DMA but it came back with an error.

It's been over a month and it looks like no one has looked at this yet.

mystictim (timgillibrand-yahoo) wrote :

I have the same problem on Ubuntu Hardy Heron with a Samsung TS-H552B (TSSTcorpCD/DVDW) and 2.6.24-5 Kernel running on an MSI RS480M2/RX480M2 motherboard. If I tried to play a DVD its playback was slow and jerky. Looking on the Ubuntu forums I found that the problem might be that DMA wasn't enabled so I ran:
 $ sudo hdparm -d1 /dev/scd0
     setting using_dma to 1 (on)
     HDIO_SET_DMA failed: Inappropriate ioctl for device

Then following a tip from a forum post I ran
$ dmesg
   ...
   [ 35.286790] ata2.00: ATAPI: TSSTcorpCD/DVDW TS-H552B, GA04, max UDMA/33
   [ 35.286804] ata2.00: simplex DMA is claimed by other device, disabling DMA
   ...

Then searched Ubuntu forums for "simplex DMA" and found these posts http://ubuntuforums.org/showthread.php?t=435706 and http://ubuntuforums.org/showthread.php?t=678153
Folowing the advice in the first post I ran:
$ lsmod | grep -i ^libata”
   libata 176304 4 pata_acpi,sata_sil,ata_generic,pata_atiixp

Then following the advice in the second post in reply #9 I blacklisted the ata_generic module.
WARNING BLACKLISTING THE WRONG MODULE CAN RESULT IN A NON BOOTABLE MACHINE
I did this by opening the file /etc/initramfs-tools/modules and adding these lines at the bottom:
  pata_atiixp
  blacklist ata_generic

Then I recreated the initramfs with
$ sudo update-initramfs -u

Then after rebooting the CDROM drive now has DMA enabled and the DVD's playback smoothly.

From this it appears that there is a bug in the ata_generic module that prevents DMA from being enabled on some CDROM Drives on some computers.

Ralph Taylor (djnrrd) wrote :

I've experienced the same issue after upgrading to Hardy RC - DVD playback worked fine in Gutsy before then. Following the steps above resolved my issue and now DMA is enabled and DVD playback is back to normal.

Attached is my current dmesg output with the fix in place. If any other information from my machine is required please let me know.

Steven Webb (webbsd) wrote :

Same as above. No problem with Gutsy. This fixed my problem.

el es (el-es-poczta) wrote :

Ugh, forgot to mention :

lukasz@lukasz-laptop:~$ uname -a
Linux lukasz-laptop 2.6.24-16-generic #1 SMP Thu Apr 10 13:23:42 UTC 2008 i686 GNU/Linux

randallw (rwayth) wrote :

Hi,
Thanks for the workaround.

I too have this problem on my laptop after a fresh Hardy install. Hardware details: https://wiki.ubuntu.com/LaptopTestingTeam/CompaqPresarioV2600CTO

A few points:
- this is a regression of sorts. I did not have this problem with Gusty, but do have it with Hardy 32bit.
- this also affects writing cds/dvds. When writing a disc, my entire system slows down to an unusable crawl without the workaround. I just tried writing a dvd with the workaround and it was perfectly fine.
- A dvd that I wrote yesterday was corrupt, so the slowness is more than just annoying- it causes errors with writing.

So this is a pretty serious bug that affects basic functionality. I hope it will be prioritised accordingly.

Cheers,
Randall.

tim__b (timb) wrote :

Hi, did exactly what mystictim wrote at post #2 (no I did not forget the sudo update-initramfs -u :-)), but I couldn't get the ata_generic module removed. It's still listed:

libata 159344 3 ata_generic,pata_acpi,pata_atiixp

Only thing changed is the order of the modules... hdparm still gives me the "Inappropriate ioctl for device" message.

[ 16.995692] ata2.00: ATAPI: Optiarc DVD RW AD-7540A, 1.01, max UDMA/33
[ 17.168767] scsi 1:0:0:0: CD-ROM Optiarc DVD RW AD-7540A 1.01 PQ

Linux laptop 2.6.24-19-generic #1 SMP Wed Jun 18 14:43:41 UTC 2008 i686 GNU/Linux

HP nx6125

tim__b (timb) wrote :

Sorry, me again. Things are fine now. Seems like it's normal that the module still gets loaded.

 Timing cached reads: 680 MB in 2.00 seconds = 339.72 MB/sec
 Timing buffered disk reads: 14 MB in 3.36 seconds = 4.17 MB/sec

Beginning with the Hardy Heron 8.04 development cycle, all open Ubuntu kernel bugs need to be reported against the "linux" kernel package. We are automatically migrating this bug to the new "linux" package. However, development has already began for the upcoming Intrepid Ibex 8.10 release. It would be helpful if you could test the upcoming release and verify if this is still an issue - http://www.ubuntu.com/testing . If the issue still exists, please update this report by changing the Status of the "linux" task from "Incomplete" to "New". We appreciate your patience and understanding as we make this transition. Thanks!

randallw (rwayth) wrote :

I just tried the Intrepid alpha 4 live CD, and this problem appears to be fixed for me (at least as far as the dmesg output shows both the hard disk and the CD using DMA).

The Ubuntu Kernel Team is planning to move to the 2.6.27 kernel for the upcoming Intrepid Ibex 8.10 release. As a result, the kernel team would appreciate it if you could please test this newer 2.6.27 Ubuntu kernel. There are one of two ways you should be able to test:

1) If you are comfortable installing packages on your own, the linux-image-2.6.27-* package is currently available for you to install and test.

--or--

2) The upcoming Alpha5 for Intrepid Ibex 8.10 will contain this newer 2.6.27 Ubuntu kernel. Alpha5 is set to be released Thursday Sept 4. Please watch http://www.ubuntu.com/testing for Alpha5 to be announced. You should then be able to test via a LiveCD.

Please let us know immediately if this newer 2.6.27 kernel resolves the bug reported here or if the issue remains. More importantly, please open a new bug report for each new bug/regression introduced by the 2.6.27 kernel and tag the bug report with 'linux-2.6.27'. Also, please specifically note if the issue does or does not appear in the 2.6.26 kernel. Thanks again, we really appreicate your help and feedback.

randallw (rwayth) wrote :

Same again with live CD intrepid alpha 5. dmesg shows DMA activating automatically on boot. Looks good.

claus.behl@gmx.de (claus-behl) wrote :

i made a fresh install of Intrepid Ibex 8.10 (ubuntu-8.10-beta-desktop-i386.iso) on my toshiba satellite. Very slow dvd playback.
No dma and
sudo hdparm -d1 /dev/scd0

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

randallw (rwayth) wrote :

Hi Claus,
Please be advised that the 'hdparm' command doesn't work with the newer kernels. (Any kernel where your device is /dev/scd rather than /dev/hd )
It seems that enough people try it that it is the right thing to do, but it isn't. There will be a few lines in the dmesg output that tell you what is going on, like in mysticism's post near the top of this thread.

323232 (323232) wrote :

Same problem on fully updated Intrepid
DVD playing is extremely choppy / almost impossible!
dsmeg gives te following output:
[ 4.204372] ata2.00: ATAPI: SONY DVD RW DW-D56A, PFS3, max UDMA/33
[ 4.204389] ata2.00: WARNING: ATAPI DMA disabled for reliablity issues. It can be enabled
[ 4.204392] ata2.00: WARNING: via pata_ali.atapi_dma modparam or corresponding sysfs node.

DVD Playback in Hardy was fine.
The cdrom changed from hdc (Hardy) tot scd0

randallw (rwayth) wrote :

So have you tried turning on DMA as suggested by the dmesg output?

See the second post of this message for how to do it:
http://forums.fedoraforum.org/showthread.php?t=202162

323232 (323232) wrote :

Thanx,

+ adding options pata_ali atapi_dma=1 to /etc/modules
or
+ adding pata_ali.atapi_dma=1 to boot options (unrecognized command)
did not work,
still error in dsmeg and choppy video

also sudo echo 1 > /sys/module/pata_ali/parameters/atapi_dma did not work (permission denied).

output for hdparm -i /dev/sr0 indicates udma2 mode
(disks are in udma5mode)

so: i am puzzeled ??

/dev/sr0:

 Model=SONY DVD RW DW-D56A , FwRev=PFS3 , SerialNo=
 Config={ Fixed Removeable DTR<=5Mbs DTR>10Mbs nonMagnetic }
 RawCHS=0/0/0, TrkSize=0, SectSize=0, ECCbytes=0
 BuffType=unknown, BuffSize=0kB, MaxMultSect=0
 (maybe): CurCHS=0/0/0, CurSects=0, LBA=yes, LBAsects=0
 IORDY=yes, tPIO={min:227,w/IORDY:120}, tDMA={min:120,rec:120}
 PIO modes: pio0 pio1 pio2 pio3 pio4
 DMA modes: mdma0 mdma1 mdma2
 UDMA modes: udma0 udma1 *udma2
 AdvancedPM=no
 Drive conforms to: Unspecified: ATA/ATAPI-5

 * signifies the current active mode

randallw (rwayth) wrote :

Hi,

I think the file you want to modify for options is /etc/modprobe.d/options. Check out the modprobe manpage.
/etc/modules just lists modules to load.

Also, I don't think the hdparm command can be used for the newer kernels. It is a shame that use of this command as a diagnostic of brokenness seems to have crept in as standard even though it is not applicable.

Regarding "sudo echo ..."
what you have typed will not work because the "echo 1" part of the command runs as root, but the "> /sys..." part doesn't. Become root (sudo su), then try "echo 1 > /sys..."

Good luck.

323232 (323232) wrote :

Thanx for your quick response.
After adding options pata_ali atapi_dma=1 to the options file the dma is activated. But inserting a dvd didnt result in automaticly playing in. Manaul start of totum and ordering to play the dvd freezes the application. Its becomes also impossible to eject. (perhaps the reason for the disabled dma).
So proberly stick to Hardy?

323232 (323232) wrote :

This is the dsmeg with: options pata_ali atapi_dma=1

dmesg | grep ata
[ 0.000000] BIOS-e820: 000000001df70000 - 000000001df7f000 (ACPI data)
[ 0.000000] #0 [0000000000 - 0000001000] BIOS data page ==> [0000000000 - 0000001000]
[ 0.000000] PERCPU: Allocating 41628 bytes of per cpu data
[ 0.000000] Kernel command line: root=UUID=d6233106-72c1-4e5a-a66e-cbcdec88416c ro rootflags=data=writeback quiet noresume
[ 0.004000] Memory: 472644k/490944k available (2572k kernel code, 17688k reserved, 1160k data, 424k init, 0k highmem)
[ 0.004000] .data : 0xc03832aa - 0xc04a5680 (1160 kB)
[ 0.393307] ACPI: EC: GPE = 0x18, I/O: command/status = 0x66, data = 0x62
[ 1.675044] Write protecting the kernel read-only data: 936k
[ 2.951158] libata version 3.00 loaded.
[ 3.856681] pata_ali 0000:00:0f.0: can't derive routing for PCI INT A
[ 3.858496] scsi0 : pata_ali
[ 3.858722] scsi1 : pata_ali
[ 3.860074] ata1: PATA max UDMA/100 cmd 0x1f0 ctl 0x3f6 bmdma 0x8080 irq 14
[ 3.860078] ata2: PATA max UDMA/100 cmd 0x170 ctl 0x376 bmdma 0x8088 irq 15
[ 4.024658] ata1.00: ATA-6: HTS726060M9AT00, MH4OA68A, max UDMA/100
[ 4.024664] ata1.00: 117210240 sectors, multi 16: LBA48
[ 4.040609] ata1.00: configured for UDMA/100
[ 4.204382] ata2.00: ATAPI: SONY DVD RW DW-D56A, PFS3, max UDMA/33
[ 4.220261] ata2.00: configured for UDMA/33
[ 4.743664] EXT3-fs: mounted filesystem with writeback data mode.
[ 22.733644] EXT3-fs: mounted filesystem with writeback data mode.
[ 168.124464] ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
[ 168.124649] ata2.00: cmd a0/01:00:00:00:10/00:00:00:00:00/a0 tag 0 dma 4096 in
[ 168.124720] ata2.00: status: { DRDY }
[ 173.144095] ata2: link is slow to respond, please be patient (ready=0)
[ 178.128362] ata2: device not ready (errno=-16), forcing hardreset
[ 178.128418] ata2: soft resetting link
[ 178.300783] ata2.00: configured for UDMA/33
[ 178.300903] ata2: EH complete
[ 209.904521] ata2.00: limiting speed to UDMA/25:PIO4
[ 209.904655] ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
[ 209.904757] ata2.00: cmd a0/01:00:00:00:10/00:00:00:00:00/a0 tag 0 dma 4096 in
[ 209.904824] ata2.00: status: { DRDY }
[ 214.948090] ata2: link is slow to respond, please be patient (ready=0)
[ 219.936108] ata2: device not ready (errno=-16), forcing hardreset
[ 219.936126] ata2: soft resetting link
[ 220.116294] ata2.00: configured for UDMA/25
[ 220.116330] ata2: EH complete
[ 251.424674] ata2.00: limiting speed to PIO4
[ 251.424805] ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
[ 251.424921] ata2.00: cmd a0/01:00:00:00:10/00:00:00:00:00/a0 tag 0 dma 4096 in
[ 251.424991] ata2.00: status: { DRDY }
[ 256.464108] ata2: link is slow to respond, please be patient (ready=0)
[ 261.448063] ata2: device not ready (errno=-16), forcing hardreset
[ 261.448081] ata2: soft resetting link
[ 261.628312] ata2.00: configured for PIO4
[ 261.628354] ata2: EH complete

randallw (rwayth) wrote :

Well, I'm not a kernel developer, but that doesn't look good. Looks like it tries a bunch of DMA modes and they all fail and it ends up going back to PIO mode which is the slow cpu-does-everything mode.

I'm not sure if this will make you feel any better, but you could try digging around the libata wiki. E.g.:
http://ata.wiki.kernel.org/index.php/Pata_ali

Also, I'm not sure how up-to-date this is, but there are also some suggestions here:
http://linux-ata.org/faq.html
This website also has a little on exactly why there was the change from the old, reliable IDE type drivers that worked and we loved to the new ones that have regressions like this bug.

Marc Quinton (mquinton) wrote :

this bug is now present on my system containing an ALI chipset, running ubuntu-intrepid. I have never seen this problem before using ubuntu.

Issuing echo 1 > /sys/module/pata_ali/parameters/atapi_dma resolved my problem.

Hi Tzadik,

Since you are the original bug reporter, care to test and confirm if this issue remains with the latest Karmic 9.10 Alpha development release of Ubuntu. ISO CD images are available from http://cdimage.ubuntu.com/releases/ . Please let us know your results. Thanks.

Marc Quinton (mquinton) wrote :

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/175022

hello, I'm using karmic, here is the dmesg related to this BUG :

[ 2.824409] ata6.00: ATAPI: TSSTcorpCD/DVDW SH-S162L, TS04, max UDMA/33
[ 2.824443] ata6.00: WARNING: ATAPI DMA disabled for reliablity issues. It can be enabled
[ 2.824446] ata6.00: WARNING: via pata_ali.atapi_dma modparam or corresponding sysfs node.
[ 2.856347] ata6.00: configured for UDMA/33
[ 2.857264] scsi 5:0:0:0: CD-ROM TSSTcorp CD/DVDW SH-S162L TS04 PQ: 0 ANSI: 5
[ 2.860086] sr0: scsi3-mmc drive: 62x/62x writer dvd-ram cd/rw xa/form2 cdda tray
[ 2.860090] Uniform CD-ROM driver Revision: 3.20
[ 2.860191] sr 5:0:0:0: Attached scsi CD-ROM sr0
[ 2.860255] sr 5:0:0:0: Attached scsi generic sg3 type 5
[ 2.860296] Freeing unused kernel memory: 540k freed

the bug seems to be still present under karmic, but with new message error :
 - still having heavy load by default,
 - Issuing echo 1 > /sys/module/pata_ali/parameters/atapi_dma resolved my problem.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments