DEPSTARTCFG for non-EP0 EPs must only be sent once per config
[ balbi@ti.com : changed config_start to start_config_issued ]
Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* @ep0_status_pending: ep0 status response without a req is pending
* @ep0_bounced: true when we used bounce buffer
* @ep0_expect_in: true when we expect a DATA IN transfer
* @ep0_status_pending: ep0 status response without a req is pending
* @ep0_bounced: true when we used bounce buffer
* @ep0_expect_in: true when we expect a DATA IN transfer
+ * @start_config_issued: true when StartConfig command has been issued
* @ep0_next_event: hold the next expected event
* @ep0state: state of endpoint zero
* @link_state: link state
* @ep0_next_event: hold the next expected event
* @ep0state: state of endpoint zero
* @link_state: link state
unsigned ep0_status_pending:1;
unsigned ep0_bounced:1;
unsigned ep0_expect_in:1;
unsigned ep0_status_pending:1;
unsigned ep0_bounced:1;
unsigned ep0_expect_in:1;
+ unsigned start_config_issued:1;
enum dwc3_ep0_next ep0_next_event;
enum dwc3_ep0_state ep0state;
enum dwc3_ep0_next ep0_next_event;
enum dwc3_ep0_state ep0state;
+ dwc->start_config_issued = false;
cfg = le16_to_cpu(ctrl->wValue);
switch (dwc->dev_state) {
cfg = le16_to_cpu(ctrl->wValue);
switch (dwc->dev_state) {
if (dep->number != 1) {
cmd = DWC3_DEPCMD_DEPSTARTCFG;
/* XferRscIdx == 0 for ep0 and 2 for the remaining */
if (dep->number != 1) {
cmd = DWC3_DEPCMD_DEPSTARTCFG;
/* XferRscIdx == 0 for ep0 and 2 for the remaining */
+ if (dep->number > 1) {
+ if (dwc->start_config_issued)
+ return 0;
+ dwc->start_config_issued = true;
cmd |= DWC3_DEPCMD_PARAM(2);
cmd |= DWC3_DEPCMD_PARAM(2);
return dwc3_send_gadget_ep_cmd(dwc, 0, cmd, ¶ms);
}
return dwc3_send_gadget_ep_cmd(dwc, 0, cmd, ¶ms);
}
reg |= DWC3_DCFG_SUPERSPEED;
dwc3_writel(dwc->regs, DWC3_DCFG, reg);
reg |= DWC3_DCFG_SUPERSPEED;
dwc3_writel(dwc->regs, DWC3_DCFG, reg);
+ dwc->start_config_issued = false;
+
/* Start with SuperSpeed Default */
dwc3_gadget_ep0_desc.wMaxPacketSize = cpu_to_le16(512);
/* Start with SuperSpeed Default */
dwc3_gadget_ep0_desc.wMaxPacketSize = cpu_to_le16(512);
dwc3_stop_active_transfers(dwc);
dwc3_disconnect_gadget(dwc);
dwc3_stop_active_transfers(dwc);
dwc3_disconnect_gadget(dwc);
+ dwc->start_config_issued = false;
dwc->gadget.speed = USB_SPEED_UNKNOWN;
}
dwc->gadget.speed = USB_SPEED_UNKNOWN;
}
dwc3_stop_active_transfers(dwc);
dwc3_clear_stall_all_ep(dwc);
dwc3_stop_active_transfers(dwc);
dwc3_clear_stall_all_ep(dwc);
+ dwc->start_config_issued = false;
/* Reset device address to zero */
reg = dwc3_readl(dwc->regs, DWC3_DCFG);
/* Reset device address to zero */
reg = dwc3_readl(dwc->regs, DWC3_DCFG);