mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
	lkml <linux-kernel@vger.kernel.org>,
	linux-ide <linux-ide@vger.kernel.org>,
	Jeff Garzik <jgarzik@pobox.com>
Subject: Re: [PATCH 2.6.11-rc3 01/11] ide: task_end_request() fix
Date: Thu, 10 Feb 2005 17:38:14 +0900 (KST)	[thread overview]
Message-ID: <20050210083809.63BF53E6@htj.dyndns.org> (raw)
In-Reply-To: <20050210083808.48E9DD1A@htj.dyndns.org>


01_ide_task_end_request_fix.patch

	task_end_request() modified to always call ide_end_drive_cmd()
	for taskfile requests.  Previously, ide_end_drive_cmd() was
	called only when task->tf_out_flags.all was set.  Also,
	ide_dma_intr() is modified to use task_end_request().

	* fixes taskfile ioctl oops bug which was caused by referencing
	  NULL rq->rq_disk of taskfile requests.
	* enables TASKFILE ioctls to get valid register outputs on
	  successful completion.

Signed-off-by: Tejun Heo <htejun@gmail.com>

 drivers/ide/ide-dma.c      |    5 +----
 drivers/ide/ide-taskfile.c |   12 ++++--------
 include/linux/ide.h        |    1 +
 3 files changed, 6 insertions(+), 12 deletions(-)

Index: linux-ide/drivers/ide/ide-dma.c
===================================================================
--- linux-ide.orig/drivers/ide/ide-dma.c	2005-02-10 17:31:48.917654643 +0900
+++ linux-ide/drivers/ide/ide-dma.c	2005-02-10 17:38:00.033092056 +0900
@@ -175,10 +175,7 @@ ide_startstop_t ide_dma_intr (ide_drive_
 	if (OK_STAT(stat,DRIVE_READY,drive->bad_wstat|DRQ_STAT)) {
 		if (!dma_stat) {
 			struct request *rq = HWGROUP(drive)->rq;
-			ide_driver_t *drv;
-
-			drv = *(ide_driver_t **)rq->rq_disk->private_data;;
-			drv->end_request(drive, 1, rq->nr_sectors);
+			task_end_request(drive, rq, stat);
 			return ide_stopped;
 		}
 		printk(KERN_ERR "%s: dma_intr: bad DMA status (dma_stat=%x)\n", 
Index: linux-ide/drivers/ide/ide-taskfile.c
===================================================================
--- linux-ide.orig/drivers/ide/ide-taskfile.c	2005-02-10 17:31:48.917654643 +0900
+++ linux-ide/drivers/ide/ide-taskfile.c	2005-02-10 17:38:00.042090547 +0900
@@ -364,18 +364,14 @@ static ide_startstop_t task_error(ide_dr
 	return ide_error(drive, s, stat);
 }
 
-static void task_end_request(ide_drive_t *drive, struct request *rq, u8 stat)
+void task_end_request(ide_drive_t *drive, struct request *rq, u8 stat)
 {
 	ide_driver_t *drv;
 
 	if (rq->flags & REQ_DRIVE_TASKFILE) {
-		ide_task_t *task = rq->special;
-
-		if (task->tf_out_flags.all) {
-			u8 err = drive->hwif->INB(IDE_ERROR_REG);
-			ide_end_drive_cmd(drive, stat, err);
-			return;
-		}
+		u8 err = drive->hwif->INB(IDE_ERROR_REG);
+		ide_end_drive_cmd(drive, stat, err);
+		return;
 	}
 
 	drv = *(ide_driver_t **)rq->rq_disk->private_data;
Index: linux-ide/include/linux/ide.h
===================================================================
--- linux-ide.orig/include/linux/ide.h	2005-02-10 17:31:48.917654643 +0900
+++ linux-ide/include/linux/ide.h	2005-02-10 17:38:00.044090212 +0900
@@ -1290,6 +1290,7 @@ extern ide_startstop_t do_rw_taskfile(id
  */
 extern ide_startstop_t flagged_taskfile(ide_drive_t *, ide_task_t *);
 
+void task_end_request(ide_drive_t *, struct request *, u8);
 extern ide_startstop_t set_multmode_intr(ide_drive_t *);
 extern ide_startstop_t set_geometry_intr(ide_drive_t *);
 extern ide_startstop_t recal_intr(ide_drive_t *);

  reply	other threads:[~2005-02-10  8:39 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-10  8:38 [PATCH 2.6.11-rc3 00/11] ide: ide driver updates series 2, round 2 Tejun Heo
2005-02-10  8:38 ` Tejun Heo [this message]
2005-02-24 15:58   ` [PATCH 2.6.11-rc3 01/11] ide: task_end_request() fix Bartlomiej Zolnierkiewicz
2005-02-27  6:49     ` Tejun Heo
2005-03-01 14:30       ` Bartlomiej Zolnierkiewicz
2005-03-01 16:49         ` Tejun Heo
2005-03-02 16:15           ` Bartlomiej Zolnierkiewicz
2005-03-02  5:56         ` Jeff Garzik
2005-03-02 16:07           ` Bartlomiej Zolnierkiewicz
2005-02-10  8:38 ` [PATCH 2.6.11-rc3 02/11] ide: ide_init_drive_cmd() now defaults to REQ_DRIVE_TASKFILE Tejun Heo
2005-02-10  8:38 ` [PATCH 2.6.11-rc3 03/11] ide: ide_diag_taskfile() rq initialization fix Tejun Heo
2005-02-10  8:38 ` [PATCH 2.6.11-rc3 04/11] ide: removes unneeded HOB access using ATA_TFLAG_LBA48 flag Tejun Heo
2005-02-10  8:38 ` [PATCH 2.6.11-rc3 05/11] ide: fixes io_32bit race in ide_taskfile_ioctl() Tejun Heo
2005-02-11 21:16   ` Bartlomiej Zolnierkiewicz
2005-02-10  8:38 ` [PATCH 2.6.11-rc3 06/11] ide: make disk flush functions use TASKFILE instead of TASK Tejun Heo
2005-02-10  8:38 ` [PATCH 2.6.11-rc3 07/11] ide: make ide_task_ioctl() use TASKFILE Tejun Heo
2005-02-10  8:38 ` [PATCH 2.6.11-rc3 08/11] ide: remove REQ_DRIVE_TASK handling Tejun Heo
2005-02-24 15:45   ` Bartlomiej Zolnierkiewicz
2005-02-10  8:38 ` [PATCH 2.6.11-rc3 09/11] ide: convert uses of REQ_DRIVE_CMD to REQ_DRIVE_TASKFILE Tejun Heo
2005-02-10  8:38 ` [PATCH 2.6.11-rc3 10/11] ide: make ide_cmd_ioctl() use TASKFILE Tejun Heo
2005-02-24 15:50   ` Bartlomiej Zolnierkiewicz
2005-02-27  6:53     ` Tejun Heo
2005-02-27  7:41       ` Jeff Garzik
2005-02-10  8:39 ` [PATCH 2.6.11-rc3 11/11] ide: remove REQ_DRIVE_CMD handling Tejun Heo

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=20050210083809.63BF53E6@htj.dyndns.org \
    --to=htejun@gmail.com \
    --cc=bzolnier@gmail.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®