From ab5db3d4930f10bf26e5c2d9ca567a447b433e41 Mon Sep 17 00:00:00 2001 From: Steve Lin Date: Thu, 19 Jul 2012 12:36:18 -0700 Subject: usb: cdc-acm: fix packet loss issue There is race between acm_suspend and acm_read_bulk_callback. Host may receive bulk transfer right before suspend. The packet will be discarded if this urb is killed in acm_suspend. This patch checks the actual length of urb and processes it in this case. Bug 996268 Signed-off-by: Steve Lin Change-Id: Ief2b42708160b67903f976ec60da825d46c4720b Reviewed-on: http://git-master/r/117135 (cherry picked from commit af3e96c987fbae8a135d1ff18872b9c32e09b67f) Reviewed-on: http://git-master/r/118105 Reviewed-by: Automatic_Commit_Validation_User Tested-by: Steve Lin Reviewed-by: Steve Lin --- drivers/usb/class/cdc-acm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/usb') diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 8fb105e03658..cd16e13f61c9 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c @@ -416,7 +416,7 @@ static void acm_read_bulk_callback(struct urb *urb) } usb_mark_last_busy(acm->dev); - if (urb->status) { + if (urb->status && !urb->actual_length) { dev_dbg(&acm->data->dev, "%s - non-zero urb status: %d\n", __func__, urb->status); return; -- cgit v1.2.3