usb: cdns3: gadget: clear the interrupt status when disconnect the host
authorPeter Chen <peter.chen@nxp.com>
Tue, 1 Sep 2020 02:33:50 +0000 (10:33 +0800)
committerFelipe Balbi <balbi@kernel.org>
Fri, 2 Oct 2020 06:57:40 +0000 (09:57 +0300)
It is meaningless to handle any interrupts after disconnecting
with host

Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
drivers/usb/cdns3/gadget.c

index 081447bf731341ea66503e3f85cd7f89fd2d8b52..4c939dad9c339ef4bf291742991e693a1e8e3d25 100644 (file)
@@ -2739,10 +2739,13 @@ static int cdns3_gadget_pullup(struct usb_gadget *gadget, int is_on)
 {
        struct cdns3_device *priv_dev = gadget_to_cdns3_device(gadget);
 
-       if (is_on)
+       if (is_on) {
                writel(USB_CONF_DEVEN, &priv_dev->regs->usb_conf);
-       else
+       } else {
+               writel(~0, &priv_dev->regs->ep_ists);
+               writel(~0, &priv_dev->regs->usb_ists);
                writel(USB_CONF_DEVDS, &priv_dev->regs->usb_conf);
+       }
 
        return 0;
 }