From: Baolin Wang <baolin.wang@linaro.org>
To: balbi@kernel.org
Cc: gregkh@linuxfoundation.org, broonie@kernel.org,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
baolin.wang@linaro.org
Subject: [RESEND PATCH v3 1/2] usb: dwc3: gadget: Add disconnect checking when changing function dynamically
Date: Tue, 4 Oct 2016 16:42:25 +0800 [thread overview]
Message-ID: <521625dd7f5e335e2a681ec65ebffc5832207e5f.1475570367.git.baolin.wang@linaro.org> (raw)
When system has stpped the gadget, we should avoid queuing any requests
which will cause tranfer failed. Thus adding some disconnect checking to
avoid this situation.
Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
---
Changes since v2:
- Move disconnect checking into dwc3_send_gadget_ep_cmd().
- Rename completion name and issue complete() at one place.
- Move completion initialization into dwc3_gadget_init().
Changes since v1:
- Split into 2 separate ptaches.
- Choose complete mechanism instead of polling.
---
drivers/usb/dwc3/gadget.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 1783406..ca2ae5b 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -241,6 +241,9 @@ int dwc3_send_gadget_ep_cmd(struct dwc3_ep *dep, unsigned cmd,
int susphy = false;
int ret = -EINVAL;
+ if (!dwc->pullups_connected)
+ return -ESHUTDOWN;
+
/*
* Synopsys Databook 2.60a states, on section 6.3.2.5.[1-8], that if
* we're issuing an endpoint command, we must check if
--
1.7.9.5
next reply other threads:[~2016-10-04 8:42 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-04 8:42 Baolin Wang [this message]
2016-10-04 8:42 ` [RESEND PATCH v3 2/2] usb: dwc3: Wait for control tranfer completed when stopping gadget Baolin Wang
2016-10-13 7:08 ` Felipe Balbi
2016-10-13 7:51 ` Baolin Wang
2016-10-13 7:54 ` Felipe Balbi
2016-10-13 8:01 ` Baolin Wang
2016-10-13 7:06 ` [RESEND PATCH v3 1/2] usb: dwc3: gadget: Add disconnect checking when changing function dynamically Felipe Balbi
2016-10-13 7:37 ` Baolin Wang
2016-10-13 8:16 ` Janusz Dziedzic
2016-10-13 8:21 ` Baolin Wang
2016-10-13 8:28 ` Janusz Dziedzic
2016-10-13 8:39 ` Baolin Wang
2016-10-13 9:49 ` Felipe Balbi
2016-10-13 10:41 ` Baolin Wang
2016-10-13 11:16 ` Janusz Dziedzic
2016-10-13 11:22 ` Felipe Balbi
2016-10-13 11:30 ` Baolin Wang
2016-10-13 11:46 ` Baolin Wang
2016-10-13 12:17 ` Felipe Balbi
2016-10-13 12:23 ` Baolin Wang
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=521625dd7f5e335e2a681ec65ebffc5832207e5f.1475570367.git.baolin.wang@linaro.org \
--to=baolin.wang@linaro.org \
--cc=balbi@kernel.org \
--cc=broonie@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.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
all inboxes | Powered by JetHome®