提交 c786e09c 编写于 作者: K Kuninori Morimoto 提交者: Greg Kroah-Hartman

usb: renesas_usbhs: fixup fifo disable

It was necessary to check pipe condition after disable fifo.
Current driver checked it in a wrong place.
Signed-off-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 fd5054c1
...@@ -183,7 +183,6 @@ static void usbhsp_pipe_select(struct usbhs_pipe *pipe) ...@@ -183,7 +183,6 @@ static void usbhsp_pipe_select(struct usbhs_pipe *pipe)
static int usbhsp_pipe_barrier(struct usbhs_pipe *pipe) static int usbhsp_pipe_barrier(struct usbhs_pipe *pipe)
{ {
struct usbhs_priv *priv = usbhsp_pipe_to_priv(pipe); struct usbhs_priv *priv = usbhsp_pipe_to_priv(pipe);
struct device *dev = usbhs_priv_to_dev(priv);
int timeout = 1024; int timeout = 1024;
u16 val; u16 val;
...@@ -206,6 +205,7 @@ static int usbhsp_pipe_barrier(struct usbhs_pipe *pipe) ...@@ -206,6 +205,7 @@ static int usbhsp_pipe_barrier(struct usbhs_pipe *pipe)
* - "Pipe Control Registers Switching Procedure" * - "Pipe Control Registers Switching Procedure"
*/ */
usbhs_write(priv, CFIFOSEL, 0); usbhs_write(priv, CFIFOSEL, 0);
usbhs_fifo_disable(pipe);
do { do {
val = usbhsp_pipectrl_get(pipe); val = usbhsp_pipectrl_get(pipe);
...@@ -217,21 +217,6 @@ static int usbhsp_pipe_barrier(struct usbhs_pipe *pipe) ...@@ -217,21 +217,6 @@ static int usbhsp_pipe_barrier(struct usbhs_pipe *pipe)
} while (timeout--); } while (timeout--);
/*
* force NAK
*/
timeout = 1024;
usbhs_fifo_disable(pipe);
do {
val = usbhsp_pipectrl_get(pipe);
val &= PBUSY;
if (!val)
return 0;
} while (timeout--);
dev_err(dev, "pipe barrier failed\n");
return -EBUSY; return -EBUSY;
} }
...@@ -270,10 +255,22 @@ static void __usbhsp_pid_try_nak_if_stall(struct usbhs_pipe *pipe) ...@@ -270,10 +255,22 @@ static void __usbhsp_pid_try_nak_if_stall(struct usbhs_pipe *pipe)
void usbhs_fifo_disable(struct usbhs_pipe *pipe) void usbhs_fifo_disable(struct usbhs_pipe *pipe)
{ {
int timeout = 1024;
u16 val;
/* see "Pipe n Control Register" - "PID" */ /* see "Pipe n Control Register" - "PID" */
__usbhsp_pid_try_nak_if_stall(pipe); __usbhsp_pid_try_nak_if_stall(pipe);
usbhsp_pipectrl_set(pipe, PID_MASK, PID_NAK); usbhsp_pipectrl_set(pipe, PID_MASK, PID_NAK);
do {
val = usbhsp_pipectrl_get(pipe);
val &= PBUSY;
if (!val)
break;
udelay(10);
} while (timeout--);
} }
void usbhs_fifo_enable(struct usbhs_pipe *pipe) void usbhs_fifo_enable(struct usbhs_pipe *pipe)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册