usb: r8a66597-hcd: Flush the D-cache for the pipe-in transfer buffers.
authorPaul Mundt <lethal@linux-sh.org>
Thu, 4 Feb 2010 06:57:58 +0000 (06:57 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 23 Feb 2010 15:37:48 +0000 (07:37 -0800)
commitce460107ed450221d040be0cf088973e58ad23eb
tree7773592c16604e440c73abce493f4b02f6fce518
parent6ea0e838a5594a90c5a0a4fdf989831e34684cb0
usb: r8a66597-hcd: Flush the D-cache for the pipe-in transfer buffers.

commit 2717568e7c44fe7dc3f4f52ea823811cfeede2b5 upstream.

This implements the same D-cache flushing logic for r8a66597-hcd as
Catalin's isp1760 (http://patchwork.kernel.org/patch/76391/) change,
with the same note applying here as well:

    When the HDC driver writes the data to the transfer buffers it
    pollutes the D-cache (unlike DMA drivers where the device writes
    the data). If the corresponding pages get mapped into user space,
    there are no additional cache flushing operations performed and
    this causes random user space faults on architectures with
    separate I and D caches (Harvard) or those with aliasing D-cache.

This fixes up crashes during USB boot on SH7724 and others:

http://marc.info/?l=linux-sh&m=126439837308912&w=2

Reported-by: Goda Yusuke <goda.yusuke@renesas.com>
Tested-by: Goda Yusuke <goda.yusuke@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Acked-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/host/r8a66597-hcd.c