Commit 49acace0 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Linus Torvalds

[PATCH] ide: check drive->mult_count in flagged_taskfile()

Check drive->mult_count in flagged_taskfile() and fail request early
if necessary so there is no need to do it later in the PIO handlers.
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent a3b94b8f
...@@ -1188,6 +1188,14 @@ ide_startstop_t flagged_taskfile (ide_drive_t *drive, ide_task_t *task) ...@@ -1188,6 +1188,14 @@ ide_startstop_t flagged_taskfile (ide_drive_t *drive, ide_task_t *task)
void debug_taskfile(drive, task); void debug_taskfile(drive, task);
#endif /* CONFIG_IDE_TASK_IOCTL_DEBUG */ #endif /* CONFIG_IDE_TASK_IOCTL_DEBUG */
if (task->data_phase == TASKFILE_MULTI_IN ||
task->data_phase == TASKFILE_MULTI_OUT) {
if (!drive->mult_count) {
printk(KERN_ERR "%s: multimode not set!\n", drive->name);
return ide_stopped;
}
}
/* /*
* (ks) Check taskfile in/out flags. * (ks) Check taskfile in/out flags.
* If set, then execute as it is defined. * If set, then execute as it is defined.
...@@ -1370,8 +1378,6 @@ ide_startstop_t flagged_task_mulin_intr (ide_drive_t *drive) ...@@ -1370,8 +1378,6 @@ ide_startstop_t flagged_task_mulin_intr (ide_drive_t *drive)
unsigned int msect, nsect; unsigned int msect, nsect;
msect = drive->mult_count; msect = drive->mult_count;
if (msect == 0)
return DRIVER(drive)->error(drive, "flagged_task_mulin_intr (multimode not set)", stat);
if (!OK_STAT(stat, DATA_READY, BAD_R_STAT)) { if (!OK_STAT(stat, DATA_READY, BAD_R_STAT)) {
if (stat & ERR_STAT) { if (stat & ERR_STAT) {
...@@ -1477,15 +1483,11 @@ ide_startstop_t flagged_task_out_intr (ide_drive_t *drive) ...@@ -1477,15 +1483,11 @@ ide_startstop_t flagged_task_out_intr (ide_drive_t *drive)
ide_startstop_t flagged_pre_task_mulout_intr (ide_drive_t *drive, struct request *rq) ide_startstop_t flagged_pre_task_mulout_intr (ide_drive_t *drive, struct request *rq)
{ {
ide_hwif_t *hwif = HWIF(drive);
u8 stat = hwif->INB(IDE_STATUS_REG);
char *pBuf = NULL; char *pBuf = NULL;
ide_startstop_t startstop; ide_startstop_t startstop;
unsigned int msect, nsect; unsigned int msect, nsect;
msect = drive->mult_count; msect = drive->mult_count;
if (msect == 0)
return DRIVER(drive)->error(drive, "flagged_pre_task_mulout_intr (multimode not set)", stat);
if (ide_wait_stat(&startstop, drive, DATA_READY, if (ide_wait_stat(&startstop, drive, DATA_READY,
BAD_W_STAT, WAIT_DRQ)) { BAD_W_STAT, WAIT_DRQ)) {
...@@ -1514,8 +1516,6 @@ ide_startstop_t flagged_task_mulout_intr (ide_drive_t *drive) ...@@ -1514,8 +1516,6 @@ ide_startstop_t flagged_task_mulout_intr (ide_drive_t *drive)
unsigned int msect, nsect; unsigned int msect, nsect;
msect = drive->mult_count; msect = drive->mult_count;
if (msect == 0)
return DRIVER(drive)->error(drive, "flagged_task_mulout_intr (multimode not set)", stat);
if (!OK_STAT(stat, DRIVE_READY, BAD_W_STAT)) if (!OK_STAT(stat, DRIVE_READY, BAD_W_STAT))
return DRIVER(drive)->error(drive, "flagged_task_mulout_intr", stat); return DRIVER(drive)->error(drive, "flagged_task_mulout_intr", stat);
......
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