From: chrisl@vmware.com
To: Jens Axboe <axboe@suse.de>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
Sasha Malchik <sasha@vmware.com>,
Linux kernel <linux-kernel@vger.kernel.org>
Subject: Re: IDE CDROM packet command buffer size restriction.
Date: Sat, 2 Nov 2002 01:10:49 -0800 [thread overview]
Message-ID: <20021102091049.GA1673@vmware.com> (raw)
In-Reply-To: <20021101121045.GK8428@suse.de>
On Fri, Nov 01, 2002 at 01:10:45PM +0100, Jens Axboe wrote:
> > We make a patch allow kernel return successful and return the actual
> > transfer data size. Is it the prefer behavior in this case? If not,
> > what is the best way to solve this problem?
>
> The patch does look good, thanks.
Sasha just find my change to the patch has some fault. The pc.buflen
changed after cdrom_queue_packet_command. So his original patch
is more correct.
I paste it here again. I am sorry for the confusion.
Chris
--- 1.17/drivers/ide/ide-cd.c Mon Sep 16 22:39:10 2002
+++ edited/ide-cd.c Sat Nov 2 01:02:43 2002
@@ -1322,8 +1322,7 @@
ireason = IN_BYTE (IDE_NSECTOR_REG);
len = IN_BYTE (IDE_LCYL_REG) + 256 * IN_BYTE (IDE_HCYL_REG);
- /* If DRQ is clear, the command has completed.
- Complain if we still have data left to transfer. */
+ /* If DRQ is clear, the command has completed. */
if ((stat & DRQ_STAT) == 0) {
/* Some of the trailing request sense fields are optional, and
some drives don't send them. Sigh. */
@@ -1336,19 +1335,8 @@
}
}
- if (pc->buflen == 0)
- cdrom_end_request (1, drive);
- else {
- /* Comment this out, because this always happens
- right after a reset occurs, and it is annoying to
- always print expected stuff. */
- /*
- printk ("%s: cdrom_pc_intr: data underrun %d\n",
- drive->name, pc->buflen);
- */
- pc->stat = 1;
- cdrom_end_request (1, drive);
- }
+ cdrom_end_request (1, drive);
+
return ide_stopped;
}
@@ -2202,7 +2190,9 @@
pc.quiet = cgc->quiet;
pc.timeout = cgc->timeout;
pc.sense = cgc->sense;
- return cgc->stat = cdrom_queue_packet_command(drive, &pc);
+ cgc->stat = cdrom_queue_packet_command(drive, &pc);
+ cgc->buflen -= pc.buflen;
+ return cgc->stat;
}
next prev parent reply other threads:[~2002-11-02 9:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-01 4:46 IDE CDROM packet command buffer size restriction chrisl
2002-11-01 12:10 ` Jens Axboe
2002-11-01 19:11 ` chrisl
2002-11-02 9:10 ` chrisl [this message]
2002-11-02 9:20 ` Jens Axboe
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=20021102091049.GA1673@vmware.com \
--to=chrisl@vmware.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=axboe@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=sasha@vmware.com \
/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