public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: chipidea: udc: clear vbus_active flag in udc_stop
@ 2015-10-20  2:29 Jiada Wang
  2015-10-20  6:01 ` Peter Chen
  0 siblings, 1 reply; 6+ messages in thread
From: Jiada Wang @ 2015-10-20  2:29 UTC (permalink / raw)
  To: Peter.Chen, gregkh; +Cc: linux-usb, linux-kernel, jiada_wang

Currently in udc_stop, if vbus_active flag is true, all USB activities
will be stopped, but vbus_active flag is still left to be true,
this causes issue, when afterwards driver tries to connect gadget
device to host, But due to the uncleared vbus_active, some necessary
setup steps are skipped.

This patch clears vbus_active flag in udc_stop callback.

Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
---
 drivers/usb/chipidea/udc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index 8223fe7..b9ac228 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -1762,6 +1762,7 @@ static int ci_udc_stop(struct usb_gadget *gadget)
 	spin_lock_irqsave(&ci->lock, flags);
 
 	if (ci->vbus_active) {
+		ci->vbus_active = 0;
 		hw_device_state(ci, 0);
 		if (ci->platdata->notify_event)
 			ci->platdata->notify_event(ci,
-- 
2.4.5


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-10-20  6:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-20  2:29 [PATCH] usb: chipidea: udc: clear vbus_active flag in udc_stop Jiada Wang
2015-10-20  6:01 ` Peter Chen
2015-10-20  6:09   ` Jiada Wang
2015-10-20  6:28     ` Peter Chen
2015-10-20  6:33       ` Jiada Wang
2015-10-20  6:34         ` Peter Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox