diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-01-11 08:11:26 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-01-11 08:11:26 +0100 |
commit | a66a7d48f34a253429999dcc7188f607cd7a206a (patch) | |
tree | c8f135f000b000f59dd171eb51b850d9374f8f9c /drivers/usb/gadget/composite.c | |
parent | usb: usbip: Use DEFINE_SPINLOCK() for spinlock (diff) | |
parent | Linux 5.11-rc3 (diff) | |
download | linux-a66a7d48f34a253429999dcc7188f607cd7a206a.tar.xz linux-a66a7d48f34a253429999dcc7188f607cd7a206a.zip |
Merge 5.11-rc3 into usb-next
Resolves a merge issue in:
drivers/usb/dwc3/gadget.c
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/gadget/composite.c')
-rw-r--r-- | drivers/usb/gadget/composite.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index 86e86a005e25..9a7cc08d6593 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); |