aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-27 07:46:38 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-27 07:46:38 -0400
commit04d09b0e62f2180a7e3fa8578ed778eca0c454fd (patch)
treefbb1d2e3bcd03127887a8286c121980c5b4a2ad8 /drivers
parentb6308ee0c55acd2e943d849773c9f0a49c516317 (diff)
ide: set IDE_TFLAG_WRITE basing on data phase used in ide_taskfile_ioctl()
Also take care of fixing up incorrect TASKFILE_IN_DMA[Q] data phase when IDE_DRIVE_TASK_RAW_WRITE is requested (no need to do it for TASKFILE_NO_DATA and TASKFILE_[MULTI]_IN -- it had no chance of working previously). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ide/ide-taskfile.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index 249a707f88a4..647216c772d9 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -586,7 +586,14 @@ int ide_taskfile_ioctl(ide_drive_t *drive, unsigned long arg)
586 if (req_task->in_flags.b.data) 586 if (req_task->in_flags.b.data)
587 cmd.ftf_flags |= IDE_FTFLAG_IN_DATA; 587 cmd.ftf_flags |= IDE_FTFLAG_IN_DATA;
588 588
589 switch(req_task->data_phase) { 589 if (req_task->req_cmd == IDE_DRIVE_TASK_RAW_WRITE) {
590 /* fixup data phase if needed */
591 if (req_task->data_phase == TASKFILE_IN_DMAQ ||
592 req_task->data_phase == TASKFILE_IN_DMA)
593 cmd.data_phase = TASKFILE_OUT_DMA;
594 }
595
596 switch (cmd.data_phase) {
590 case TASKFILE_MULTI_OUT: 597 case TASKFILE_MULTI_OUT:
591 if (!drive->mult_count) { 598 if (!drive->mult_count) {
592 /* (hs): give up if multcount is not set */ 599 /* (hs): give up if multcount is not set */
@@ -601,6 +608,7 @@ int ide_taskfile_ioctl(ide_drive_t *drive, unsigned long arg)
601 /* fall through */ 608 /* fall through */
602 case TASKFILE_OUT_DMAQ: 609 case TASKFILE_OUT_DMAQ:
603 case TASKFILE_OUT_DMA: 610 case TASKFILE_OUT_DMA:
611 cmd.tf_flags |= IDE_TFLAG_WRITE;
604 nsect = taskout / SECTOR_SIZE; 612 nsect = taskout / SECTOR_SIZE;
605 data_buf = outbuf; 613 data_buf = outbuf;
606 break; 614 break;
@@ -641,9 +649,6 @@ int ide_taskfile_ioctl(ide_drive_t *drive, unsigned long arg)
641 } 649 }
642 } 650 }
643 651
644 if (req_task->req_cmd == IDE_DRIVE_TASK_RAW_WRITE)
645 cmd.tf_flags |= IDE_TFLAG_WRITE;
646
647 err = ide_raw_taskfile(drive, &cmd, data_buf, nsect); 652 err = ide_raw_taskfile(drive, &cmd, data_buf, nsect);
648 653
649 memcpy(req_task->hob_ports, &cmd.tf_array[0], 654 memcpy(req_task->hob_ports, &cmd.tf_array[0],