Skip to content

Commit a7131ed

Browse files
shimodaygregkh
authored andcommitted
usb: renesas_usbhs: fix the BCLR setting condition for non-DCP pipe
commit 6124607acc88fffeaadf3aacfeb3cc1304c87387 upstream. This patch fixes an issue that the driver sets the BCLR bit of {C,Dn}FIFOCTR register to 1 even when it's non-DCP pipe and the FRDY bit of {C,Dn}FIFOCTR register is set to 1. Fixes: e8d548d ("usb: renesas_usbhs: fifo became independent from pipe.") Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent e85bd5b commit a7131ed

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

  • drivers/usb/renesas_usbhs

drivers/usb/renesas_usbhs/fifo.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,11 +285,17 @@ static void usbhsf_fifo_clear(struct usbhs_pipe *pipe,
285285
struct usbhs_fifo *fifo)
286286
{
287287
struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe);
288+
int ret = 0;
288289

289290
if (!usbhs_pipe_is_dcp(pipe))
290-
usbhsf_fifo_barrier(priv, fifo);
291+
ret = usbhsf_fifo_barrier(priv, fifo);
291292

292-
usbhs_write(priv, fifo->ctr, BCLR);
293+
/*
294+
* if non-DCP pipe, this driver should set BCLR when
295+
* usbhsf_fifo_barrier() returns 0.
296+
*/
297+
if (!ret)
298+
usbhs_write(priv, fifo->ctr, BCLR);
293299
}
294300

295301
static int usbhsf_fifo_rcv_len(struct usbhs_priv *priv,

0 commit comments

Comments
 (0)