Skip to content

Commit bf95c4d

Browse files
Vijayavardhan Vennapusagregkh
authored andcommitted
usb: gadget: configfs: clear deactivation flag in configfs_composite_unbind()
If any function like UVC is deactivating gadget as part of composition switch which results in not calling pullup enablement, it is not getting enabled after switch to new composition due to this deactivation flag not cleared. This results in USB enumeration not happening after switch to new USB composition. Hence clear deactivation flag inside gadget structure in configfs_composite_unbind() before switch to new USB composition. Signed-off-by: Vijayavardhan Vennapusa <[email protected]> Signed-off-by: Dan Vacura <[email protected]> Cc: stable <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 929b22e commit bf95c4d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/usb/gadget/configfs.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1438,6 +1438,8 @@ static void configfs_composite_unbind(struct usb_gadget *gadget)
14381438
usb_ep_autoconfig_reset(cdev->gadget);
14391439
spin_lock_irqsave(&gi->spinlock, flags);
14401440
cdev->gadget = NULL;
1441+
cdev->deactivations = 0;
1442+
gadget->deactivated = false;
14411443
set_gadget_data(gadget, NULL);
14421444
spin_unlock_irqrestore(&gi->spinlock, flags);
14431445
}

0 commit comments

Comments
 (0)