From f4cfe5ce607dd87873956453a7775c102a18fc62 Mon Sep 17 00:00:00 2001 From: Peter Chen Date: Fri, 17 Jul 2020 18:13:17 +0800 Subject: usb: cdns3: gadget: improve the set_configuration handling - Delete the duplicated EP_CMD_ERDY and EP_CMD_REQ_CMPL setting - Prepare the next setup before setting EP_CMD_ERDY and EP_CMD_REQ_CMPL, it could avoid a bug that DMA hang at EP0 OUT for DEV_VER_NXP_V1 - Delete the duplicated cdns3_set_hw_configuration calling at cdns3_req_ep0_set_configuration, the composite.c will handle this request, and call .ep0_queue back, and at .ep_queue it will call cdns3_set_hw_configuration. - Move cdns3_allow_enable_l1 into cdns3_set_hw_configuration since it is part of this function. Signed-off-by: Peter Chen Signed-off-by: Felipe Balbi --- drivers/usb/cdns3/gadget.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/usb/cdns3/gadget.c') diff --git a/drivers/usb/cdns3/gadget.c b/drivers/usb/cdns3/gadget.c index d9dde624636b..5b4b16bf4164 100644 --- a/drivers/usb/cdns3/gadget.c +++ b/drivers/usb/cdns3/gadget.c @@ -1315,7 +1315,6 @@ void cdns3_set_hw_configuration(struct cdns3_device *priv_dev) return; writel(USB_CONF_CFGSET, &priv_dev->regs->usb_conf); - writel(EP_CMD_ERDY | EP_CMD_REQ_CMPL, &priv_dev->regs->ep_cmd); cdns3_set_register_bit(&priv_dev->regs->usb_conf, USB_CONF_U1EN | USB_CONF_U2EN); @@ -1332,6 +1331,8 @@ void cdns3_set_hw_configuration(struct cdns3_device *priv_dev) cdns3_start_all_request(priv_dev, priv_ep); } } + + cdns3_allow_enable_l1(priv_dev, 1); } /** -- cgit