Commit f26f6cea authored by Atsushi Nemoto's avatar Atsushi Nemoto Committed by Bartlomiej Zolnierkiewicz

tx493[89]ide: Fix length for __ide_flush_dcache_range

This fixes data corruption on PIO mode.
Signed-off-by: default avatarAtsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: stable <stable@kernel.org>
Cc: sshtylyov@ru.mvista.com
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent a0fce792
...@@ -181,7 +181,7 @@ static void tx4938ide_input_data_swap(ide_drive_t *drive, struct request *rq, ...@@ -181,7 +181,7 @@ static void tx4938ide_input_data_swap(ide_drive_t *drive, struct request *rq,
while (count--) while (count--)
*ptr++ = cpu_to_le16(__raw_readw((void __iomem *)port)); *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, 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, ...@@ -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); __raw_writew(le16_to_cpu(*ptr), (void __iomem *)port);
ptr++; 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 = { static const struct ide_tp_ops tx4938ide_tp_ops = {
......
...@@ -564,7 +564,7 @@ static void tx4939ide_input_data_swap(ide_drive_t *drive, struct request *rq, ...@@ -564,7 +564,7 @@ static void tx4939ide_input_data_swap(ide_drive_t *drive, struct request *rq,
while (count--) while (count--)
*ptr++ = cpu_to_le16(__raw_readw((void __iomem *)port)); *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 tx4939ide_output_data_swap(ide_drive_t *drive, struct request *rq, static 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,7 +578,7 @@ static void tx4939ide_output_data_swap(ide_drive_t *drive, struct request *rq,
__raw_writew(le16_to_cpu(*ptr), (void __iomem *)port); __raw_writew(le16_to_cpu(*ptr), (void __iomem *)port);
ptr++; 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 tx4939ide_tp_ops = { static const struct ide_tp_ops tx4939ide_tp_ops = {
......
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