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

usb: renesas_usbhs: Don't disable the pipe if Control write status stage

This patch fixes an issue that sometimes this controller is not able
to complete the Control write status stage.

This driver should enable DCPCTR.CCPL and PID_BUF to complete the status
stage. However, if this driver detects the ctrl_stage interruption first
before the control write data is received, this driver will clear the
PID_BUF wrongly in the usbhsf_pio_try_pop(). To avoid this issue, this
patch doesn't clear the PID_BUF in the usbhsf_pio_try_pop().
(Since also the privious code doesn't disable the PID_BUF after a control
transfer was finished, this patch doesn't have any side efforts.)

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

authored by

Yoshihiro Shimoda and committed by
Greg Kroah-Hartman
c5d496ad 5e582ff3

+8 -1
+8 -1
drivers/usb/renesas_usbhs/fifo.c
··· 678 678 *is_done = 1; 679 679 usbhsf_rx_irq_ctrl(pipe, 0); 680 680 usbhs_pipe_running(pipe, 0); 681 - usbhs_pipe_disable(pipe); /* disable pipe first */ 681 + /* 682 + * If function mode, since this controller is possible to enter 683 + * Control Write status stage at this timing, this driver 684 + * should not disable the pipe. If such a case happens, this 685 + * controller is not able to complete the status stage. 686 + */ 687 + if (!usbhs_mod_is_host(priv) && !usbhs_pipe_is_dcp(pipe)) 688 + usbhs_pipe_disable(pipe); /* disable pipe first */ 682 689 } 683 690 684 691 /*