summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Chen <justinpopo6@gmail.com>2022-10-05 12:13:55 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-11-03 23:52:28 +0900
commit71316fe2ec23cd56129a453e518087b525738d25 (patch)
treee1d052580d167976f06fda29352c67d996299c62
parent370827107fe49dde38255db2420be67239ee3eba (diff)
downloadlinux-stable-71316fe2ec23cd56129a453e518087b525738d25.tar.gz
linux-stable-71316fe2ec23cd56129a453e518087b525738d25.tar.bz2
linux-stable-71316fe2ec23cd56129a453e518087b525738d25.zip
usb: bdc: change state when port disconnected
commit fb8f60dd1b67520e0e0d7978ef17d015690acfc1 upstream. 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> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Fixes: efed421a94e6 ("usb: gadget: Add UDC driver for Broadcom USB3.0 device controller IP BDC") Cc: stable <stable@kernel.org> Link: https://lore.kernel.org/r/1664997235-18198-1-git-send-email-justinpopo6@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/gadget/udc/bdc/bdc_udc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/gadget/udc/bdc/bdc_udc.c b/drivers/usb/gadget/udc/bdc/bdc_udc.c
index 7bfd58c846f7..71ed3a15130f 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 */