Commit 47d35d55 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Linus Torvalds

[PATCH] ide: cleanup taskfile PIO handlers (CONFIG_IDE_TASKFILE_IO=n)

These handlers are nowadays used only for REQ_DRIVE_TASKFILE
requests (rq->bio is always NULL) which aren't retried et all so
remove code 'rewinding' rq->current_nr_sectors and some FIXMEs.
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent e4df35a0
...@@ -307,10 +307,6 @@ EXPORT_SYMBOL(task_no_data_intr); ...@@ -307,10 +307,6 @@ EXPORT_SYMBOL(task_no_data_intr);
/* /*
* Handler for command with PIO data-in phase, READ * Handler for command with PIO data-in phase, READ
*/ */
/*
* FIXME before 2.4 enable ...
* DATA integrity issue upon error. <andre@linux-ide.org>
*/
ide_startstop_t task_in_intr (ide_drive_t *drive) ide_startstop_t task_in_intr (ide_drive_t *drive)
{ {
struct request *rq = HWGROUP(drive)->rq; struct request *rq = HWGROUP(drive)->rq;
...@@ -321,18 +317,6 @@ ide_startstop_t task_in_intr (ide_drive_t *drive) ...@@ -321,18 +317,6 @@ ide_startstop_t task_in_intr (ide_drive_t *drive)
if (!OK_STAT(stat = hwif->INB(IDE_STATUS_REG),DATA_READY,BAD_R_STAT)) { if (!OK_STAT(stat = hwif->INB(IDE_STATUS_REG),DATA_READY,BAD_R_STAT)) {
if (stat & (ERR_STAT|DRQ_STAT)) { if (stat & (ERR_STAT|DRQ_STAT)) {
#if 0
DTF("%s: attempting to recover last " \
"sector counter status=0x%02x\n",
drive->name, stat);
/*
* Expect a BUG BOMB if we attempt to rewind the
* offset in the BH aka PAGE in the current BLOCK
* segment. This is different than the HOST segment.
*/
#endif
if (!rq->bio)
rq->current_nr_sectors++;
return DRIVER(drive)->error(drive, "task_in_intr", stat); return DRIVER(drive)->error(drive, "task_in_intr", stat);
} }
if (!(stat & BUSY_STAT)) { if (!(stat & BUSY_STAT)) {
...@@ -348,12 +332,8 @@ ide_startstop_t task_in_intr (ide_drive_t *drive) ...@@ -348,12 +332,8 @@ ide_startstop_t task_in_intr (ide_drive_t *drive)
pBuf, (int) rq->current_nr_sectors, stat); pBuf, (int) rq->current_nr_sectors, stat);
taskfile_input_data(drive, pBuf, SECTOR_WORDS); taskfile_input_data(drive, pBuf, SECTOR_WORDS);
task_unmap_rq(rq, pBuf, &flags); task_unmap_rq(rq, pBuf, &flags);
/*
* FIXME :: We really can not legally get a new page/bh /* FIXME: check drive status */
* regardless, if this is the end of our segment.
* BH walking or segment can only be updated after we have a good
* hwif->INB(IDE_STATUS_REG); return.
*/
if (--rq->current_nr_sectors <= 0) if (--rq->current_nr_sectors <= 0)
if (!DRIVER(drive)->end_request(drive, 1, 0)) if (!DRIVER(drive)->end_request(drive, 1, 0))
return ide_stopped; return ide_stopped;
...@@ -383,16 +363,6 @@ ide_startstop_t task_mulin_intr (ide_drive_t *drive) ...@@ -383,16 +363,6 @@ ide_startstop_t task_mulin_intr (ide_drive_t *drive)
if (!OK_STAT(stat = hwif->INB(IDE_STATUS_REG),DATA_READY,BAD_R_STAT)) { if (!OK_STAT(stat = hwif->INB(IDE_STATUS_REG),DATA_READY,BAD_R_STAT)) {
if (stat & (ERR_STAT|DRQ_STAT)) { if (stat & (ERR_STAT|DRQ_STAT)) {
if (!rq->bio) {
rq->current_nr_sectors += drive->mult_count;
/*
* NOTE: could rewind beyond beginning :-/
*/
} else {
printk(KERN_ERR "%s: MULTI-READ assume all data " \
"transfered is bad status=0x%02x\n",
drive->name, stat);
}
return DRIVER(drive)->error(drive, "task_mulin_intr", stat); return DRIVER(drive)->error(drive, "task_mulin_intr", stat);
} }
/* no data yet, so wait for another interrupt */ /* no data yet, so wait for another interrupt */
...@@ -414,12 +384,8 @@ ide_startstop_t task_mulin_intr (ide_drive_t *drive) ...@@ -414,12 +384,8 @@ ide_startstop_t task_mulin_intr (ide_drive_t *drive)
rq->errors = 0; rq->errors = 0;
rq->current_nr_sectors -= nsect; rq->current_nr_sectors -= nsect;
msect -= nsect; msect -= nsect;
/*
* FIXME :: We really can not legally get a new page/bh /* FIXME: check drive status */
* regardless, if this is the end of our segment.
* BH walking or segment can only be updated after we have a
* good hwif->INB(IDE_STATUS_REG); return.
*/
if (!rq->current_nr_sectors) { if (!rq->current_nr_sectors) {
if (!DRIVER(drive)->end_request(drive, 1, 0)) if (!DRIVER(drive)->end_request(drive, 1, 0))
return ide_stopped; return ide_stopped;
...@@ -473,10 +439,6 @@ ide_startstop_t task_out_intr (ide_drive_t *drive) ...@@ -473,10 +439,6 @@ ide_startstop_t task_out_intr (ide_drive_t *drive)
u8 stat; u8 stat;
if (!OK_STAT(stat = hwif->INB(IDE_STATUS_REG), DRIVE_READY, drive->bad_wstat)) { if (!OK_STAT(stat = hwif->INB(IDE_STATUS_REG), DRIVE_READY, drive->bad_wstat)) {
DTF("%s: WRITE attempting to recover last " \
"sector counter status=0x%02x\n",
drive->name, stat);
rq->current_nr_sectors++;
return DRIVER(drive)->error(drive, "task_out_intr", stat); return DRIVER(drive)->error(drive, "task_out_intr", stat);
} }
/* /*
...@@ -532,9 +494,6 @@ ide_startstop_t pre_task_mulout_intr (ide_drive_t *drive, struct request *rq) ...@@ -532,9 +494,6 @@ ide_startstop_t pre_task_mulout_intr (ide_drive_t *drive, struct request *rq)
EXPORT_SYMBOL(pre_task_mulout_intr); EXPORT_SYMBOL(pre_task_mulout_intr);
/*
* FIXME before enabling in 2.4 ... DATA integrity issue upon error.
*/
/* /*
* Handler for command write multiple * Handler for command write multiple
* Called directly from execute_drive_cmd for the first bunch of sectors, * Called directly from execute_drive_cmd for the first bunch of sectors,
...@@ -557,16 +516,6 @@ ide_startstop_t task_mulout_intr (ide_drive_t *drive) ...@@ -557,16 +516,6 @@ ide_startstop_t task_mulout_intr (ide_drive_t *drive)
*/ */
if (rq->current_nr_sectors == 0) { if (rq->current_nr_sectors == 0) {
if (stat & (ERR_STAT|DRQ_STAT)) { if (stat & (ERR_STAT|DRQ_STAT)) {
if (!rq->bio) {
rq->current_nr_sectors += drive->mult_count;
/*
* NOTE: could rewind beyond beginning :-/
*/
} else {
printk(KERN_ERR "%s: MULTI-WRITE assume all data " \
"transfered is bad status=0x%02x\n",
drive->name, stat);
}
return DRIVER(drive)->error(drive, "task_mulout_intr", stat); return DRIVER(drive)->error(drive, "task_mulout_intr", stat);
} }
if (!rq->bio) if (!rq->bio)
...@@ -578,16 +527,6 @@ ide_startstop_t task_mulout_intr (ide_drive_t *drive) ...@@ -578,16 +527,6 @@ ide_startstop_t task_mulout_intr (ide_drive_t *drive)
*/ */
if (!OK_STAT(stat,DATA_READY,BAD_R_STAT)) { if (!OK_STAT(stat,DATA_READY,BAD_R_STAT)) {
if (stat & (ERR_STAT|DRQ_STAT)) { if (stat & (ERR_STAT|DRQ_STAT)) {
if (!rq->bio) {
rq->current_nr_sectors += drive->mult_count;
/*
* NOTE: could rewind beyond beginning :-/
*/
} else {
printk("%s: MULTI-WRITE assume all data " \
"transfered is bad status=0x%02x\n",
drive->name, stat);
}
return DRIVER(drive)->error(drive, "task_mulout_intr", stat); return DRIVER(drive)->error(drive, "task_mulout_intr", stat);
} }
/* no data yet, so wait for another interrupt */ /* no data yet, so wait for another interrupt */
...@@ -616,12 +555,8 @@ ide_startstop_t task_mulout_intr (ide_drive_t *drive) ...@@ -616,12 +555,8 @@ ide_startstop_t task_mulout_intr (ide_drive_t *drive)
taskfile_output_data(drive, pBuf, nsect * SECTOR_WORDS); taskfile_output_data(drive, pBuf, nsect * SECTOR_WORDS);
task_unmap_rq(rq, pBuf, &flags); task_unmap_rq(rq, pBuf, &flags);
rq->current_nr_sectors -= nsect; rq->current_nr_sectors -= nsect;
/*
* FIXME :: We really can not legally get a new page/bh /* FIXME: check drive status */
* regardless, if this is the end of our segment.
* BH walking or segment can only be updated after we
* have a good hwif->INB(IDE_STATUS_REG); return.
*/
if (!rq->current_nr_sectors) { if (!rq->current_nr_sectors) {
if (!DRIVER(drive)->end_request(drive, 1, 0)) if (!DRIVER(drive)->end_request(drive, 1, 0))
if (!rq->bio) if (!rq->bio)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment