linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
To: Linux USB Mailing List
	<linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Cc: Greg KH
	<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
	kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org,
	Linux OMAP Mailing List
	<linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Kishon Vijay Abraham I <kishon-l0cyMroinI0@public.gmane.org>,
	Roger Quadros <rogerq-l0cyMroinI0@public.gmane.org>,
	George Cherian <george.cherian-l0cyMroinI0@public.gmane.org>,
	bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org,
	aaro.koskinen-X3B1VOXEql0@public.gmane.org,
	heikki.krogerus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org,
	zhangwm-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org,
	David Cohen
	<david.a.cohen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
	Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>,
	stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH 1/8] usb: dwc3: gadget: clear stall when disabling endpoint
Date: Wed, 16 Apr 2014 16:26:28 -0500	[thread overview]
Message-ID: <1397683595-3606-2-git-send-email-balbi@ti.com> (raw)
In-Reply-To: <1397683595-3606-1-git-send-email-balbi-l0cyMroinI0@public.gmane.org>

so it seems like DWC3 IP doesn't clear stalls
automatically when we disable an endpoint, because
of that, we _must_ make sure stalls are cleared
before clearing the proper bit in DALEPENA register.

Cc: <stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> # v3.4+
Reported-by: Johannes Stezenbach <js-FF7aIK3TAVNeoWH0uzbU5w@public.gmane.org>
Signed-off-by: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
---
 drivers/usb/dwc3/gadget.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index a740eac..f0dc0ee 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -608,6 +608,10 @@ static int __dwc3_gadget_ep_disable(struct dwc3_ep *dep)
 
 	dwc3_remove_requests(dwc, dep);
 
+	/* make sure HW endpoint isn't stalled */
+	if (dep->flags & DWC3_EP_STALL)
+		__dwc3_gadget_ep_set_halt(dep, 0);
+
 	reg = dwc3_readl(dwc->regs, DWC3_DALEPENA);
 	reg &= ~DWC3_DALEPENA_EP(dep->number);
 	dwc3_writel(dwc->regs, DWC3_DALEPENA, reg);
-- 
1.9.2.459.g68773ac

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2014-04-16 21:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-16 21:26 [PATCH 0/8] usb: generic cleanup patches Felipe Balbi
2014-04-16 21:26 ` [PATCH 2/8] usb: dwc3: core: refactor PHY initialization Felipe Balbi
2014-04-16 21:26 ` [PATCH 3/8] usb: dwc3: core: refactor mode initialization to its own function Felipe Balbi
2014-04-16 21:26 ` [PATCH 4/8] usb: gadget: only GPL drivers in the gadget and phy framework Felipe Balbi
2014-04-16 21:26 ` [PATCH 6/8] usb: phy: rename <linux/usb/usb_phy_gen_xceiv.h> to <linux/usb/usb_phy_generic.h> Felipe Balbi
     [not found] ` <1397683595-3606-1-git-send-email-balbi-l0cyMroinI0@public.gmane.org>
2014-04-16 21:26   ` Felipe Balbi [this message]
2014-04-16 21:26   ` [PATCH 5/8] usb: phy: rename usb_nop_xceiv to usb_phy_generic Felipe Balbi
     [not found]     ` <1397683595-3606-6-git-send-email-balbi-l0cyMroinI0@public.gmane.org>
2014-04-18 10:44       ` Leigh Brown
2014-04-16 21:26   ` [PATCH 7/8] usb: musb: move usb_phy_generic_{un,}register calls to probe()/remove() Felipe Balbi
2014-04-16 21:26 ` [PATCH 8/8] usb: phy: generic: allow multiples calls to usb_phy_generic_register() Felipe Balbi
2014-04-18 10:38   ` Leigh Brown
2014-04-18 14:45     ` Felipe Balbi

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=1397683595-3606-2-git-send-email-balbi@ti.com \
    --to=balbi-l0cymroini0@public.gmane.org \
    --cc=aaro.koskinen-X3B1VOXEql0@public.gmane.org \
    --cc=bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org \
    --cc=david.a.cohen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=george.cherian-l0cyMroinI0@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=heikki.krogerus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=kishon-l0cyMroinI0@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=rogerq-l0cyMroinI0@public.gmane.org \
    --cc=stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=zhangwm-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org \
    /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).