summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/composite.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2021-02-17 14:04:39 +0100
committerIngo Molnar <mingo@kernel.org>2021-02-17 14:04:39 +0100
commited3cd45f8ca873dd320ff7e6b4c1c8f83a65302c (patch)
tree783a02c1e78964654fe6d9a9c14b24bfc50e6b3b /drivers/usb/gadget/composite.c
parentsched/fair: Move avg_scan_cost calculations under SIS_PROP (diff)
parentLinux 5.11 (diff)
downloadlinux-ed3cd45f8ca873dd320ff7e6b4c1c8f83a65302c.tar.xz
linux-ed3cd45f8ca873dd320ff7e6b4c1c8f83a65302c.zip
Merge tag 'v5.11' into sched/core, to pick up fixes & refresh the branch
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/usb/gadget/composite.c')
-rw-r--r--drivers/usb/gadget/composite.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index c6d455f2bb92..1a556a628971 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -392,8 +392,11 @@ int usb_function_deactivate(struct usb_function *function)
spin_lock_irqsave(&cdev->lock, flags);
- if (cdev->deactivations == 0)
+ if (cdev->deactivations == 0) {
+ spin_unlock_irqrestore(&cdev->lock, flags);
status = usb_gadget_deactivate(cdev->gadget);
+ spin_lock_irqsave(&cdev->lock, flags);
+ }
if (status == 0)
cdev->deactivations++;
@@ -424,8 +427,11 @@ int usb_function_activate(struct usb_function *function)
status = -EINVAL;
else {
cdev->deactivations--;
- if (cdev->deactivations == 0)
+ if (cdev->deactivations == 0) {
+ spin_unlock_irqrestore(&cdev->lock, flags);
status = usb_gadget_activate(cdev->gadget);
+ spin_lock_irqsave(&cdev->lock, flags);
+ }
}
spin_unlock_irqrestore(&cdev->lock, flags);