public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Polyakov <appro@fy.chalmers.se>
To: linux-kernel@vger.kernel.org
Cc: axboe@suse.de
Subject: [PATCH] ide-cd.c to mount multi-session DVD
Date: Sat, 28 Aug 2004 11:47:26 +0200	[thread overview]
Message-ID: <413054AE.98FCE658@fy.chalmers.se> (raw)

With respect to http://marc.theaimsgroup.com/?l=linux-kernel&m=108827602322464&w=2
I'd like to nominate the attached patch. And while we're on ide-cd.c
track I also wonder why has dma alignment requirement been hardened?

-	blk_queue_dma_alignment(drive->queue, 3);
+	blk_queue_dma_alignment(drive->queue, 31);

I can find requirement for minimal lenght reasonable, but who aligns
pointers at 32 byte boundary? Cheers. A.

8<-------8<-------8<-------8<-------8<-------8<-------8<-------8<-------
--- ./drivers/ide/ide-cd.c.orig	Tue Aug 24 18:54:42 2004
+++ ./drivers/ide/ide-cd.c	Fri Aug 27 20:31:27 2004
@@ -2356,26 +2356,32 @@
 	/* 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,
+		int ask_for_msf=0;
+#if ! STANDARD_ATAPI
+		if (CDROM_CONFIG_FLAGS(drive)->tocaddr_as_bcd)
+			ask_for_msf=1;
+#endif
+		stat = cdrom_read_tocentry(drive, 0, ask_for_msf, 1,
+					   (char *)&ms_tmp,
 					   sizeof(ms_tmp), sense);
 		if (stat) return stat;
 	} else {
-		ms_tmp.ent.addr.msf.minute = 0;
-		ms_tmp.ent.addr.msf.second = 2;
-		ms_tmp.ent.addr.msf.frame  = 0;
+		ms_tmp.ent.addr.lba = 0;
 		ms_tmp.hdr.first_track = ms_tmp.hdr.last_track = CDROM_LEADOUT;
 	}
 
+	toc->last_session_lba = be32_to_cpu(ms_tmp.ent.addr.lba);
+	toc->xa_flag = (ms_tmp.hdr.first_track != ms_tmp.hdr.last_track);
+
 #if ! STANDARD_ATAPI
-	if (CDROM_CONFIG_FLAGS(drive)->tocaddr_as_bcd)
+	if (CDROM_CONFIG_FLAGS(drive)->tocaddr_as_bcd
+	    && toc->hdr.first_track != CDROM_LEADOUT) {
 		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. */
 	stat = cdrom_get_last_written(cdi, &last_written);

                 reply	other threads:[~2004-08-28  9:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=413054AE.98FCE658@fy.chalmers.se \
    --to=appro@fy.chalmers.se \
    --cc=axboe@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox