From: Mike Lockwood Date: Thu, 2 Aug 2012 18:22:05 +0000 (-0700) Subject: USB: gadget: f_audio_source: Fix error handling and increase packet size X-Git-Tag: firefly_0821_release~7613^2~69 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2fa1f1c9b55a1494462d4e0d8c591ac0aecc9f78;p=firefly-linux-kernel-4.4.55.git USB: gadget: f_audio_source: Fix error handling and increase packet size Fixes watchdog reset on USB disconnect Larger packet size fixes performance in fullspeed mode Signed-off-by: Mike Lockwood --- diff --git a/drivers/usb/gadget/f_audio_source.c b/drivers/usb/gadget/f_audio_source.c index 23a75117124f..ba8e007c7969 100644 --- a/drivers/usb/gadget/f_audio_source.c +++ b/drivers/usb/gadget/f_audio_source.c @@ -22,11 +22,9 @@ #include #define SAMPLE_RATE 44100 -/* Each frame is two 16 bit integers (one per channel) */ -#define BYTES_PER_FRAME 4 #define FRAMES_PER_MSEC (SAMPLE_RATE / 1000) -#define IN_EP_MAX_PACKET_SIZE 256 +#define IN_EP_MAX_PACKET_SIZE 384 /* Number of requests to allocate */ #define IN_EP_REQ_COUNT 4 @@ -414,7 +412,7 @@ static void audio_data_complete(struct usb_ep *ep, struct usb_request *req) audio_req_put(audio, req); - if (!audio->buffer_start) + if (!audio->buffer_start || req->status) return; audio->period_offset += req->actual;