Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: renesas_usbhs: Fix fifo unclear in usbhsf_prepare_pop

This patch fixes an issue for control write. When usbhsf_prepare_pop()
is called after this driver called a gadget setup function, this controller
doesn't receive the control write data. So, this patch adds a code to clear
the fifo for control write in usbhsf_prepare_pop().

Signed-off-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Kazuya Mizuguchi and committed by
Greg Kroah-Hartman
5e582ff3 138c3f03

+5
+5
drivers/usb/renesas_usbhs/fifo.c
··· 611 611 static int usbhsf_prepare_pop(struct usbhs_pkt *pkt, int *is_done) 612 612 { 613 613 struct usbhs_pipe *pipe = pkt->pipe; 614 + struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe); 615 + struct usbhs_fifo *fifo = usbhsf_get_cfifo(priv); 614 616 615 617 if (usbhs_pipe_is_busy(pipe)) 616 618 return 0; ··· 625 623 */ 626 624 usbhs_pipe_data_sequence(pipe, pkt->sequence); 627 625 pkt->sequence = -1; /* -1 sequence will be ignored */ 626 + 627 + if (usbhs_pipe_is_dcp(pipe)) 628 + usbhsf_fifo_clear(pipe, fifo); 628 629 629 630 usbhs_pipe_set_trans_count_if_bulk(pipe, pkt->length); 630 631 usbhs_pipe_enable(pipe);