Merge "usb: gadget: audio: Free requests only after callback"

This commit is contained in:
qctecmdr 2020-07-29 14:20:19 -07:00 • committed by Gerrit - the friendly Code Review server
commit 19e02a5480
4 changed files with 12 additions and 7 deletions

View file

@ -36,6 +36,7 @@ CONFIG_USB_CONFIGFS_F_DIAG=m
CONFIG_USB_CONFIGFS_F_CCID=m
CONFIG_USB_CONFIGFS_F_CDEV=m
CONFIG_USB_CONFIGFS_F_GSI=m
CONFIG_USB_CONFIGFS_F_UAC2=m
CONFIG_USB_STORAGE=m
CONFIG_TYPEC_UCSI=m
CONFIG_UCSI_QTI_GLINK=m

View file

@ -459,7 +459,7 @@ config USB_CONFIGFS_F_UAC1_LEGACY
to be present on the device.
config USB_CONFIGFS_F_UAC2
bool "Audio Class 2.0"
tristate "Audio Class 2.0"
depends on USB_CONFIGFS
depends on SND
select USB_LIBCOMPOSITE

View file

@ -276,7 +276,7 @@ static struct usb_endpoint_descriptor fs_epout_desc = {
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = USB_DIR_OUT,
.bmAttributes = USB_ENDPOINT_XFER_ISOC | USB_ENDPOINT_SYNC_ASYNC,
.bmAttributes = USB_ENDPOINT_XFER_ISOC | USB_ENDPOINT_SYNC_SYNC,
.wMaxPacketSize = cpu_to_le16(1023),
.bInterval = 1,
};
@ -285,7 +285,7 @@ static struct usb_endpoint_descriptor hs_epout_desc = {
.bLength = USB_DT_ENDPOINT_SIZE,
.bDescriptorType = USB_DT_ENDPOINT,
.bmAttributes = USB_ENDPOINT_XFER_ISOC | USB_ENDPOINT_SYNC_ASYNC,
.bmAttributes = USB_ENDPOINT_XFER_ISOC | USB_ENDPOINT_SYNC_SYNC,
.wMaxPacketSize = cpu_to_le16(1024),
.bInterval = 4,
};
@ -360,7 +360,7 @@ static struct usb_endpoint_descriptor fs_epin_desc = {
.bDescriptorType = USB_DT_ENDPOINT,
.bEndpointAddress = USB_DIR_IN,
.bmAttributes = USB_ENDPOINT_XFER_ISOC | USB_ENDPOINT_SYNC_ASYNC,
.bmAttributes = USB_ENDPOINT_XFER_ISOC | USB_ENDPOINT_SYNC_SYNC,
.wMaxPacketSize = cpu_to_le16(1023),
.bInterval = 1,
};
@ -369,7 +369,7 @@ static struct usb_endpoint_descriptor hs_epin_desc = {
.bLength = USB_DT_ENDPOINT_SIZE,
.bDescriptorType = USB_DT_ENDPOINT,
.bmAttributes = USB_ENDPOINT_XFER_ISOC | USB_ENDPOINT_SYNC_ASYNC,
.bmAttributes = USB_ENDPOINT_XFER_ISOC | USB_ENDPOINT_SYNC_SYNC,
.wMaxPacketSize = cpu_to_le16(1024),
.bInterval = 4,
};

View file

@ -89,7 +89,12 @@ static void u_audio_iso_complete(struct usb_ep *ep, struct usb_request *req)
struct snd_uac_chip *uac = prm->uac;
/* i/f shutting down */
if (!prm->ep_enabled || req->status == -ESHUTDOWN)
if (!prm->ep_enabled) {
usb_ep_free_request(ep, req);
return;
}
if (req->status == -ESHUTDOWN)
return;
/*
@ -352,7 +357,6 @@ static inline void free_ep(struct uac_rtd_params *prm, struct usb_ep *ep)
for (i = 0; i < params->req_number; i++) {
if (prm->ureq[i].req) {
usb_ep_dequeue(ep, prm->ureq[i].req);
usb_ep_free_request(ep, prm->ureq[i].req);
prm->ureq[i].req = NULL;
}
}