linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Chen <peter.chen@nxp.com>
To: balbi@kernel.org
Cc: linux-usb@vger.kernel.org, linux-imx@nxp.com, pawell@cadence.com,
	rogerq@ti.com, gregkh@linuxfoundation.org, jun.li@nxp.com,
	Peter Chen <peter.chen@nxp.com>
Subject: [PATCH 3/5] usb: cdns3: gadget: clear the interrupt status when disconnect the host
Date: Tue,  1 Sep 2020 10:33:50 +0800	[thread overview]
Message-ID: <20200901023352.25552-4-peter.chen@nxp.com> (raw)
In-Reply-To: <20200901023352.25552-1-peter.chen@nxp.com>

It is meaningless to handle any interrupts after disconnecting
with host

Signed-off-by: Peter Chen <peter.chen@nxp.com>
---
 drivers/usb/cdns3/gadget.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/cdns3/gadget.c b/drivers/usb/cdns3/gadget.c
index 03b54c239944..829bc917df39 100644
--- a/drivers/usb/cdns3/gadget.c
+++ b/drivers/usb/cdns3/gadget.c
@@ -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;
 }
-- 
2.17.1


  parent reply	other threads:[~2020-09-01  2:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-01  2:33 [PATCH 0/5] usb: cdns3: misc improvements Peter Chen
2020-09-01  2:33 ` [PATCH 1/5] usb: cdns3: core: quit if it uses role switch class Peter Chen
2020-11-23 11:17   ` Roger Quadros
2020-09-01  2:33 ` [PATCH 2/5] usb: cdns3: gadget: set fast access bit Peter Chen
2020-09-01  2:33 ` Peter Chen [this message]
2020-09-01  2:33 ` [PATCH 4/5] usb: cdns3: drd: call PHY .set_mode accordingly Peter Chen
2020-09-01  2:33 ` [PATCH 5/5] usb: cdns3: gadget: move wait configuration operation Peter Chen
2020-09-14  1:26 ` [PATCH 0/5] usb: cdns3: misc improvements Peter Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200901023352.25552-4-peter.chen@nxp.com \
    --to=peter.chen@nxp.com \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jun.li@nxp.com \
    --cc=linux-imx@nxp.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=pawell@cadence.com \
    --cc=rogerq@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).