Cannot mount multi-session DVD with ide-cd, must use ide-scsi

Cannot mount multi-session DVD with ide-cd, must use ide-scsi

Post by Rashka » Sat, 18 Dec 2004 10:30:08


I can confirm that Linux Kerenl 2.6.9 still cannot mount a
multi-session DVD if the last session starts at > 2.2 GB. The
only information on this problem I can find is here:

http://www.yqcomputer.com/

Is there a patch anywhere to address this? it would be great if
I didn't have to use ide-scsi anymore, which imposes it's own set
of added difficulties.

Please CC replies. Thanks much.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to XXXX@XXXXX.COM
More majordomo info at http://www.yqcomputer.com/
Please read the FAQ at http://www.yqcomputer.com/
 
 
 

Cannot mount multi-session DVD with ide-cd, must use ide-scsi

Post by Andrew Mor » Sat, 18 Dec 2004 17:20:13


Please test this. Jens, could you please check this one?



From: Kronos < XXXX@XXXXX.COM >

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):

Signed-off-by: Andrew Morton < XXXX@XXXXX.COM >
---

25-akpm/drivers/ide/ide-cd.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)

diff -puN drivers/ide/ide-cd.c~ide-cd-unable-to-read-multisession-dvds drivers/ide/ide-cd.c
--- 25/drivers/ide/ide-cd.c~ide-cd-unable-to-read-multisession-dvds 2004-12-11 22:14:16.629388296 -0800
+++ 25-akpm/drivers/ide/ide-cd.c 2004-12-11 22:14:16.635387384 -0800
@@ -2353,7 +2353,7 @@ static int cdrom_read_toc(ide_drive_t *d
/* 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 {
@@ -2368,9 +2368,11 @@ static int cdrom_read_toc(ide_drive_t *d
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);

_

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to XXXX@XXXXX.COM
More majordomo info at http://www.yqcomputer.com/
Please read the FAQ at http://www.yqcomputer.com/

 
 
 

Cannot mount multi-session DVD with ide-cd, must use ide-scsi

Post by Jens Axbo » Sat, 18 Dec 2004 21:20:08


It looks fine for the case where the tocentry read suceeds, but you
should change the fallback assignment to be lba based as well I think.


it's the bottom part of that else.

--
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to XXXX@XXXXX.COM
More majordomo info at http://www.yqcomputer.com/
Please read the FAQ at http://www.yqcomputer.com/
 
 
 

Cannot mount multi-session DVD with ide-cd, must use ide-scsi

Post by Krono » Sun, 19 Dec 2004 03:40:10

Jens Axboe < XXXX@XXXXX.COM > ha scritto:



Ok, changed that part. I also changed the part inside the #if
!STANDARD_ATAPI to re-read using MSF, just to be sure to not break
anything. Maybe those two weird units (Vertos 300 and NEC 260) return
the LBA value in a sane way and the whole #if block can be removed?

---
Read the multi-session TOC in LBA format in order to avoid an overflow
in MSF format when the last session starts beyond block 1152000 (LBA).

Signed-off-by: Luca Tettamanti < XXXX@XXXXX.COM >

--- a/drivers/ide/ide-cd.c 2004-12-10 23:06:18.000000000 +0100
+++ b/drivers/ide/ide-cd.c 2004-12-17 19:30:56.000000000 +0100
@@ -2356,25 +2356,31 @@
/* 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;
+
+ toc->last_session_lba = be32_to_cpu(ms_tmp.ent.addr.lba);
} else {
- ms_tmp.ent.addr.msf.minute = 0;
- ms_tmp.ent.addr.msf.second = 2;
- ms_tmp.ent.addr.msf.frame = 0;
ms_tmp.hdr.first_track = ms_tmp.hdr.last_track = CDROM_LEADOUT;
+ toc->last_session_lba = msf_to_lba(0, 2, 0); /* 0m 2s 0f */
}

#if ! STANDARD_ATAPI
- if (CDROM_CONFIG_FLAGS(drive)->tocaddr_as_bcd)
+ if (CDROM_CONFIG_FLAGS(drive)->tocaddr_as_bcd) {
+ /* Re-read multisession information using MSF format */
+ stat = cdrom_read_tocentry(drive, 0, 1, 1, (char *)&ms_tmp,
+ sizeof(ms_tmp), sense);
+ if (stat)
+ return stat;
+
msf_from_bcd (&ms_tmp.ent.addr.msf);
+ 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);
+ }
#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->xa_flag = (ms_tmp.hdr.first_track != ms_tmp.hdr.last_track);

/* Now try to get the total cdrom capacity. */



Luca
--
Home: http://www.yqcomputer.com/
The trouble with computers is that they do what you tell them,
not what you want.
D. Cohen
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to XXXX@XXXXX.COM
More majordomo info at http://www.yqcomputer.com/
Please read the FAQ at http://www.yqcomputer.com/
 
 
 

Cannot mount multi-session DVD with ide-cd, must use ide-scsi

Post by Doug Maxe » Sun, 19 Dec 2004 04:10:13


...

Should that be le32_to_cpu?


++doug

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to XXXX@XXXXX.COM
More majordomo info at http://www.yqcomputer.com/
Please read the FAQ at http://www.yqcomputer.com/
 
 
 

Cannot mount multi-session DVD with ide-cd, must use ide-scsi

Post by Jens Axbo » Sun, 19 Dec 2004 04:40:18


Much better, Andrew will you pick this up?

--
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to XXXX@XXXXX.COM
More majordomo info at http://www.yqcomputer.com/
Please read the FAQ at http://www.yqcomputer.com/
 
 
 

Cannot mount multi-session DVD with ide-cd, must use ide-scsi

Post by Jens Axbo » Sun, 19 Dec 2004 04:40:18


Why? It's read data and that is always big-endian.

--
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to XXXX@XXXXX.COM
More majordomo info at http://www.yqcomputer.com/
Please read the FAQ at http://www.yqcomputer.com/
 
 
 

Cannot mount multi-session DVD with ide-cd, must use ide-scsi

Post by Rashka » Mon, 20 Dec 2004 02:20:08


For someone who's too stoopid to figure out what you just
did/fixed, can someone point me to patch I can.. err, patch?

I thank you all for the help.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to XXXX@XXXXX.COM
More majordomo info at http://www.yqcomputer.com/
Please read the FAQ at http://www.yqcomputer.com/
 
 
 

Cannot mount multi-session DVD with ide-cd, must use ide-scsi

Post by Randy.Dunl » Mon, 20 Dec 2004 02:50:13


The patch from Kronos is here:
http://www.yqcomputer.com/

You probably want to click on [Download message RAW]
to save it.

--
~Randy
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to XXXX@XXXXX.COM
More majordomo info at http://www.yqcomputer.com/
Please read the FAQ at http://www.yqcomputer.com/
 
 
 

Cannot mount multi-session DVD with ide-cd, must use ide-scsi

Post by Rashka » Mon, 20 Dec 2004 05:30:11


Working well for me so far, at least, as far as the problem I
whined about goes :)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to XXXX@XXXXX.COM
More majordomo info at http://www.yqcomputer.com/
Please read the FAQ at http://www.yqcomputer.com/