linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: bdc: change state when port disconnected
@ 2022-10-05 19:13 justinpopo6
  2022-10-05 20:35 ` Florian Fainelli
  2022-10-08 15:44 ` Greg KH
  0 siblings, 2 replies; 6+ messages in thread
From: justinpopo6 @ 2022-10-05 19:13 UTC (permalink / raw)
  To: alcooperx, balbi, gregkh, linux-usb, linux-kernel
  Cc: bcm-kernel-feedback-list, justin.chen, f.fainelli, Justin Chen

From: Justin Chen <justinpopo6@gmail.com>

When port is connected and then disconnected, the state stays as
configured. Which is incorrect as the port is no longer configured,
but in a not attached state.

Signed-off-by: Justin Chen <justinpopo6@gmail.com>
---
 drivers/usb/gadget/udc/bdc/bdc_udc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/gadget/udc/bdc/bdc_udc.c b/drivers/usb/gadget/udc/bdc/bdc_udc.c
index 5ac0ef8..53ffaf4 100644
--- a/drivers/usb/gadget/udc/bdc/bdc_udc.c
+++ b/drivers/usb/gadget/udc/bdc/bdc_udc.c
@@ -151,6 +151,7 @@ static void bdc_uspc_disconnected(struct bdc *bdc, bool reinit)
 	bdc->delayed_status = false;
 	bdc->reinit = reinit;
 	bdc->test_mode = false;
+	usb_gadget_set_state(&bdc->gadget, USB_STATE_NOTATTACHED);
 }
 
 /* TNotify wkaeup timer */
-- 
2.7.4


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

end of thread, other threads:[~2022-10-22 11:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-05 19:13 [PATCH] usb: bdc: change state when port disconnected justinpopo6
2022-10-05 20:35 ` Florian Fainelli
2022-10-08 15:44 ` Greg KH
2022-10-10 14:58   ` Florian Fainelli
2022-10-17 21:05     ` Florian Fainelli
2022-10-22 10:52       ` Greg KH

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).