Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ec74f684 authored by Kyle Yan's avatar Kyle Yan Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: dwc3: restart usb upon endpoint cmd timeout" into msm-4.8

parents 82410552 43874173
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -1061,6 +1061,7 @@ struct dwc3 {


	/* IRQ timing statistics */
	/* IRQ timing statistics */
	int			irq;
	int			irq;
	unsigned long		ep_cmd_timeout_cnt;
	unsigned long		irq_cnt;
	unsigned long		irq_cnt;
	unsigned int		bh_completion_time[MAX_INTR_STATS];
	unsigned int		bh_completion_time[MAX_INTR_STATS];
	unsigned int		bh_handled_evt_cnt[MAX_INTR_STATS];
	unsigned int		bh_handled_evt_cnt[MAX_INTR_STATS];
+1 −1
Original line number Original line Diff line number Diff line
@@ -1694,7 +1694,7 @@ static void dwc3_msm_notify_event(struct dwc3 *dwc, unsigned int event)
		break;
		break;
	case DWC3_CONTROLLER_RESTART_USB_SESSION:
	case DWC3_CONTROLLER_RESTART_USB_SESSION:
		dev_dbg(mdwc->dev, "DWC3_CONTROLLER_RESTART_USB_SESSION received\n");
		dev_dbg(mdwc->dev, "DWC3_CONTROLLER_RESTART_USB_SESSION received\n");
		dwc3_restart_usb_work(&mdwc->restart_usb_work);
		schedule_work(&mdwc->restart_usb_work);
		break;
		break;
	default:
	default:
		dev_dbg(mdwc->dev, "unknown dwc3 event\n");
		dev_dbg(mdwc->dev, "unknown dwc3 event\n");
+6 −1
Original line number Original line Diff line number Diff line
@@ -238,7 +238,7 @@ int dwc3_send_gadget_ep_cmd(struct dwc3_ep *dep, unsigned cmd,
		struct dwc3_gadget_ep_cmd_params *params)
		struct dwc3_gadget_ep_cmd_params *params)
{
{
	struct dwc3		*dwc = dep->dwc;
	struct dwc3		*dwc = dep->dwc;
	u32			timeout = 1500;
	u32			timeout = 3000;
	u32			reg;
	u32			reg;


	int			cmd_status = 0;
	int			cmd_status = 0;
@@ -320,6 +320,11 @@ int dwc3_send_gadget_ep_cmd(struct dwc3_ep *dep, unsigned cmd,
		dwc3_trace(trace_dwc3_gadget, "Command Timed Out");
		dwc3_trace(trace_dwc3_gadget, "Command Timed Out");
		dev_err(dwc->dev, "%s command timeout for %s\n",
		dev_err(dwc->dev, "%s command timeout for %s\n",
			dwc3_gadget_ep_cmd_string(cmd), dep->name);
			dwc3_gadget_ep_cmd_string(cmd), dep->name);
		if (!(cmd & DWC3_DEPCMD_ENDTRANSFER)) {
			dwc->ep_cmd_timeout_cnt++;
			dwc3_notify_event(dwc,
				DWC3_CONTROLLER_RESTART_USB_SESSION);
		}
		cmd_status = -ETIMEDOUT;
		cmd_status = -ETIMEDOUT;
	}
	}