Commit 45e13e6e authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Greg Kroah-Hartman

usb: renesas_usbhs: modify fifo clear timing

Pipe buffer should be cleaned before using it,
but should NOT be cleaned in pipe "prepare" function.
Because the pipe might be working in such timing.
This patch fixup this issue.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent a0c25c20
...@@ -369,15 +369,7 @@ static int usbhsp_fifo_select(struct usbhs_pipe *pipe, int write) ...@@ -369,15 +369,7 @@ static int usbhsp_fifo_select(struct usbhs_pipe *pipe, int write)
int usbhs_fifo_prepare_write(struct usbhs_pipe *pipe) int usbhs_fifo_prepare_write(struct usbhs_pipe *pipe)
{ {
int ret; return usbhsp_fifo_select(pipe, 1);
ret = usbhsp_fifo_select(pipe, 1);
if (ret < 0)
return ret;
usbhsp_fifo_clear(pipe);
return ret;
} }
int usbhs_fifo_write(struct usbhs_pipe *pipe, u8 *buf, int len) int usbhs_fifo_write(struct usbhs_pipe *pipe, u8 *buf, int len)
...@@ -392,7 +384,7 @@ int usbhs_fifo_write(struct usbhs_pipe *pipe, u8 *buf, int len) ...@@ -392,7 +384,7 @@ int usbhs_fifo_write(struct usbhs_pipe *pipe, u8 *buf, int len)
if (ret < 0) if (ret < 0)
return ret; return ret;
ret = usbhs_fifo_prepare_write(pipe); ret = usbhsp_fifo_select(pipe, 1);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -750,6 +742,8 @@ void usbhs_pipe_init(struct usbhs_priv *priv) ...@@ -750,6 +742,8 @@ void usbhs_pipe_init(struct usbhs_priv *priv)
usbhsp_flags_init(pipe); usbhsp_flags_init(pipe);
pipe->mod_private = NULL; pipe->mod_private = NULL;
usbhsp_fifo_clear(pipe);
} }
} }
......
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