From: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Andre Hedrick <andre@linux-ide.org>, Jens Axboe <axboe@suse.de>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH] 2.5.67-ac2 direct-IO for IDE taskfile ioctl (3/4)
Date: Wed, 23 Apr 2003 19:39:37 +0200 (MET DST) [thread overview]
Message-ID: <Pine.SOL.4.30.0304231939140.10502-100000@mion.elka.pw.edu.pl> (raw)
In-Reply-To: <Pine.SOL.4.30.0304231933360.10502-100000@mion.elka.pw.edu.pl>
# Add support for rq->bio based taskfile.
#
# Detailed changelog:
# - use ide_build_sglist() also for rq->bio based REQ_DRIVE_TASKFILE
# in ide_build_dmatable(), plus similar changes for ARM and PPC
# - add support for REQ_DRIVE_TASKFILE to ide_end_request() and PIO handlers
# - add support for REQ_DRIVE_TASKFILE to ide_dma_intr() and icside_dmaintr()
#
# Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>
diff -uNr linux-2.5.67-ac2-dtf2/drivers/ide/arm/icside.c linux/drivers/ide/arm/icside.c
--- linux-2.5.67-ac2-dtf2/drivers/ide/arm/icside.c Wed Apr 23 15:14:07 2003
+++ linux/drivers/ide/arm/icside.c Wed Apr 23 15:32:56 2003
@@ -276,7 +276,8 @@
BUG_ON(hwif->sg_dma_active);
- if (rq->flags & REQ_DRIVE_TASKFILE) {
+ /* rq->buffer based taskfile */
+ if ((rq->flags & REQ_DRIVE_TASKFILE) && !rq->bio) {
ide_task_t *args = rq->special;
if (args->command_type == IDE_DRIVE_TASK_RAW_WRITE)
@@ -573,13 +574,10 @@
if (OK_STAT(stat, DRIVE_READY, drive->bad_wstat | DRQ_STAT)) {
if (!dma_stat) {
struct request *rq = HWGROUP(drive)->rq;
- int i;
-
- for (i = rq->nr_sectors; i > 0; ) {
- i -= rq->current_nr_sectors;
- DRIVER(drive)->end_request(drive, 1, rq->nr_sectors);
- }
+ DRIVER(drive)->end_request(drive, 1, rq->nr_sectors);
+ if (rq->flags & REQ_DRIVE_TASKFILE)
+ ide_end_drive_cmd(drive, stat, HWIF(drive)->INB(IDE_ERROR_REG));
return ide_stopped;
}
printk(KERN_ERR "%s: bad DMA status (dma_stat=%x)\n",
diff -uNr linux-2.5.67-ac2-dtf2/drivers/ide/ppc/pmac.c linux/drivers/ide/ppc/pmac.c
--- linux-2.5.67-ac2-dtf2/drivers/ide/ppc/pmac.c Wed Apr 23 15:14:07 2003
+++ linux/drivers/ide/ppc/pmac.c Wed Apr 23 15:39:28 2003
@@ -1010,7 +1010,9 @@
udelay(1);
/* Build sglist */
- if (HWGROUP(drive)->rq->flags & REQ_DRIVE_TASKFILE)
+
+ /* rq->buffer based taskfile */
+ if ((HWGROUP(drive)->rq->flags & REQ_DRIVE_TASKFILE) && !rq->bio)
pmif->sg_nents = i = pmac_ide_raw_build_sglist(drive, rq);
else
pmif->sg_nents = i = pmac_ide_build_sglist(drive, rq);
diff -uNr linux-2.5.67-ac2-dtf2/drivers/ide/ide-dma.c linux/drivers/ide/ide-dma.c
--- linux-2.5.67-ac2-dtf2/drivers/ide/ide-dma.c Wed Apr 23 15:14:07 2003
+++ linux/drivers/ide/ide-dma.c Wed Apr 23 15:35:27 2003
@@ -180,6 +180,8 @@
struct request *rq = HWGROUP(drive)->rq;
DRIVER(drive)->end_request(drive, 1, rq->nr_sectors);
+ if (rq->flags & REQ_DRIVE_TASKFILE)
+ ide_end_drive_cmd(drive, stat, HWIF(drive)->INB(IDE_ERROR_REG));
return ide_stopped;
}
printk(KERN_ERR "%s: dma_intr: bad DMA status (dma_stat=%x)\n",
@@ -303,7 +305,8 @@
int i;
struct scatterlist *sg;
- if (HWGROUP(drive)->rq->flags & REQ_DRIVE_TASKFILE)
+ /* rq->buffer based taskfile */
+ if ((HWGROUP(drive)->rq->flags & REQ_DRIVE_TASKFILE) && !rq->bio)
hwif->sg_nents = i = ide_raw_build_sglist(drive, rq);
else
hwif->sg_nents = i = ide_build_sglist(drive, rq);
diff -uNr linux-2.5.67-ac2-dtf2/drivers/ide/ide-io.c linux/drivers/ide/ide-io.c
--- linux-2.5.67-ac2-dtf2/drivers/ide/ide-io.c Tue Apr 22 22:34:34 2003
+++ linux/drivers/ide/ide-io.c Wed Apr 23 00:27:43 2003
@@ -124,6 +124,12 @@
}
if (!end_that_request_first(rq, uptodate, nr_sectors)) {
+
+ if (rq->flags & REQ_DRIVE_TASKFILE) {
+ spin_unlock_irqrestore(&ide_lock, flags);
+ return 0;
+ }
+
add_disk_randomness(rq->rq_disk);
if (!blk_rq_tagged(rq))
blkdev_dequeue_request(rq);
diff -uNr linux-2.5.67-ac2-dtf2/drivers/ide/ide-taskfile.c linux/drivers/ide/ide-taskfile.c
--- linux-2.5.67-ac2-dtf2/drivers/ide/ide-taskfile.c Wed Apr 23 00:19:19 2003
+++ linux/drivers/ide/ide-taskfile.c Wed Apr 23 00:21:34 2003
@@ -419,8 +419,11 @@
* Status was already verifyied.
*/
while (rq->hard_bio != rq->bio)
- if (!DRIVER(drive)->end_request(drive, 1, bio_sectors(rq->hard_bio)))
+ if (!DRIVER(drive)->end_request(drive, 1, bio_sectors(rq->hard_bio))) {
+ if (rq->flags & REQ_DRIVE_TASKFILE)
+ ide_end_drive_cmd(drive, stat, HWIF(drive)->INB(IDE_ERROR_REG));
return ide_stopped;
+ }
/* Complete rq->buffer based request (ioctls). */
if (!rq->bio && !rq->nr_sectors) {
ide_end_drive_cmd(drive, stat, HWIF(drive)->INB(IDE_ERROR_REG));
@@ -476,8 +479,11 @@
* Status was already verifyied.
*/
while (rq->hard_bio != rq->bio)
- if (!DRIVER(drive)->end_request(drive, 1, bio_sectors(rq->hard_bio)))
+ if (!DRIVER(drive)->end_request(drive, 1, bio_sectors(rq->hard_bio))) {
+ if (rq->flags & REQ_DRIVE_TASKFILE)
+ ide_end_drive_cmd(drive, stat, HWIF(drive)->INB(IDE_ERROR_REG));
return ide_stopped;
+ }
/* Complete rq->buffer based request (ioctls). */
if (!rq->bio && !rq->nr_sectors) {
ide_end_drive_cmd(drive, stat, HWIF(drive)->INB(IDE_ERROR_REG));
@@ -549,8 +555,11 @@
* Status was already verifyied.
*/
while (rq->hard_bio != rq->bio)
- if (!DRIVER(drive)->end_request(drive, 1, bio_sectors(rq->hard_bio)))
+ if (!DRIVER(drive)->end_request(drive, 1, bio_sectors(rq->hard_bio))) {
+ if (rq->flags & REQ_DRIVE_TASKFILE)
+ ide_end_drive_cmd(drive, stat, HWIF(drive)->INB(IDE_ERROR_REG));
return ide_stopped;
+ }
/* Complete rq->buffer based request (ioctls). */
if (!rq->bio && !rq->nr_sectors) {
ide_end_drive_cmd(drive, stat, HWIF(drive)->INB(IDE_ERROR_REG));
@@ -618,8 +627,11 @@
* Status was already verifyied.
*/
while (rq->hard_bio != rq->bio)
- if (!DRIVER(drive)->end_request(drive, 1, bio_sectors(rq->hard_bio)))
+ if (!DRIVER(drive)->end_request(drive, 1, bio_sectors(rq->hard_bio))) {
+ if (rq->flags & REQ_DRIVE_TASKFILE)
+ ide_end_drive_cmd(drive, stat, HWIF(drive)->INB(IDE_ERROR_REG));
return ide_stopped;
+ }
/* Complete rq->buffer based request (ioctls). */
if (!rq->bio && !rq->nr_sectors) {
ide_end_drive_cmd(drive, stat, HWIF(drive)->INB(IDE_ERROR_REG));
next prev parent reply other threads:[~2003-04-23 17:29 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-23 17:37 [PATCH] 2.5.67-ac2 direct-IO for IDE taskfile ioctl (0/4) Bartlomiej Zolnierkiewicz
2003-04-23 17:38 ` [PATCH] 2.5.67-ac2 direct-IO for IDE taskfile ioctl (1/4) Bartlomiej Zolnierkiewicz
2003-04-24 8:23 ` Jens Axboe
2003-04-24 14:46 ` Bartlomiej Zolnierkiewicz
2003-04-24 15:47 ` [PATCH] 2.5.68 fix mismatched access_ok() checks in sg_io() Bartlomiej Zolnierkiewicz
2003-04-24 17:31 ` Jens Axboe
2003-04-23 17:39 ` [PATCH] 2.5.67-ac2 direct-IO for IDE taskfile ioctl (2/4) Bartlomiej Zolnierkiewicz
2003-04-23 17:39 ` Bartlomiej Zolnierkiewicz [this message]
2003-04-23 17:40 ` [PATCH] 2.5.67-ac2 direct-IO for IDE taskfile ioctl (4/4) Bartlomiej Zolnierkiewicz
2003-04-24 7:56 ` Jens Axboe
2003-04-23 18:24 ` [PATCH] 2.5.67-ac2 direct-IO for IDE taskfile ioctl (0/4) [resend] Bartlomiej Zolnierkiewicz
2003-04-23 22:35 ` [PATCH] 2.5.67-ac2 direct-IO for IDE taskfile ioctl (0/4) Andrew Morton
2003-04-23 22:09 ` Alan Cox
2003-04-23 22:58 ` Bartlomiej Zolnierkiewicz
2003-04-23 23:13 ` Andries Brouwer
2003-04-23 23:20 ` Andrew Morton
2003-04-24 0:02 ` Bartlomiej Zolnierkiewicz
2003-04-24 6:55 ` Jens Axboe
2003-04-24 2:27 ` Andre Hedrick
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=Pine.SOL.4.30.0304231939140.10502-100000@mion.elka.pw.edu.pl \
--to=b.zolnierkiewicz@elka.pw.edu.pl \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=andre@linux-ide.org \
--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;
as well as URLs for NNTP newsgroup(s).