summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2011-07-04 02:42:19 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2011-07-09 00:07:17 +0200
commit9a12d09765b72f7e1642f36d0e3ad2ce61fd31b6 (patch)
tree12f48117af31b1546da3658d5705b17736b56f50 /drivers/usb
parentUSB: PL2303: correctly handle baudrates above 115200 (diff)
downloadlinux-9a12d09765b72f7e1642f36d0e3ad2ce61fd31b6.tar.xz
linux-9a12d09765b72f7e1642f36d0e3ad2ce61fd31b6.zip
usb: renesas_usbhs: care buff alignment when dma handler
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/renesas_usbhs/fifo.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c
index 237e8b1e7027..912ce62279a6 100644
--- a/drivers/usb/renesas_usbhs/fifo.c
+++ b/drivers/usb/renesas_usbhs/fifo.c
@@ -642,6 +642,9 @@ static int usbhsf_dma_prepare_push(struct usbhs_pkt *pkt, int *is_done)
if (len % 4) /* 32bit alignment */
goto usbhsf_pio_prepare_push;
+ if (((u32)pkt->buf + pkt->actual) & 0x7) /* 8byte alignment */
+ goto usbhsf_pio_prepare_push;
+
/* get enable DMA fifo */
fifo = usbhsf_get_dma_fifo(priv, pkt);
if (!fifo)
@@ -716,6 +719,9 @@ static int usbhsf_dma_try_pop(struct usbhs_pkt *pkt, int *is_done)
if (!fifo)
goto usbhsf_pio_prepare_pop;
+ if (((u32)pkt->buf + pkt->actual) & 0x7) /* 8byte alignment */
+ goto usbhsf_pio_prepare_pop;
+
ret = usbhsf_fifo_select(pipe, fifo, 0);
if (ret < 0)
goto usbhsf_pio_prepare_pop;