Skip to contentSkip to conversation

usb: bdc: change state when port disconnected

PATCH In review [email protected] 3 participants 6 messages Oct 5, 2022 – Oct 22, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: bdc: change state when port disconnected

From: Justin Chen <[email protected]>

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.

---
 drivers/usb/gadget/udc/bdc/bdc_udc.c | 1 +
 1 file changed, 1 insertion(+)
drivers/usb/gadget/udc/bdc/bdc_udc.c +1 -0
index 5ac0ef8..53ffaf4 100644
@@ -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 */
Signature · 1 line
2.7.4
maintainer
#2 lore raw
In reply to [email protected]
Quoted 10 lines · On Wed, Oct 05, 2022 at 12:13:55PM -0700, [email protected] wrote:

From: Justin Chen <[email protected]>

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.

---
 drivers/usb/gadget/udc/bdc/bdc_udc.c | 1 +
 1 file changed, 1 insertion(+)

What commit id does this fix? Should it go to older kernels? If so, how far back?

thanks,

greg k-h

#3 lore raw
Quoted 7 lines · Greg KH
Quoted 6 lines · On Wed, Oct 05, 2022 at 12:13:55PM -0700, [email protected] wrote:

From: Justin Chen <[email protected]>

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.

Quoted 7 lines
Quoted 4 lines
---
  drivers/usb/gadget/udc/bdc/bdc_udc.c | 1 +
  1 file changed, 1 insertion(+)

What commit id does this fix? Should it go to older kernels? If so, how far back?

This would be:

Fixes efed421a94e6 ("usb: gadget: Add UDC driver for Broadcom USB3.0 device controller IP BDC")

that issue was present since the driver was included in Linux with the commit above, we did not really consider it to be a serious enough bug, but I suppose it would not hurt to affix the said Fixes tag.

Signature · 1 line
Florian
#4 lore raw
Quoted 15 lines · Florian Fainelli
Quoted 12 lines · Greg KH
Quoted 10 lines · On Wed, Oct 05, 2022 at 12:13:55PM -0700, [email protected] wrote:

From: Justin Chen <[email protected]>

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.

---
  drivers/usb/gadget/udc/bdc/bdc_udc.c | 1 +

  1 file changed, 1 insertion(+)
Quoted 8 lines
Quoted 2 lines

What commit id does this fix?  Should it go to older kernels?  If so, how far back?

This would be:

Fixes efed421a94e6 ("usb: gadget: Add UDC driver for Broadcom USB3.0 device controller IP BDC")

that issue was present since the driver was included in Linux with the commit above, we did not really consider it to be a serious enough bug, but I suppose it would not hurt to affix the said Fixes tag.

Greg, are you picking up the patch as-is, or do you need Justin to resusbmit with the Fixes: tag added?

Signature · 1 line
Florian
maintainer
#5 lore raw
Quoted 24 lines · Florian Fainelli
Quoted 23 lines · Florian Fainelli
Quoted 7 lines · Greg KH
Quoted 6 lines · On Wed, Oct 05, 2022 at 12:13:55PM -0700, [email protected] wrote:

From: Justin Chen <[email protected]>

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.

Quoted 7 lines
Quoted 4 lines

---
  drivers/usb/gadget/udc/bdc/bdc_udc.c | 1 +

  1 file changed, 1 insertion(+)

What commit id does this fix?  Should it go to older kernels?  If so, how far back?

This would be:

Fixes efed421a94e6 ("usb: gadget: Add UDC driver for Broadcom USB3.0

device controller IP BDC")

Quoted 6 lines
Quoted 3 lines

that issue was present since the driver was included in Linux with the commit above, we did not really consider it to be a serious enough bug, but I suppose it would not hurt to affix the said Fixes tag.

Greg, are you picking up the patch as-is, or do you need Justin to resusbmit with the Fixes: tag added?

Now merged, thanks.

greg k-h