lkml.org 
[lkml]   [2009]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Date
    Subject[PATCH 06/14] ide: set IDE_TFLAG_WRITE basing on data phase used in ide_taskfile_ioctl()
    From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
    Subject: [PATCH] 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>
    ---
    drivers/ide/ide-taskfile.c | 13 +++++++++----
    1 file changed, 9 insertions(+), 4 deletions(-)

    Index: b/drivers/ide/ide-taskfile.c
    ===================================================================
    --- a/drivers/ide/ide-taskfile.c
    +++ b/drivers/ide/ide-taskfile.c
    @@ -582,7 +582,14 @@ int ide_taskfile_ioctl(ide_drive_t *driv
    if (req_task->in_flags.b.data)
    cmd.ftf_flags |= IDE_FTFLAG_IN_DATA;

    - switch(req_task->data_phase) {
    + if (req_task->req_cmd == IDE_DRIVE_TASK_RAW_WRITE) {
    + /* fixup data phase if needed */
    + if (req_task->data_phase == TASKFILE_IN_DMAQ ||
    + req_task->data_phase == TASKFILE_IN_DMA)
    + cmd.data_phase = TASKFILE_OUT_DMA;
    + }
    +
    + switch (cmd.data_phase) {
    case TASKFILE_MULTI_OUT:
    if (!drive->mult_count) {
    /* (hs): give up if multcount is not set */
    @@ -597,6 +604,7 @@ int ide_taskfile_ioctl(ide_drive_t *driv
    /* fall through */
    case TASKFILE_OUT_DMAQ:
    case TASKFILE_OUT_DMA:
    + cmd.tf_flags |= IDE_TFLAG_WRITE;
    nsect = taskout / SECTOR_SIZE;
    data_buf = outbuf;
    break;
    @@ -637,9 +645,6 @@ int ide_taskfile_ioctl(ide_drive_t *driv
    }
    }

    - if (req_task->req_cmd == IDE_DRIVE_TASK_RAW_WRITE)
    - cmd.tf_flags |= IDE_TFLAG_WRITE;
    -
    err = ide_raw_taskfile(drive, &cmd, data_buf, nsect);

    memcpy(req_task->hob_ports, &cmd.tf_array[0],

    \
     
     \ /
      Last update: 2009-02-02 22:41    [W:0.026 / U:60.920 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site