[BUG] ide-cd: Unable to read multisession DVDs

From: Kronos
Date: Fri Dec 10 2004 - 18:31:59 EST


Hi Jens,
cdrom_read_toc (ide-cd.c) always reads the TOC using MSF format. If the
last session of the disk starts beyond block 1152000 (LBA) there's an
overflow in the MSF format and kernel complains:

Unable to identify CD-ROM format.

I reported this bug a while ago (see bug #1930 on bugzilla) and Andy
Polyakov tracked it down.

I tried fixing it by myself setting msf_flag (cdrom_read_tocentry) to 0
and removing the MSF to LBA conversions in cdrom_read_toc.
It works but I don't have a complete understanding of the code in
ide-cd...

This is the quick & dirty patch (against 2.6.9, apply with offset to
2.6.10-rc3):

--- linux-2.6/drivers/ide/ide-cd.c.orig 2004-12-10 23:06:18.000000000 +0100
+++ linux-2.6/drivers/ide/ide-cd.c 2004-12-11 00:15:40.000000000 +0100
@@ -2356,7 +2357,7 @@
/* Read the multisession information. */
if (toc->hdr.first_track != CDROM_LEADOUT) {
/* Read the multisession information. */
- stat = cdrom_read_tocentry(drive, 0, 1, 1, (char *)&ms_tmp,
+ stat = cdrom_read_tocentry(drive, 0, 0, 1, (char *)&ms_tmp,
sizeof(ms_tmp), sense);
if (stat) return stat;
} else {
@@ -2371,9 +2372,11 @@
msf_from_bcd (&ms_tmp.ent.addr.msf);
#endif /* not STANDARD_ATAPI */

- toc->last_session_lba = msf_to_lba (ms_tmp.ent.addr.msf.minute,
- ms_tmp.ent.addr.msf.second,
- ms_tmp.ent.addr.msf.frame);
+ toc->last_session_lba = be32_to_cpu(ms_tmp.ent.addr.lba);
+ printk("ide-cd: last_session_lba: %d\n", toc->last_session_lba);
+// toc->last_session_lba = msf_to_lba (ms_tmp.ent.addr.msf.minute,
+// ms_tmp.ent.addr.msf.second,
+// ms_tmp.ent.addr.msf.frame);

toc->xa_flag = (ms_tmp.hdr.first_track != ms_tmp.hdr.last_track);


Need help for a proper fix ;-)

Luca
--
Home: http://kronoz.cjb.net
Windows NT: Designed for the Internet. The Internet: Designed for Unix.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/