Commit 08e6c611 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Greg Kroah-Hartman

usb: renesas_usbhs: fixup connection fail

Sometimes the connection fail happen on renesas_usbhs.
This patch fix it up.
Signed-off-by: default avatarKuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent dcc85457
......@@ -462,8 +462,11 @@ static int usbhsg_ep_enable(struct usb_ep *ep,
* if it already have pipe,
* nothing to do
*/
if (uep->pipe)
if (uep->pipe) {
usbhs_pipe_clear(uep->pipe);
usbhs_pipe_clear_sequence(uep->pipe);
return 0;
}
pipe = usbhs_pipe_malloc(priv, desc);
if (pipe) {
......
......@@ -500,6 +500,12 @@ void usbhs_pipe_clear_sequence(struct usbhs_pipe *pipe)
usbhsp_pipectrl_set(pipe, SQCLR, SQCLR);
}
void usbhs_pipe_clear(struct usbhs_pipe *pipe)
{
usbhsp_pipectrl_set(pipe, ACLRM, ACLRM);
usbhsp_pipectrl_set(pipe, ACLRM, 0);
}
static struct usbhs_pipe *usbhsp_get_pipe(struct usbhs_priv *priv, u32 type)
{
struct usbhs_pipe *pos, *pipe;
......@@ -568,8 +574,7 @@ void usbhs_pipe_init(struct usbhs_priv *priv,
INIT_LIST_HEAD(&pipe->list);
/* pipe force init */
usbhsp_pipectrl_set(pipe, ACLRM, ACLRM);
usbhsp_pipectrl_set(pipe, ACLRM, 0);
usbhs_pipe_clear(pipe);
}
info->done = done;
......
......@@ -87,6 +87,7 @@ void usbhs_pipe_init(struct usbhs_priv *priv,
int (*dma_map_ctrl)(struct usbhs_pkt *pkt, int map));
int usbhs_pipe_get_maxpacket(struct usbhs_pipe *pipe);
void usbhs_pipe_clear_sequence(struct usbhs_pipe *pipe);
void usbhs_pipe_clear(struct usbhs_pipe *pipe);
int usbhs_pipe_is_accessible(struct usbhs_pipe *pipe);
void usbhs_pipe_enable(struct usbhs_pipe *pipe);
void usbhs_pipe_disable(struct usbhs_pipe *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