* [PATCH ide-dev-2.6] ide: ide_dma_intr oops fix
@ 2005-03-03 3:03 Tejun Heo
2005-03-03 6:49 ` Jens Axboe
0 siblings, 1 reply; 7+ messages in thread
From: Tejun Heo @ 2005-03-03 3:03 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz, linux-kernel, linux-ide
Hello, Bartlomiej.
This patch fixes ide_dma_intr() oops which occurs for TASKFILE ioctl
using DMA dataphses. This is against the latest ide-dev-2.6 tree +
all your recent 9 patches.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Index: linux-taskfile-ng/drivers/ide/ide-dma.c
===================================================================
--- linux-taskfile-ng.orig/drivers/ide/ide-dma.c 2005-03-03 11:59:16.485582413 +0900
+++ linux-taskfile-ng/drivers/ide/ide-dma.c 2005-03-03 12:00:07.753376048 +0900
@@ -175,10 +175,14 @@ 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);
+ if (rq->rq_disk) {
+ ide_driver_t *drv;
+
+ drv = *(ide_driver_t **)rq->rq_disk->private_data;;
+ drv->end_request(drive, 1, rq->nr_sectors);
+ } else
+ ide_end_request(drive, 1, rq->nr_sectors);
return ide_stopped;
}
printk(KERN_ERR "%s: dma_intr: bad DMA status (dma_stat=%x)\n",
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH ide-dev-2.6] ide: ide_dma_intr oops fix 2005-03-03 3:03 [PATCH ide-dev-2.6] ide: ide_dma_intr oops fix Tejun Heo @ 2005-03-03 6:49 ` Jens Axboe 2005-03-03 6:57 ` Tejun Heo 0 siblings, 1 reply; 7+ messages in thread From: Jens Axboe @ 2005-03-03 6:49 UTC (permalink / raw) To: Tejun Heo; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel, linux-ide On Thu, Mar 03 2005, Tejun Heo wrote: > Hello, Bartlomiej. > > This patch fixes ide_dma_intr() oops which occurs for TASKFILE ioctl > using DMA dataphses. This is against the latest ide-dev-2.6 tree + > all your recent 9 patches. > > Signed-off-by: Tejun Heo <htejun@gmail.com> > > Index: linux-taskfile-ng/drivers/ide/ide-dma.c > =================================================================== > --- linux-taskfile-ng.orig/drivers/ide/ide-dma.c 2005-03-03 11:59:16.485582413 +0900 > +++ linux-taskfile-ng/drivers/ide/ide-dma.c 2005-03-03 12:00:07.753376048 +0900 > @@ -175,10 +175,14 @@ 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); > + if (rq->rq_disk) { > + ide_driver_t *drv; > + > + drv = *(ide_driver_t **)rq->rq_disk->private_data;; > + drv->end_request(drive, 1, rq->nr_sectors); > + } else > + ide_end_request(drive, 1, rq->nr_sectors); > return ide_stopped; > } > printk(KERN_ERR "%s: dma_intr: bad DMA status (dma_stat=%x)\n", Why not just set rq_disk for taskfile requests as well, seems a lot cleaner than special casing the end_request handling. -- Jens Axboe ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH ide-dev-2.6] ide: ide_dma_intr oops fix 2005-03-03 6:49 ` Jens Axboe @ 2005-03-03 6:57 ` Tejun Heo 2005-03-03 8:04 ` Bartlomiej Zolnierkiewicz 0 siblings, 1 reply; 7+ messages in thread From: Tejun Heo @ 2005-03-03 6:57 UTC (permalink / raw) To: Jens Axboe; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel, linux-ide Hello, Jens. Jens Axboe wrote: > On Thu, Mar 03 2005, Tejun Heo wrote: > >> Hello, Bartlomiej. >> >> This patch fixes ide_dma_intr() oops which occurs for TASKFILE ioctl >>using DMA dataphses. This is against the latest ide-dev-2.6 tree + >>all your recent 9 patches. >> >> Signed-off-by: Tejun Heo <htejun@gmail.com> >> >>Index: linux-taskfile-ng/drivers/ide/ide-dma.c >>=================================================================== >>--- linux-taskfile-ng.orig/drivers/ide/ide-dma.c 2005-03-03 11:59:16.485582413 +0900 >>+++ linux-taskfile-ng/drivers/ide/ide-dma.c 2005-03-03 12:00:07.753376048 +0900 >>@@ -175,10 +175,14 @@ 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); >>+ if (rq->rq_disk) { >>+ ide_driver_t *drv; >>+ >>+ drv = *(ide_driver_t **)rq->rq_disk->private_data;; >>+ drv->end_request(drive, 1, rq->nr_sectors); >>+ } else >>+ ide_end_request(drive, 1, rq->nr_sectors); >> return ide_stopped; >> } >> printk(KERN_ERR "%s: dma_intr: bad DMA status (dma_stat=%x)\n", > > Why not just set rq_disk for taskfile requests as well, seems a lot > cleaner than special casing the end_request handling. Just because other places were fixed this way and the whole drive command issue/completion codes are just about to be restructured. Above code will go away soon. Please consider it a quick fix. Thanks. -- tejun ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH ide-dev-2.6] ide: ide_dma_intr oops fix 2005-03-03 6:57 ` Tejun Heo @ 2005-03-03 8:04 ` Bartlomiej Zolnierkiewicz 2005-03-03 8:05 ` Jens Axboe 0 siblings, 1 reply; 7+ messages in thread From: Bartlomiej Zolnierkiewicz @ 2005-03-03 8:04 UTC (permalink / raw) To: Tejun Heo; +Cc: Jens Axboe, linux-kernel, linux-ide On Thu, 03 Mar 2005 15:57:18 +0900, Tejun Heo <htejun@gmail.com> wrote: > Hello, Jens. > > Jens Axboe wrote: > > On Thu, Mar 03 2005, Tejun Heo wrote: > > > >> Hello, Bartlomiej. > >> > >> This patch fixes ide_dma_intr() oops which occurs for TASKFILE ioctl > >>using DMA dataphses. This is against the latest ide-dev-2.6 tree + > >>all your recent 9 patches. > >> > >> Signed-off-by: Tejun Heo <htejun@gmail.com> > >> > >>Index: linux-taskfile-ng/drivers/ide/ide-dma.c > >>=================================================================== > >>--- linux-taskfile-ng.orig/drivers/ide/ide-dma.c 2005-03-03 11:59:16.485582413 +0900 > >>+++ linux-taskfile-ng/drivers/ide/ide-dma.c 2005-03-03 12:00:07.753376048 +0900 > >>@@ -175,10 +175,14 @@ 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); > >>+ if (rq->rq_disk) { > >>+ ide_driver_t *drv; > >>+ > >>+ drv = *(ide_driver_t **)rq->rq_disk->private_data;; > >>+ drv->end_request(drive, 1, rq->nr_sectors); > >>+ } else > >>+ ide_end_request(drive, 1, rq->nr_sectors); > >> return ide_stopped; > >> } > >> printk(KERN_ERR "%s: dma_intr: bad DMA status (dma_stat=%x)\n", > > > > Why not just set rq_disk for taskfile requests as well, seems a lot > > cleaner than special casing the end_request handling. > > Just because other places were fixed this way and the whole drive > command issue/completion codes are just about to be restructured. Above > code will go away soon. Please consider it a quick fix. > > Thanks. Because struct gendisk is now allocated by device drivers (like in SCSI subsystem) rq_disk can't be set for REQ_DRIVE_TASKFILE requests (for some requests it can be set but better to keep it consistent). ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH ide-dev-2.6] ide: ide_dma_intr oops fix 2005-03-03 8:04 ` Bartlomiej Zolnierkiewicz @ 2005-03-03 8:05 ` Jens Axboe 2005-03-03 8:14 ` Bartlomiej Zolnierkiewicz 0 siblings, 1 reply; 7+ messages in thread From: Jens Axboe @ 2005-03-03 8:05 UTC (permalink / raw) To: Bartlomiej Zolnierkiewicz; +Cc: Tejun Heo, linux-kernel, linux-ide On Thu, Mar 03 2005, Bartlomiej Zolnierkiewicz wrote: > On Thu, 03 Mar 2005 15:57:18 +0900, Tejun Heo <htejun@gmail.com> wrote: > > Hello, Jens. > > > > Jens Axboe wrote: > > > On Thu, Mar 03 2005, Tejun Heo wrote: > > > > > >> Hello, Bartlomiej. > > >> > > >> This patch fixes ide_dma_intr() oops which occurs for TASKFILE ioctl > > >>using DMA dataphses. This is against the latest ide-dev-2.6 tree + > > >>all your recent 9 patches. > > >> > > >> Signed-off-by: Tejun Heo <htejun@gmail.com> > > >> > > >>Index: linux-taskfile-ng/drivers/ide/ide-dma.c > > >>=================================================================== > > >>--- linux-taskfile-ng.orig/drivers/ide/ide-dma.c 2005-03-03 11:59:16.485582413 +0900 > > >>+++ linux-taskfile-ng/drivers/ide/ide-dma.c 2005-03-03 12:00:07.753376048 +0900 > > >>@@ -175,10 +175,14 @@ 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); > > >>+ if (rq->rq_disk) { > > >>+ ide_driver_t *drv; > > >>+ > > >>+ drv = *(ide_driver_t **)rq->rq_disk->private_data;; > > >>+ drv->end_request(drive, 1, rq->nr_sectors); > > >>+ } else > > >>+ ide_end_request(drive, 1, rq->nr_sectors); > > >> return ide_stopped; > > >> } > > >> printk(KERN_ERR "%s: dma_intr: bad DMA status (dma_stat=%x)\n", > > > > > > Why not just set rq_disk for taskfile requests as well, seems a lot > > > cleaner than special casing the end_request handling. > > > > Just because other places were fixed this way and the whole drive > > command issue/completion codes are just about to be restructured. Above > > code will go away soon. Please consider it a quick fix. > > > > Thanks. > > Because struct gendisk is now allocated by device drivers (like in SCSI > subsystem) rq_disk can't be set for REQ_DRIVE_TASKFILE requests > (for some requests it can be set but better to keep it consistent). Seems cleaner to store the driver in the drive structure then, no special casing needed. -- Jens Axboe ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH ide-dev-2.6] ide: ide_dma_intr oops fix 2005-03-03 8:05 ` Jens Axboe @ 2005-03-03 8:14 ` Bartlomiej Zolnierkiewicz 2005-03-03 8:20 ` Jens Axboe 0 siblings, 1 reply; 7+ messages in thread From: Bartlomiej Zolnierkiewicz @ 2005-03-03 8:14 UTC (permalink / raw) To: Jens Axboe; +Cc: Tejun Heo, linux-kernel, linux-ide On Thu, 3 Mar 2005 09:05:19 +0100, Jens Axboe <axboe@suse.de> wrote: > On Thu, Mar 03 2005, Bartlomiej Zolnierkiewicz wrote: > > On Thu, 03 Mar 2005 15:57:18 +0900, Tejun Heo <htejun@gmail.com> wrote: > > > Hello, Jens. > > > > > > Jens Axboe wrote: > > > > On Thu, Mar 03 2005, Tejun Heo wrote: > > > > > > > >> Hello, Bartlomiej. > > > >> > > > >> This patch fixes ide_dma_intr() oops which occurs for TASKFILE ioctl > > > >>using DMA dataphses. This is against the latest ide-dev-2.6 tree + > > > >>all your recent 9 patches. > > > >> > > > >> Signed-off-by: Tejun Heo <htejun@gmail.com> > > > >> > > > >>Index: linux-taskfile-ng/drivers/ide/ide-dma.c > > > >>=================================================================== > > > >>--- linux-taskfile-ng.orig/drivers/ide/ide-dma.c 2005-03-03 11:59:16.485582413 +0900 > > > >>+++ linux-taskfile-ng/drivers/ide/ide-dma.c 2005-03-03 12:00:07.753376048 +0900 > > > >>@@ -175,10 +175,14 @@ 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); > > > >>+ if (rq->rq_disk) { > > > >>+ ide_driver_t *drv; > > > >>+ > > > >>+ drv = *(ide_driver_t **)rq->rq_disk->private_data;; > > > >>+ drv->end_request(drive, 1, rq->nr_sectors); > > > >>+ } else > > > >>+ ide_end_request(drive, 1, rq->nr_sectors); > > > >> return ide_stopped; > > > >> } > > > >> printk(KERN_ERR "%s: dma_intr: bad DMA status (dma_stat=%x)\n", > > > > > > > > Why not just set rq_disk for taskfile requests as well, seems a lot > > > > cleaner than special casing the end_request handling. > > > > > > Just because other places were fixed this way and the whole drive > > > command issue/completion codes are just about to be restructured. Above > > > code will go away soon. Please consider it a quick fix. > > > > > > Thanks. > > > > Because struct gendisk is now allocated by device drivers (like in SCSI > > subsystem) rq_disk can't be set for REQ_DRIVE_TASKFILE requests > > (for some requests it can be set but better to keep it consistent). > > Seems cleaner to store the driver in the drive structure then, no > special casing needed. This can't be done *correctly* with driver model support, that is why SCSI does the same trick. There were three incremental patch series, all sent to linux-{ide,kernel} (all patches except the final one are now in ide-dev-2.6), to convert IDE device drivers to driver model. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH ide-dev-2.6] ide: ide_dma_intr oops fix 2005-03-03 8:14 ` Bartlomiej Zolnierkiewicz @ 2005-03-03 8:20 ` Jens Axboe 0 siblings, 0 replies; 7+ messages in thread From: Jens Axboe @ 2005-03-03 8:20 UTC (permalink / raw) To: Bartlomiej Zolnierkiewicz; +Cc: Tejun Heo, linux-kernel, linux-ide On Thu, Mar 03 2005, Bartlomiej Zolnierkiewicz wrote: > On Thu, 3 Mar 2005 09:05:19 +0100, Jens Axboe <axboe@suse.de> wrote: > > On Thu, Mar 03 2005, Bartlomiej Zolnierkiewicz wrote: > > > On Thu, 03 Mar 2005 15:57:18 +0900, Tejun Heo <htejun@gmail.com> wrote: > > > > Hello, Jens. > > > > > > > > Jens Axboe wrote: > > > > > On Thu, Mar 03 2005, Tejun Heo wrote: > > > > > > > > > >> Hello, Bartlomiej. > > > > >> > > > > >> This patch fixes ide_dma_intr() oops which occurs for TASKFILE ioctl > > > > >>using DMA dataphses. This is against the latest ide-dev-2.6 tree + > > > > >>all your recent 9 patches. > > > > >> > > > > >> Signed-off-by: Tejun Heo <htejun@gmail.com> > > > > >> > > > > >>Index: linux-taskfile-ng/drivers/ide/ide-dma.c > > > > >>=================================================================== > > > > >>--- linux-taskfile-ng.orig/drivers/ide/ide-dma.c 2005-03-03 11:59:16.485582413 +0900 > > > > >>+++ linux-taskfile-ng/drivers/ide/ide-dma.c 2005-03-03 12:00:07.753376048 +0900 > > > > >>@@ -175,10 +175,14 @@ 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); > > > > >>+ if (rq->rq_disk) { > > > > >>+ ide_driver_t *drv; > > > > >>+ > > > > >>+ drv = *(ide_driver_t **)rq->rq_disk->private_data;; > > > > >>+ drv->end_request(drive, 1, rq->nr_sectors); > > > > >>+ } else > > > > >>+ ide_end_request(drive, 1, rq->nr_sectors); > > > > >> return ide_stopped; > > > > >> } > > > > >> printk(KERN_ERR "%s: dma_intr: bad DMA status (dma_stat=%x)\n", > > > > > > > > > > Why not just set rq_disk for taskfile requests as well, seems a lot > > > > > cleaner than special casing the end_request handling. > > > > > > > > Just because other places were fixed this way and the whole drive > > > > command issue/completion codes are just about to be restructured. Above > > > > code will go away soon. Please consider it a quick fix. > > > > > > > > Thanks. > > > > > > Because struct gendisk is now allocated by device drivers (like in SCSI > > > subsystem) rq_disk can't be set for REQ_DRIVE_TASKFILE requests > > > (for some requests it can be set but better to keep it consistent). > > > > Seems cleaner to store the driver in the drive structure then, no > > special casing needed. > > This can't be done *correctly* with driver model support, that is why > SCSI does the same trick. There were three incremental patch series, > all sent to linux-{ide,kernel} (all patches except the final one are > now in ide-dev-2.6), to convert IDE device drivers to driver model. Ok, I guess we'll have to live with it then. -- Jens Axboe ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2005-03-03 8:20 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2005-03-03 3:03 [PATCH ide-dev-2.6] ide: ide_dma_intr oops fix Tejun Heo 2005-03-03 6:49 ` Jens Axboe 2005-03-03 6:57 ` Tejun Heo 2005-03-03 8:04 ` Bartlomiej Zolnierkiewicz 2005-03-03 8:05 ` Jens Axboe 2005-03-03 8:14 ` Bartlomiej Zolnierkiewicz 2005-03-03 8:20 ` Jens Axboe
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).