# SATA DVD-RW Drive

## rwescoat

I've got a SATA DVD-RW drive from Plextor (PX-712SA) that my kernel doesn't seem to like.

According to dmesg, it's not even being seen.  Windows saw it just fine when I had it installed

though, so it's not a cable error.  It's on a VIA VT6420 with a VIA VT8237 southbridge.

Any ideas?

```
libata version 1.11 loaded.

sata_via version 1.1

ACPI: PCI Interrupt Link [ALKA] BIOS reported IRQ 11, using IRQ 20

ACPI: PCI Interrupt Link [ALKA] enabled at IRQ 20

ACPI: PCI Interrupt 0000:00:0f.0[B] -> Link [ALKA] -> GSI 20 (level, low) -> IRQ 169

PCI: Via IRQ fixup for 0000:00:0f.0, from 11 to 9

sata_via(0000:00:0f.0): routed to hard irq line 9

ata1: SATA max UDMA/133 cmd 0xB800 ctl 0xBC02 bmdma 0xC800 irq 169

ata2: SATA max UDMA/133 cmd 0xC000 ctl 0xC402 bmdma 0xC808 irq 169

ata1: dev 0 cfg 49:2f00 82:7c6b 83:7b09 84:4003 85:7c69 86:3a01 87:4003 88:407f

ata1: dev 0 ATA-7, max UDMA/133, 120103200 sectors: LBA

ata1: dev 0 configured for UDMA/133

scsi0 : sata_via

ata2: dev 0 cfg 49:0f00 82:0000 83:0000 84:0000 85:0000 86:0000 87:0000 88:0407

ata2: dev 0 ATAPI, max UDMA/33

ata2: dev 0 configured for UDMA/33

scsi1 : sata_via

  Vendor: ATA       Model: Maxtor 6Y060M0    Rev: YAR5

  Type:   Direct-Access                      ANSI SCSI revision: 05

SCSI device sda: 120103200 512-byte hdwr sectors (61493 MB)

SCSI device sda: drive cache: write back

SCSI device sda: 120103200 512-byte hdwr sectors (61493 MB)

SCSI device sda: drive cache: write back

 sda: sda1 sda2

Attached scsi disk sda at scsi0, channel 0, id 0, lun 0

Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0,  type 0

```

```
  Vendor: Mitsumi   Model: VT6205-DevB       Rev: 2.67

  Type:   Direct-Access                      ANSI SCSI revision: 02

Attached scsi removable disk sdb at scsi2, channel 0, id 0, lun 0

Attached scsi generic sg1 at scsi2, channel 0, id 0, lun 0,  type 0
```

I've only added this just in case it helps.  This is my 7-in-1 card reader.

----------

## s0be

atapi support isn't in libata to any great extent yet.  I believe there's something like #DEFINE LIBATA_ATAPI False in a header somewhere you can change to enable it, but it'll just break stuff.  

Rather than cruft together 98 different solutions and call it libata, I believe they're taking their time and making sure to do (most) things right at the sacrifice of some functionality along the way.

----------

## tweakt

 *Quote:*   

> atapi support isn't in libata to any great extent yet. I believe there's something like #DEFINE LIBATA_ATAPI False in a header somewhere you can change to enable it, but it'll just break stuff. 

 

Wrong!

I built an all-SATA system recently, and found it quite odd that Ubuntu liveCD would detect my drive, and even Gentoo 2005.1 would not. Well after digging, I also came up with the same fix. The code exists, is working, but is currently disabled by default (not a config option, a hardcoded compile time option as above).

I've tested it and had no problems. I was able to burn CDs with cdrecord. I'm sure there may be some rough edges, but certainly does not affect system stability. I'm sure there are valid reasons to leave support disabled by default until it's finalized, but if you need support now, it's very easy and safe to enable. I'll post a followup tomorrow with a patch you can apply to 2.6.12-gentoo-r7 (latest gentoo-sources). 

Personally, I strongly felt this should've made it in as a patch to gentoo-sources and been on 2005.1, since it does not affect non ATAPI devices, only enables support for people trying to use the newer drives. (I have a PX-716SA).

----------

## rwescoat

Thank you both!  It would be most appreciated if you could post that patch.

----------

## widan

 *rwescoat wrote:*   

> Thank you both!  It would be most appreciated if you could post that patch.

 

In /usr/src/linux/include/linux/libata.h, change:

```
#undef ATA_ENABLE_ATAPI           /* define to enable ATAPI support */
```

Into:

```
#define ATA_ENABLE_ATAPI          /* define to enable ATAPI support */
```

----------

## dsd

there is a reason it isnt on by default, the code literally isnt complete, and some users will experience problems with it. i asked Jeff Garzik (the libata developer/maintainer) for advice about whether i should turn it on by default in gentoo and he said *dont* do it - the distro's that have done this are suffering greatly (boot problems, corruption problems, freezing, etc)...

while it might work for some users/drives/controllers it will bring problems for others. dont be too suprised if it doesnt work flawlessly

----------

## tweakt

Ok, thanks for following up on this. Like I said, I'm sure there was justification... but it ate about 4 solid hours of troubleshooting and debugging before I could find the solution. Maybe this can make it's way into a FAQ or handbook somewhere. These drives will become more common going forward, but right now there are only a handful of models.

Also glad to know it's on the radar for gentoo-sources. Not sure how bad it could be though if other distros have this in their default install and livecds. I'm curious what the adverse affects are. Possibly affecting non SATA atapi devices, or SATA hard drives when no SATA-ATAPI devices are present? Otherwise... without it... SATA optical drives do not function at all. So I'd prefer to have a flaky DVD-RW, than none at all.

----------

## beltazore

Did this work? I have the exact same problem  :Wink: 

----------

## tweakt

Yes!

I have a Plextor PX-716SA and it's been working flawlessly now for 2 months. I've burned countless CDs and DVDs with it.

Currently running 2.6.13-gentoo-r2 with no problems, I use this patch to make things quick and easy when updating:

```
diff -urN linux-2.6.12/include/linux/libata.h linux-2.6.12-libata/include/linux/libata.h

--- linux-2.6.12/include/linux/libata.h   2005-08-09 23:30:31.000000000 -0400

+++ linux-2.6.12-libata/include/linux/libata.h   2005-08-09 23:31:17.000000000 -0400

@@ -37,7 +37,7 @@

 #undef ATA_VERBOSE_DEBUG   /* yet more debugging output */

 #undef ATA_IRQ_TRAP      /* define to ack screaming irqs */

 #undef ATA_NDEBUG      /* define to disable quick runtime checks */

-#undef ATA_ENABLE_ATAPI      /* define to enable ATAPI support */

+#define ATA_ENABLE_ATAPI   /* define to enable ATAPI support */

 #undef ATA_ENABLE_PATA      /* define to enable PATA support in some

              * low-level drivers */

 #undef ATAPI_ENABLE_DMADIR   /* enables ATAPI DMADIR bridge support */

```

----------

## beltazore

It was working flawless for me too, but I reinstalled gentoo after a disc crash, and after the reinstall it would not work at all. I have altso tried this patch. 

Is there any thing else that can cause this problems?

But I will try again, with 2.6.13-r2.

----------

## TheLegend81

 *tweakt wrote:*   

> Yes!
> 
> I have a Plextor PX-716SA and it's been working flawlessly now for 2 months. I've burned countless CDs and DVDs with it.
> 
> Currently running 2.6.13-gentoo-r2 with no problems, I use this patch to make things quick and easy when updating:
> ...

 

which patch?  or is you're code actually a patch...    I'm such a newb.

----------

## Mr_Pony

Here's a guide I've found handy for my SATA issues:  http://www.thinkwiki.org/wiki/Problems_with_SATA_and_Linux . Hope it helps!

----------

## tuppe666

ATA_ENABLE_ATAPI does not exist in version 2.6.14 ???

----------

## dsd

it is now a module parameter

----------

## tuppe666

I'm tring to pass it as a kernel parameter, but get nothing. Am I doing something stupid

grub:

```
title=Latest

        root (hd0,0)

        kernel /vmlinuz libata.atapi_enabled=1 ide1=noprobe root=/dev/md2 video=intelfb:1200x800-16@75,accel=1,vram=16 vmalloc=256m

```

[/quote]

----------

## mrfree

```
# dmesg | grep libata

Unknown boot option 'libata.atapi_enabled=1': ignoring
```

Edit: I've read that this option is available since 2.6.14 I'll try it...

----------

## sibov

 *mrfree wrote:*   

> 
> 
> ```
> # dmesg | grep libata
> 
> ...

 

Does it work for you mrfree?

 :Question: 

----------

## augury

It was in mm-sources for a while but nfs is weird in 2.6.14.  Should give smart access to sata drives.

----------

## mrfree

 *sibov wrote:*   

> 
> 
> Does it work for you mrfree?

 

Yeah!   :Smile: 

(but I haven't burned any cd/dvd yet)

----------

## hex63

 *tuppe666 wrote:*   

> I'm tring to pass it as a kernel parameter, but get nothing. Am I doing something stupid
> 
> grub:
> 
> ```
> ...

 [/quote]

I tried this and it worked fine for me.

Gentoo-source 2.6.14-r5

```
# dmesg | grep libata

Bootdata ok (command line is libata.atapi_enabled=1 root=/dev/sdb3 vga=0x31B video=vesafb:mtrr,ywrap)

Kernel command line: libata.atapi_enabled=1 root=/dev/sdb3 vga=0x31B video=vesafb:mtrr,ywrap

libata version 1.12 loaded.
```

Burning a DVD right now   :Smile: 

Thanks for the info tuppe666!

----------

## yokem55

Has anyone successfully played cd's with this drive?  I'm running the latest 2.6.15 rc and all I get when cdparanoia or kio_audiocd tries to read the disk is this:

```
sg_write: data in/out 12/12 bytes for SCSI command 0x43--guessing data in;

   program kio_audiocd not setting count and/or reply_len properly
```

----------

## remy

I've got a SATA DVD-RW from Plextor (PX-716SA), but I've got still no luck. My motherboard is a Asus K8V SE with a VIA K8T800 (north) and VIA VT8237 (south). I use the 2.6.15-gentoo kernel with the following boot parameters:

 *Quote:*   

> kernel /vmlinuz-2.6.15-gentoo init=linuxrc ramdisc=8192 real_root=/dev/hdb1 video=vesafb:ywrap,mtrr vga=0x31B splash=silent,fadein,theme:livecd-2005.1 quiet CONSOLE=/dev/tty1 udev libata.atapi_enabled=1
> 
> 

 

"dmesg | grep ata" gives the following output

 *Quote:*   

> libata version 1.20 loaded.
> 
> sata_via 0000:00:0f.0: version 1.1
> 
> sata_via 0000:00:0f.0: routed to hard irq line 9
> ...

 

Who has got an idea?

----------

## xbb

I have a PX-716SA as well and can't get it working well...

The sata harddrive is working well... I tried different kernels (2.6.14, 2.6.15) and patchsets including libata patches, here is some dmesg output (libata.atapi_enabled=1):

There is an empty CD-R inserted in the drive, without any media inserted dmesg would loop "ata6: command error, drv_stat 0x51 host_stat 0x5"

```

Uniform CD-ROM driver Revision: 3.20

libata version 1.12 loaded.

ata_piix version 1.04

ACPI: PCI Interrupt 0000:00:1f.2[B] -> GSI 19 (level, low) -> IRQ 20

PCI: Setting latency timer of device 0000:00:1f.2 to 64

ata1: SATA max UDMA/133 cmd 0x9C00 ctl 0x9882 bmdma 0x9400 irq 20

ata2: SATA max UDMA/133 cmd 0x9800 ctl 0x9482 bmdma 0x9408 irq 20

ata1: dev 0 cfg 49:2f00 82:74eb 83:7f63 84:4003 85:74e9 86:3c43 87:4003 88:207f

ata1: dev 0 ATA-6, max UDMA/133, 145226112 sectors: LBA48

ata1(0): applying bridge limits

ata1: dev 0 configured for UDMA/100

scsi0 : ata_piix

ATA: abnormal status 0x7F on port 0x9807

ata2: disabling port

scsi1 : ata_piix

  Vendor: ATA       Model: WDC WD740GD-00FL  Rev: 21.0

  Type:   Direct-Access                      ANSI SCSI revision: 05

sata_sil version 0.9

ACPI: PCI Interrupt 0000:01:05.0[A] -> GSI 22 (level, low) -> IRQ 21

ata3: SATA max UDMA/100 cmd 0xF0806880 ctl 0xF080688A bmdma 0xF0806800 irq 21

ata4: SATA max UDMA/100 cmd 0xF08068C0 ctl 0xF08068CA bmdma 0xF0806808 irq 21

ata5: SATA max UDMA/100 cmd 0xF0806A80 ctl 0xF0806A8A bmdma 0xF0806A00 irq 21

ata6: SATA max UDMA/100 cmd 0xF0806AC0 ctl 0xF0806ACA bmdma 0xF0806A08 irq 21

ata3: no device found (phy stat 00000000)

scsi2 : sata_sil

ata4: no device found (phy stat 00000000)

scsi3 : sata_sil

ata5: no device found (phy stat 00000000)

scsi4 : sata_sil

ata6: dev 0 cfg 49:0f00 82:0000 83:0000 84:0000 85:0000 86:0000 87:0000 88:001f

ata6: dev 0 ATAPI, max UDMA/66

ata6(0): applying bridge limits

ata6: dev 0 configured for UDMA/66

scsi5 : sata_sil

  Vendor: PLEXTOR   Model: DVDR   PX-716A    Rev: 1.09

  Type:   CD-ROM                             ANSI SCSI revision: 05

SCSI device sda: 145226112 512-byte hdwr sectors (74356 MB)

SCSI device sda: drive cache: write back

SCSI device sda: 145226112 512-byte hdwr sectors (74356 MB)

SCSI device sda: drive cache: write back

 sda: sda1 sda2 sda3 < sda5 sda6 sda7 > sda4

Attached scsi disk sda at scsi0, channel 0, id 0, lun 0

sr0: scsi3-mmc drive: 40x/40x writer cd/rw xa/form2 cdda tray

Attached scsi CD-ROM sr0 at scsi5, channel 0, id 0, lun 0

Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0,  type 0

Attached scsi generic sg1 at scsi5, channel 0, id 0, lun 0,  type 5

.......

ata6: command error, drv_stat 0x51 host_stat 0x5

ata6: command error, drv_stat 0x51 host_stat 0x5

.......

cdrom: open failed.

.......

ata6: command error, drv_stat 0x51 host_stat 0x5

ata6: command error, drv_stat 0x51 host_stat 0x5

.......

cdrom: This disc doesn't have any tracks I recognize!

.......

ata6: command error, drv_stat 0x51 host_stat 0x5

ata6: command 0xa0 timeout, stat 0xd0 host_stat 0x1

ata6: translated ATA stat/err 0xa0/00 to SCSI SK/ASC/ASCQ 0xb/47/00

ATA: abnormal status 0x78 on port 0xF0806AC7

ATA: abnormal status 0x78 on port 0xF0806AC7

ATA: abnormal status 0x78 on port 0xF0806AC7

ata6 is slow to respond, please be patient

ata6 failed to respond (30 secs)

ata6: PIO error, drv_stat 0xf8

ATA: abnormal status 0xF8 on port 0xF0806AC7

ata6: translated ATA stat/err 0xa0/00 to SCSI SK/ASC/ASCQ 0xb/47/00

ATA: abnormal status 0xF8 on port 0xF0806AC7

ATA: abnormal status 0xF8 on port 0xF0806AC7

ATA: abnormal status 0xF8 on port 0xF0806AC7

ata6 is slow to respond, please be patient

ata6: command 0xa0 timeout, stat 0xf8 host_stat 0x0

ata6: translated ATA stat/err 0xa0/00 to SCSI SK/ASC/ASCQ 0xb/47/00

ATA: abnormal status 0xF8 on port 0xF0806AC7

ATA: abnormal status 0xF8 on port 0xF0806AC7

ATA: abnormal status 0xF8 on port 0xF0806AC7

ata6 failed to respond (30 secs)

ata6: PIO error, drv_stat 0xf8

ATA: abnormal status 0xF8 on port 0xF0806AC7

ata6: translated ATA stat/err 0xa0/00 to SCSI SK/ASC/ASCQ 0xb/47/00

ATA: abnormal status 0xF8 on port 0xF0806AC7

ATA: abnormal status 0xF8 on port 0xF0806AC7

ATA: abnormal status 0xF8 on port 0xF0806AC7

ata6 is slow to respond, please be patient

ata6: command 0xa0 timeout, stat 0xf8 host_stat 0x0

ata6: translated ATA stat/err 0xa0/00 to SCSI SK/ASC/ASCQ 0xb/47/00

sr0: CDROM (ioctl) error, command: <6>Test Unit Ready 00 00 00 00 00 00

sr: Current [descriptor]: sense key: Aborted Command

    Additional sense: Scsi parity error

ATA: abnormal status 0xF8 on port 0xF0806AC7

ATA: abnormal status 0xF8 on port 0xF0806AC7

ATA: abnormal status 0xF8 on port 0xF0806AC7

ata6 failed to respond (30 secs)

ata6: PIO error, drv_stat 0xf8

ATA: abnormal status 0xF8 on port 0xF0806AC7

ata6: translated ATA stat/err 0xa0/00 to SCSI SK/ASC/ASCQ 0xb/47/00

ATA: abnormal status 0xF8 on port 0xF0806AC7

ATA: abnormal status 0xF8 on port 0xF0806AC7

ATA: abnormal status 0xF8 on port 0xF0806AC7

ata6 is slow to respond, please be patient

ata6: command 0xa0 timeout, stat 0xf8 host_stat 0x0

ata6: translated ATA stat/err 0xa0/00 to SCSI SK/ASC/ASCQ 0xb/47/00

ioctl_internal_command: <5 0 0 0> return code = 8000002

   : Current [descriptor]: sense key: Aborted Command

    Additional sense: Scsi parity error

ATA: abnormal status 0xF8 on port 0xF0806AC7

ATA: abnormal status 0xF8 on port 0xF0806AC7

ATA: abnormal status 0xF8 on port 0xF0806AC7

ata6 failed to respond (30 secs)

ata6: PIO error, drv_stat 0xf8

ATA: abnormal status 0xF8 on port 0xF0806AC7

ata6: translated ATA stat/err 0xa0/00 to SCSI SK/ASC/ASCQ 0xb/47/00

ATA: abnormal status 0xF8 on port 0xF0806AC7

ATA: abnormal status 0xF8 on port 0xF0806AC7

ATA: abnormal status 0xF8 on port 0xF0806AC7

ata6 is slow to respond, please be patient

```

----------

## janosh

I have the same problem as xbb.

In kernels prior to 2.6.14.x, i coud use the old atapi-enabled patch, and it woud detect my dwd-rw.

After upgrading to kernel 2.6.14.2 and later and using the libata.atapi_enabled=1 boot option, i get this in my dmesg, and no dvd-rw

This is from kernel 2.6.15:

```
sata_sil 0000:03:03.0: version 0.9

ACPI: PCI Interrupt 0000:03:03.0[A] -> GSI 19 (level, low) -> IRQ 17

ata3: SATA max UDMA/100 cmd 0xF8802080 ctl 0xF880208A bmdma 0xF8802000 irq 17

ata4: SATA max UDMA/100 cmd 0xF88020C0 ctl 0xF88020CA bmdma 0xF8802008 irq 17

ata3: dev 0 cfg 49:0b00 82:0000 83:0000 84:0000 85:0000 86:0000 87:0000 88:0007

ata3: dev 0 ATAPI, max UDMA/33

ata3: dev 0 configured for UDMA/33

scsi2 : sata_sil

ata4: no device found (phy stat 00000000)

scsi3 : sata_sil

ata3: command 0xa0 timeout, stat 0x78 host_stat 0x1

ATA: abnormal status 0x78 on port 0xF8802087

ATA: abnormal status 0x78 on port 0xF8802087

ATA: abnormal status 0x78 on port 0xF8802087

ATA: abnormal status 0x78 on port 0xF8802087

ata3 is slow to respond, please be patient

ata3 failed to respond (30 secs)

ATA: abnormal status 0xF8 on port 0xF8802087

ata3: translated ATA stat/err 0xf8/00 to SCSI SK/ASC/ASCQ 0xb/47/00
```

In kernel 2.6.14.2, the libata.atapi_enabled=1 just hangs the kernel with no error messages, an i have to reboot.

I also see that these lines:

 *xbb wrote:*   

> ata6: command 0xa0 timeout, stat 0xd0 host_stat 0x1
> 
> ata6: translated ATA stat/err 0xa0/00 to SCSI SK/ASC/ASCQ 0xb/47/00
> 
> ATA: abnormal status 0x78 on port 0xF0806AC7
> ...

 

are very simmilar to the lines from my dmesg.

Witch might indicate that our problems are simmilar.

It was delighting to see that I'm not the only one with this problem, because I've been googling around about this problem, for a couple of weeks, I even posted to the linux kernel mailing list.

http://lkml.org/lkml/2006/1/17/306

It woud be nice if someone could help.

--

Jonarne

----------

