Skip to contentSkip to conversation

2.6.19.1, sata_sil: sata dvd writer doesn't work

DISCUSSION Harald Dunkel 2 participants 15 messages Dec 16, 2006 – Jan 18, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi folks,

I've got a problem with a Samsung SATA dvd writer: It doesn't play video DVDs. If I connect the same drive via an adapter to USB, then there is no such problem.

dmesg says:

ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen ata2.00: (BMDMA stat 0x1)
ata2.00: tag 0 cmd 0xa0 Emask 0x4 stat 0x40 err 0x0 (timeout)
ata2: soft resetting port
ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 310) ata2.00: model number mismatch 'TSSTcorpCD/DVDW SH-S183A' != 'ÑÅÌhõ³Nõ

This is reproducible.

lspci:
01:07.0 RAID bus controller: Silicon Image, Inc. SiI 3512 [SATALink/SATARaid] Serial ATA Controller (rev 01) 01:07.0 0104: 1095:3512 (rev 01)

/proc/scsi/scsi:
Host: scsi1 Channel: 00 Id: 00 Lun: 00
Vendor: TSSTcorp Model: CD/DVDW SH-S183A Rev: SB01
Type: CD-ROM ANSI SCSI revision: 05

I already asked Samsung's hotline for a firmware update, but there is none available. They haven't heard of this problem before, either. My wild guess would be that this is a driver problem.

Kernels tried: 2.6.19.1, 2.6.18.3

What would be your suggestion to track down this problem?

Regards

Harri

#1 lore raw
Quoted 6 lines · Harald Dunkel

ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen ata2.00: (BMDMA stat 0x1)
ata2.00: tag 0 cmd 0xa0 Emask 0x4 stat 0x40 err 0x0 (timeout)
ata2: soft resetting port
ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 310) ata2.00: model number mismatch 'TSSTcorpCD/DVDW SH-S183A' != 'ÑÅÌhõ³Nõ

This is really fishy. Something really went wrong there. Please post full dmesg and does the drive work at all? - eg. data dvd or cd. How reproducible is the problem? What program did you use to play dvd? If mplayer, please run it with -v and post what it says (usb case too).

Signature · 1 line
tejun
#2 lore raw

Hi Tejun,

Quoted 10 lines · Tejun Heo
Quoted 6 lines · Harald Dunkel

ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen ata2.00: (BMDMA stat 0x1)
ata2.00: tag 0 cmd 0xa0 Emask 0x4 stat 0x40 err 0x0 (timeout)
ata2: soft resetting port
ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 310) ata2.00: model number mismatch 'TSSTcorpCD/DVDW SH-S183A' != 'ÑÅÌhõ³Nõ

This is really fishy. Something really went wrong there. Please post full dmesg and does the drive work at all? - eg. data dvd or cd.

I haven't tried writing CDs yet, but the last backup on DVD went fine. And it is really fast: It starts writing DVDs with 8X and goes up to 18X (Verbatim DVD-R 16X). I don't see a DMA problem.

Quoted 2 lines

How
reproducible is the problem?

Always. I tried 5 different commercial video DVD by now. All showed this problem. The video DVDs I created in a Philips DVD recorder (DVD-R) play fine. BTW, region code has been set to 2 (Europe) using regionset. There was no error message, AFAIR.

Quoted 1 line

What program did you use to play dvd?

xine, mplayer.

Quoted 3 lines

If
mplayer, please run it with -v and post what it says (usb case too).

See attachments.

Hope this helps. Please mail if you need more info, or if there is something to try.

Regards

Harri

#3 lore raw

* dmesg is truncated, please post the content of file /var/log/boot.msg.

* Please post the result of 'lspci -nnvvv'

* Please try the attached patch and see if it makes any difference and post the result of 'dmesg' after trying to play a problematic dvd.

Signature · 1 line
tejun
drivers/ata/libata-eh.c +36 -5
index 02b2b27..bbbec75 100644
@@ -1433,16 +1433,47 @@ static void ata_eh_report(struct ata_port *ap)
 	}
 
 	for (tag = 0; tag < ATA_MAX_QUEUE; tag++) {
+		static const char *dma_str[] = {
+			[DMA_BIDIRECTIONAL]	= "bidi",
+			[DMA_TO_DEVICE]		= "out",
+			[DMA_FROM_DEVICE]	= "in",
+			[DMA_NONE]		= "",
+		};
 		struct ata_queued_cmd *qc = __ata_qc_from_tag(ap, tag);
+		struct ata_taskfile *cmd = &qc->tf, *res = &qc->result_tf;
+		const u8 *c = qc->cdb;
+		unsigned int nbytes;
 
 		if (!(qc->flags & ATA_QCFLAG_FAILED) || !qc->err_mask)
 			continue;
 
-		ata_dev_printk(qc->dev, KERN_ERR, "tag %d cmd 0x%x "
-			       "Emask 0x%x stat 0x%x err 0x%x (%s)\n",
-			       qc->tag, qc->tf.command, qc->err_mask,
-			       qc->result_tf.command, qc->result_tf.feature,
-			       ata_err_string(qc->err_mask));
+		nbytes = qc->nbytes;
+		if (!nbytes)
+			nbytes = qc->nsect << 9;
+
+		ata_dev_printk(qc->dev, KERN_ERR,
+			"cmd %02x/%02x:%02x:%02x:%02x:%02x/%02x:%02x:%02x:%02x:%02x/%02x "
+			"tag %d cdb 0x%x data %u %s\n         "
+			"res %02x/%02x:%02x:%02x:%02x:%02x/%02x:%02x:%02x:%02x:%02x/%02x "
+			"Emask 0x%x (%s)\n",
+			cmd->command, cmd->feature, cmd->nsect,
+			cmd->lbal, cmd->lbam, cmd->lbah,
+			cmd->hob_feature, cmd->hob_nsect,
+			cmd->hob_lbal, cmd->hob_lbam, cmd->hob_lbah,
+			cmd->device, qc->tag, qc->cdb[0], nbytes,
+			dma_str[qc->dma_dir],
+			res->command, res->feature, res->nsect,
+			res->lbal, res->lbam, res->lbah,
+			res->hob_feature, res->hob_nsect,
+			res->hob_lbal, res->hob_lbam, res->hob_lbah,
+			res->device, qc->err_mask, ata_err_string(qc->err_mask));
+
+		ata_dev_printk(qc->dev, KERN_ERR,
+			       "CDB: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x "
+			       "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x p=%d\n",
+			       c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7],
+			       c[8], c[9], c[10], c[11], c[12], c[13], c[14], c[15],
+			       cmd->protocol);
 	}
 }
 
drivers/scsi/scsi_lib.c +1 -0
index 3ac4890..f018e49 100644
@@ -191,6 +191,7 @@ int scsi_execute(struct scsi_device *sdev, const unsigned char *cmd,
 		goto out;
 
 	req->cmd_len = COMMAND_SIZE(cmd[0]);
+	memset(req->cmd, 0, BLK_MAX_CDB); /* ATAPI hates garbage after CDB */
 	memcpy(req->cmd, cmd, req->cmd_len);
 	req->sense = sense;
 	req->sense_len = 0;
#4 lore raw

Hi Tejun,

Quoted 7 lines · Tejun Heo

* dmesg is truncated, please post the content of file /var/log/boot.msg.

* Please post the result of 'lspci -nnvvv'

* Please try the attached patch and see if it makes any difference and post the result of 'dmesg' after trying to play a problematic dvd.

It still doesn't work, but the dmesg output looks less weird. See attachments.

Hope this helps. Please mail.

Regards

Harri

#14 lore raw
In reply to Harald Dunkel
Quoted 6 lines · Harald Dunkel

Hi folks,

I've got a problem with a Samsung SATA dvd writer: It doesn't play video DVDs. If I connect the same drive via an adapter to USB, then there is no such problem.

PS: To make sure that its not a hardware problem I have tried this drive in another PC, using ata_piix for sata. Same kernel, but 32bit. There was no problem here.

Regards

Harri

#5 lore raw
In reply to Harald Dunkel
Quoted 11 lines · Harald Dunkel

Hi Tejun,

Quoted 7 lines · Tejun Heo

* dmesg is truncated, please post the content of file /var/log/boot.msg.

* Please post the result of 'lspci -nnvvv'

* Please try the attached patch and see if it makes any difference and post the result of 'dmesg' after trying to play a problematic dvd.

Quoted 5 lines

It still doesn't work, but the dmesg output looks less weird. See attachments.

Hope this helps. Please mail.

Okay, Hmmm... Weird. I tried to reproduce it here w/ LG dvd ram and sil3114 (almost identical, just two more ports) with no success. I just ordered SH-S183A and it should arrive later today (zero-day shipping just at USD 3.5!).

I'll write again when I know more.

Signature · 1 line
tejun
#6 lore raw
Quoted 15 lines · Tejun Heo
Quoted 14 lines · Harald Dunkel

Hi Tejun,

Quoted 7 lines · Tejun Heo

* dmesg is truncated, please post the content of file /var/log/boot.msg.

* Please post the result of 'lspci -nnvvv'

* Please try the attached patch and see if it makes any difference and post the result of 'dmesg' after trying to play a problematic dvd.

It still doesn't work, but the dmesg output looks less weird. See attachments.

Quoted 9 lines
Quoted 1 line

Hope this helps. Please mail.

Okay, Hmmm... Weird. I tried to reproduce it here w/ LG dvd ram and sil3114 (almost identical, just two more ports) with no success. I just ordered SH-S183A and it should arrive later today (zero-day shipping just at USD 3.5!).

I'll write again when I know more.

Failed to reproduce here. Please do the following two things.

1. Post the result of "mplayer -v dvd:// > out 2>&1"

2. Apply the attached patch to v2.6.19 and report dmesg after playing dvd.

Happy new year.

Signature · 1 line
tejun
drivers/ata/libata-eh.c +12 -0
index 02b2b27..cd92a70 100644
@@ -1139,6 +1139,7 @@ static unsigned int ata_eh_analyze_tf(struct ata_queued_cmd *qc,
 		tmp = atapi_eh_request_sense(qc->dev,
 					     qc->scsicmd->sense_buffer);
 		if (!tmp) {
+			const u8 *c = qc->cdb;
 			/* ATA_QCFLAG_SENSE_VALID is used to tell
 			 * atapi_qc_complete() that sense data is
 			 * already valid.
@@ -1146,6 +1147,17 @@ static unsigned int ata_eh_analyze_tf(struct ata_queued_cmd *qc,
 			 * TODO: interpret sense data and set
 			 * appropriate err_mask.
 			 */
+			ata_dev_printk(qc->dev, KERN_ERR,
+				       "CDB: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x "
+				       "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x p=%d\n",
+				       c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7],
+				       c[8], c[9], c[10], c[11], c[12], c[13], c[14], c[15],
+				       qc->tf.protocol);
+			ata_dev_printk(qc->dev, KERN_ERR,
+				       "SENSE: k %02x a %02x:%02x\n",
+				       qc->scsicmd->sense_buffer[2],
+				       qc->scsicmd->sense_buffer[12],
+				       qc->scsicmd->sense_buffer[13]);
 			qc->flags |= ATA_QCFLAG_SENSE_VALID;
 		} else
 			qc->err_mask |= tmp;
drivers/ata/libata-scsi.c +124 -114

551 lines not on this page · raw message

include/linux/libata.h +0 -0
index abd2deb..7a4cf9e 100644
#7 lore raw

Hi Tejun,

After the patch was applied (using 2.6.19.1 instead of 2.6.19, hope you don't mind) I could play a DVD once. Unfortunately this was not reproducible, using the same DVD. I have attached the requested log files for the good and the last bad session. Hope this helps.

Which version of the SATA DVD writer have you received? The label on my writer says

H/W:A Ver:A September 2006

I hope I don't break any netiquette by posting large log files. Do I?

Many thanx

Harri

#8 lore raw

Hello,

Quoted 11 lines · Harald Dunkel

Hi Tejun,

After the patch was applied (using 2.6.19.1 instead of 2.6.19, hope you don't mind) I could play a DVD once. Unfortunately this was not reproducible, using the same DVD. I have attached the requested log files for the good and the last bad session. Hope this helps.

Which version of the SATA DVD writer have you received? The label on my writer says

H/W:A Ver:A September 2006

Mine is manufactured in December but other than that it's identical. Firmware version is the same too.

Quoted 2 lines

I hope I don't break any netiquette by posting large log files. Do I?

That's okay for me. vger might not be too happy tho. ;-)

Please do the following and post the result.

# strace mplayer -v dvd:// > out 2>&1

Happy new year.

Signature · 1 line
tejun
#9 lore raw

Hi Tejun,

Quoted 5 lines · Tejun Heo

Please do the following and post the result.

# strace mplayer -v dvd:// > out 2>&1

See attachment. I was lucky: On the first run with strace mplayer could play the DVD (still using Tron). But this was not reproducible.

Both strace files are attached. Hope this helps.

I noticed something else: If I run regionset to report the supported region, then it returns on 64bit:

% regionset
regionset version 0.1 -- reads/sets region code on DVD drives Current Region Code settings:
RPC Phase: Unknown (I)
type: NONE
vendor resets available: 0
user controlled changes resets available: 0
drive plays discs from region(s): 1 2 3 4 5 6 7 8, mask=0x00

I am pretty sure that this drive is not region-free. On 32bit (booting grml-0.9 from CD on a 2nd drive) I get the expected "region 2 only". Of course I used the same 32bit executable.

Regards

Harri

#10 lore raw
In reply to Tejun Heo

Hi Tejun,

Quoted 6 lines · Tejun Heo

Hello,

Please do the following and post the result.

# strace mplayer -v dvd:// > out 2>&1

I had sent this out last week. Any news about this?

Regards

Harri

#11 lore raw
Quoted 11 lines · Harald Dunkel

Hi Tejun,

Quoted 6 lines · Tejun Heo

Hello,

Please do the following and post the result.

# strace mplayer -v dvd:// > out 2>&1

I had sent this out last week. Any news about this?

Okay, I just tested a number of dvds on x86-64 and x86. The error pattern is really interesting. It doesn't matter whether you're on x86-64 or x86, 2.6.18 or 2.6.20-rc5. The problem occurs when a dvd which doesn't match dvd's region mask is played.

MMC command 0xa4 (READ KEY) is the one which always fails. After the failure, the odd goes into strange state and usually won't respond to commands. Interestingly, if you pull the power plug or reset the machine while the READ KEY command is in progress and then reconnect it, you can play the DVD after that. I've checked this multiple times and no, dvdcss key caching isn't the cause, crossed checked it multiple times.

Once you played a dvd this way, the drive seems to remember the dvd and successfully plays it afterwards. I've checked this multiple times using completely separate OS installation (one x86, the other x86-64).

This almost looks like new defense method against CSS-workaround. Can't understand why the drive remembers successfully played dvds tho.

This is NOT a kernel/driver bug. Maybe libdvdread people are interested in it. You better take it to them.

Signature · 1 line
tejun
#12 lore raw

Hi Tejun,

Quoted 13 lines · Tejun Heo

Okay, I just tested a number of dvds on x86-64 and x86. The error pattern is really interesting. It doesn't matter whether you're on x86-64 or x86, 2.6.18 or 2.6.20-rc5. The problem occurs when a dvd which doesn't match dvd's region mask is played.

MMC command 0xa4 (READ KEY) is the one which always fails. After the failure, the odd goes into strange state and usually won't respond to commands. Interestingly, if you pull the power plug or reset the machine while the READ KEY command is in progress and then reconnect it, you can play the DVD after that. I've checked this multiple times and no, dvdcss key caching isn't the cause, crossed checked it multiple times.

Quoted 4 lines

Once you played a dvd this way, the drive seems to remember the dvd and successfully plays it afterwards. I've checked this multiple times using completely separate OS installation (one x86, the other x86-64).

How comes that there is no such problem if I connect the drive via an USB SATA adapter?

Quoted 3 lines

This almost looks like new defense method against CSS-workaround. Can't understand why the drive remembers successfully played dvds tho.

I would have the option to return it (playing no DVDs is surely a defect), but this would be a shame. It was lightning fast on writing, a little bit noisy, though, but I was really glad to get rid of that clumsy parallel cable.

Do you think it would be reasonable to send a bug report to Samsung, and see what they say? I would need some documentation about these MMC commands, though. Is this part of some "Red Book" standard, or so?

Regards

Harri

#13 lore raw
Quoted 2 lines · Harald Dunkel

How comes that there is no such problem if I connect the drive via an USB SATA adapter?

Ah... right. I forgot about that. Scrap my analysis. What happens is really weird tho.

Quoted 4 lines

Do you think it would be reasonable to send a bug report to Samsung, and see what they say? I would need some documentation about these MMC commands, though. Is this part of some "Red Book" standard, or so?

Yeap, reporting is probably a good idea. libdvdread ppl would be interested too. MMC is SCSI command set standard for ODDs and can be found at t10.org.

I don't think we can proceed with kernel debugging before gathering more info about this problem. Feel free to cc me when you ask people about this problem. I really like the dvd writer and would love to see the problem ironed out.

Thanks.

Signature · 1 line
tejun