diff options
author | Atsushi Nemoto <anemo@mba.ocn.ne.jp> | 2008-12-29 20:27:29 +0100 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-12-29 20:27:29 +0100 |
commit | f26f6ceacaaf017a677138cbca7ab076b565ca87 (patch) | |
tree | 78c9fd0109fa87c9090013ec649324fe7dfa7e35 /drivers/ide/tx4938ide.c | |
parent | a0fce792b55b260589c3d77293a224e84395ec07 (diff) | |
download | op-kernel-dev-f26f6ceacaaf017a677138cbca7ab076b565ca87.zip op-kernel-dev-f26f6ceacaaf017a677138cbca7ab076b565ca87.tar.gz |
tx493[89]ide: Fix length for __ide_flush_dcache_range
This fixes data corruption on PIO mode.
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: stable <stable@kernel.org>
Cc: sshtylyov@ru.mvista.com
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/tx4938ide.c')
-rw-r--r-- | drivers/ide/tx4938ide.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/ide/tx4938ide.c b/drivers/ide/tx4938ide.c index 9120063..13b63e7 100644 --- a/drivers/ide/tx4938ide.c +++ b/drivers/ide/tx4938ide.c @@ -181,7 +181,7 @@ static void tx4938ide_input_data_swap(ide_drive_t *drive, struct request *rq, while (count--) *ptr++ = cpu_to_le16(__raw_readw((void __iomem *)port)); - __ide_flush_dcache_range((unsigned long)buf, count * 2); + __ide_flush_dcache_range((unsigned long)buf, roundup(len, 2)); } static void tx4938ide_output_data_swap(ide_drive_t *drive, struct request *rq, @@ -195,7 +195,7 @@ static void tx4938ide_output_data_swap(ide_drive_t *drive, struct request *rq, __raw_writew(le16_to_cpu(*ptr), (void __iomem *)port); ptr++; } - __ide_flush_dcache_range((unsigned long)buf, count * 2); + __ide_flush_dcache_range((unsigned long)buf, roundup(len, 2)); } static const struct ide_tp_ops tx4938ide_tp_ops = { |