Skip to content

Commit

Permalink
[libata] Call flush_dcache_page after PIO data transfers in libata-sff.c
Browse files Browse the repository at this point in the history
flush_dcache_page() must be called after (!ATA_TFLAG_WRITE) the
data copying to avoid D-cache aliasing with user space or I-D cache
coherency issues (when reading data from an ATA device using PIO,
the kernel dirties the D-cache but there is no flush_dcache_page()
required on Harvard architectures).

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
  • Loading branch information
Catalin Marinas authored and Jeff Garzik committed Feb 4, 2010
1 parent cedc9bf commit 2d68b7f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/ata/libata-sff.c
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,9 @@ static void ata_pio_sector(struct ata_queued_cmd *qc)
do_write);
}

if (!do_write)
flush_dcache_page(page);

qc->curbytes += qc->sect_size;
qc->cursg_ofs += qc->sect_size;

Expand Down

0 comments on commit 2d68b7f

Please sign in to comment.