aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>2008-12-29 14:27:29 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-12-29 14:27:29 -0500
commitf26f6ceacaaf017a677138cbca7ab076b565ca87 (patch)
tree78c9fd0109fa87c9090013ec649324fe7dfa7e35 /drivers
parenta0fce792b55b260589c3d77293a224e84395ec07 (diff)
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')
-rw-r--r--drivers/ide/tx4938ide.c4
-rw-r--r--drivers/ide/tx4939ide.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/ide/tx4938ide.c b/drivers/ide/tx4938ide.c
index 9120063e8f87..13b63e7fa353 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,
181 181
182 while (count--) 182 while (count--)
183 *ptr++ = cpu_to_le16(__raw_readw((void __iomem *)port)); 183 *ptr++ = cpu_to_le16(__raw_readw((void __iomem *)port));
184 __ide_flush_dcache_range((unsigned long)buf, count * 2); 184 __ide_flush_dcache_range((unsigned long)buf, roundup(len, 2));
185} 185}
186 186
187static void tx4938ide_output_data_swap(ide_drive_t *drive, struct request *rq, 187static 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,
195 __raw_writew(le16_to_cpu(*ptr), (void __iomem *)port); 195 __raw_writew(le16_to_cpu(*ptr), (void __iomem *)port);
196 ptr++; 196 ptr++;
197 } 197 }
198 __ide_flush_dcache_range((unsigned long)buf, count * 2); 198 __ide_flush_dcache_range((unsigned long)buf, roundup(len, 2));
199} 199}
200 200
201static const struct ide_tp_ops tx4938ide_tp_ops = { 201static const struct ide_tp_ops tx4938ide_tp_ops = {
diff --git a/drivers/ide/tx4939ide.c b/drivers/ide/tx4939ide.c
index 30d0d256230f..97cd9e0f66f6 100644
--- a/drivers/ide/tx4939ide.c
+++ b/drivers/ide/tx4939ide.c
@@ -564,7 +564,7 @@ static void tx4939ide_input_data_swap(ide_drive_t *drive, struct request *rq,
564 564
565 while (count--) 565 while (count--)
566 *ptr++ = cpu_to_le16(__raw_readw((void __iomem *)port)); 566 *ptr++ = cpu_to_le16(__raw_readw((void __iomem *)port));
567 __ide_flush_dcache_range((unsigned long)buf, count * 2); 567 __ide_flush_dcache_range((unsigned long)buf, roundup(len, 2));
568} 568}
569 569
570static void tx4939ide_output_data_swap(ide_drive_t *drive, struct request *rq, 570static void tx4939ide_output_data_swap(ide_drive_t *drive, struct request *rq,
@@ -578,7 +578,7 @@ static void tx4939ide_output_data_swap(ide_drive_t *drive, struct request *rq,
578 __raw_writew(le16_to_cpu(*ptr), (void __iomem *)port); 578 __raw_writew(le16_to_cpu(*ptr), (void __iomem *)port);
579 ptr++; 579 ptr++;
580 } 580 }
581 __ide_flush_dcache_range((unsigned long)buf, count * 2); 581 __ide_flush_dcache_range((unsigned long)buf, roundup(len, 2));
582} 582}
583 583
584static const struct ide_tp_ops tx4939ide_tp_ops = { 584static const struct ide_tp_ops tx4939ide_tp_ops = {