[4.2.y-ckt stable] Patch "usb: cdc-acm: handle unlinked urb in acm read callback" has been added to the 4.2.y-ckt tree
Kamal Mostafa
kamal at canonical.com
Thu Feb 4 22:10:46 UTC 2016
This is a note to let you know that I have just added a patch titled
usb: cdc-acm: handle unlinked urb in acm read callback
to the linux-4.2.y-queue branch of the 4.2.y-ckt extended stable tree
which can be found at:
http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-4.2.y-queue
This patch is scheduled to be released in version 4.2.8-ckt4.
If you, or anyone else, feels it should not be added to this tree, please
reply to this email.
For more information about the 4.2.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable
Thanks.
-Kamal
---8<------------------------------------------------------------
>From cdd6448888b2de4b5bae314896909e95c561c5ad Mon Sep 17 00:00:00 2001
From: Lu Baolu <baolu.lu at linux.intel.com>
Date: Wed, 30 Dec 2015 12:59:08 +0800
Subject: usb: cdc-acm: handle unlinked urb in acm read callback
commit 19454462acb1bdef80542061bdc9b410e4ed1ff6 upstream.
In current acm driver, the bulk-in callback function ignores the
URBs unlinked in usb core.
This causes unexpected data loss in some cases. For example,
runtime suspend entry will unlinked all urbs and set urb->status
to -ENOENT even those urbs might have data not processed yet.
Hence, data loss occurs.
This patch lets bulk-in callback function handle unlinked urbs
to avoid data loss.
Signed-off-by: Tang Jian Qiang <jianqiang.tang at intel.com>
Signed-off-by: Lu Baolu <baolu.lu at linux.intel.com>
Acked-by: Oliver Neukum <oneukum at suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
---
drivers/usb/class/cdc-acm.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 26ca4f9..8cd193b 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -428,7 +428,8 @@ static void acm_read_bulk_callback(struct urb *urb)
set_bit(rb->index, &acm->read_urbs_free);
dev_dbg(&acm->data->dev, "%s - non-zero urb status: %d\n",
__func__, status);
- return;
+ if ((status != -ENOENT) || (urb->actual_length == 0))
+ return;
}
usb_mark_last_busy(acm->dev);
--
1.9.1
More information about the kernel-team
mailing list